Skip to content

Commit e7bfc8a

Browse files
committed
add deptry for opencloning-db
1 parent 224e8ef commit e7bfc8a

File tree

4 files changed

+38
-8
lines changed

4 files changed

+38
-8
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,16 @@ repos:
6060
packages/opencloning/pyproject.toml|
6161
pyproject.toml
6262
)$
63+
- repo: local
64+
hooks:
65+
- id: deptry-opencloning-db
66+
name: deptry (opencloning-db)
67+
entry: uv run deptry --config packages/opencloning-db/pyproject.toml packages/opencloning-db/src
68+
language: system
69+
pass_filenames: false
70+
files: |
71+
(?x)^(
72+
packages/opencloning-db/src/.*|
73+
packages/opencloning-db/pyproject.toml|
74+
pyproject.toml
75+
)$

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,13 @@ uv run --directory packages/opencloning-db/src python -m opencloning_db.init_db
167167

168168
This repository uses a uv workspace. In a workspace, dependencies are resolved in one shared environment, so imports can appear to work even when a package does not declare them in its own `pyproject.toml`.
169169

170-
To catch that for `opencloning`, pre-commit runs `deptry` against `packages/opencloning/src` using `packages/opencloning/pyproject.toml` as the source of truth for declared dependencies.
170+
To catch that, pre-commit runs `deptry` separately for `opencloning` and `opencloning-db`, each using that package’s `pyproject.toml` as the source of truth for declared dependencies.
171171

172-
Run it manually from the repository root:
172+
Run them manually from the repository root:
173173

174174
```bash
175175
uv run deptry --config packages/opencloning/pyproject.toml packages/opencloning/src
176+
uv run deptry --config packages/opencloning-db/pyproject.toml packages/opencloning-db/src
176177
```
177178

178179
Current rollout note: known undeclared imports such as `pydna` are temporarily ignored and should be removed from the ignore list once dependencies are declared.

packages/opencloning-db/pyproject.toml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ description = "Database for OpenCloning, a web application to generate molecular
1313
requires-python = ">=3.11,<4"
1414
dependencies = [
1515
"opencloning",
16-
"sqlalchemy>=2.0.41,<3",
16+
"fastapi>=0.135.3",
1717
"fastapi-pagination>=0.15.10,<0.16",
18+
"opencloning-linkml>=1.0.0",
19+
"pydantic[email]>=2.7.1",
20+
"sqlalchemy>=2.0.41,<3",
1821
"PyJWT>=2.10.1,<3",
1922
"pwdlib[argon2]>=0.2.1,<0.3",
2023
"pydna>=5.5.9",
21-
"email-validator>=2.3.0,<3",
2224
]
2325

2426
[tool.uv.sources]
@@ -27,12 +29,14 @@ opencloning = { workspace = true }
2729
[tool.poetry.dependencies]
2830
python = "^3.11"
2931
opencloning = {path = "../../opencloning", develop = true}
30-
sqlalchemy = "^2.0.41"
32+
fastapi = "^0.135.3"
3133
fastapi-pagination = "^0.15.10"
34+
opencloning-linkml = "^1.0.0"
35+
pydantic = {version = "^2.7.1", extras = ["email"]}
36+
sqlalchemy = "^2.0.41"
3237
PyJWT = "^2.10.1"
3338
pwdlib = {version = "^0.2.1", extras = ["argon2"]}
3439
pydna = "^5.5.9"
35-
email-validator = "^2.3.0"
3640

3741
[tool.poetry.group.dev.dependencies]
3842
autopep8 = "^2.0.4"
@@ -61,3 +65,6 @@ requires = ["poetry-core>=1.0.0"]
6165
[tool.black]
6266
skip-string-normalization = true
6367
line-length = 119
68+
69+
[tool.deptry]
70+
known_first_party = ["opencloning_db"]

uv.lock

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)