Skip to content

Commit 168a6bc

Browse files
committed
fix
1 parent c4170dd commit 168a6bc

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- uses: actions/checkout@v4
3737
- name: Set up environment
3838
run: |
39+
pip install git+https://github.com/DIRACGrid/DIRAC.git@integration
3940
pip install ./diracx-routers
4041
- name: Run import-lint
4142
run: |

pyproject.toml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ markers = [
161161

162162
[tool.importlinter]
163163
root_packages = ["diracx.routers", "diracx.backend"]
164+
include_external_packages = "True"
164165

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

174175
[[tool.importlinter.contracts]]
175-
name = "Prevent Routers from Accessing Backend.DataAccess directly"
176+
name = "Prevent Routers from accessing Backend.DataAccess directly"
176177
type = "forbidden"
177178
source_modules = [
178179
"diracx.routers",
179180
]
180181
forbidden_modules = [
181182
"diracx.backend.data_access",
182183
]
184+
ignore_imports = [
185+
"diracx.routers.dependencies -> diracx.backend.data_access.**",
186+
"diracx.routers.factory -> diracx.backend.data_access.**",
187+
]
188+
allow_indirect_imports = "True"
189+
190+
[[tool.importlinter.contracts]]
191+
name = "Prevent Backend.Business from accessing sqlalchemy/opensearch directly"
192+
type = "forbidden"
193+
source_modules = [
194+
"diracx.backend.business",
195+
]
196+
forbidden_modules = [
197+
"sqlalchemy",
198+
"opensearchpy",
199+
]
183200
allow_indirect_imports = "True"
201+
202+
[[tool.importlinter.contracts]]
203+
name = "Prevent Backend.DataAccess from accessing Dirac directly"
204+
type = "forbidden"
205+
source_modules = [
206+
"diracx.backend.data_access",
207+
]
208+
forbidden_modules = [
209+
"DIRAC",
210+
]

0 commit comments

Comments
 (0)