Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aldbr committed Feb 27, 2025
1 parent c4170dd commit 168a6bc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- uses: actions/checkout@v4
- name: Set up environment
run: |
pip install git+https://github.com/DIRACGrid/DIRAC.git@integration
pip install ./diracx-routers
- name: Run import-lint
run: |
Expand Down
29 changes: 28 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ markers = [

[tool.importlinter]
root_packages = ["diracx.routers", "diracx.backend"]
include_external_packages = "True"

[[tool.importlinter.contracts]]
name = "Layers contract: Routers -> Backend.Business -> Backend.DataAccess"
Expand All @@ -172,12 +173,38 @@ layers = [
]

[[tool.importlinter.contracts]]
name = "Prevent Routers from Accessing Backend.DataAccess directly"
name = "Prevent Routers from accessing Backend.DataAccess directly"
type = "forbidden"
source_modules = [
"diracx.routers",
]
forbidden_modules = [
"diracx.backend.data_access",
]
ignore_imports = [
"diracx.routers.dependencies -> diracx.backend.data_access.**",
"diracx.routers.factory -> diracx.backend.data_access.**",
]
allow_indirect_imports = "True"

[[tool.importlinter.contracts]]
name = "Prevent Backend.Business from accessing sqlalchemy/opensearch directly"
type = "forbidden"
source_modules = [
"diracx.backend.business",
]
forbidden_modules = [
"sqlalchemy",
"opensearchpy",
]
allow_indirect_imports = "True"

[[tool.importlinter.contracts]]
name = "Prevent Backend.DataAccess from accessing Dirac directly"
type = "forbidden"
source_modules = [
"diracx.backend.data_access",
]
forbidden_modules = [
"DIRAC",
]

0 comments on commit 168a6bc

Please sign in to comment.