Skip to content

Commit ba52cea

Browse files
authored
Reuse extras instead of dependency groups (#2307)
Signed-off-by: Bernát Gábor <[email protected]>
1 parent 08d60be commit ba52cea

File tree

4 files changed

+80
-104
lines changed

4 files changed

+80
-104
lines changed

Diff for: .github/workflows/codspeed.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Install the latest version of uv
2727
uses: astral-sh/setup-uv@v5
2828
- name: Install dependencies
29-
run: uv sync
29+
run: uv sync --all-extras
3030
- name: Run benchmarks
3131
uses: CodSpeedHQ/action@v3
3232
with:

Diff for: pyproject.toml

+6-23
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ classifiers = [
2929
dynamic = [
3030
"version",
3131
]
32-
3332
dependencies = [
3433
"argcomplete>=2.10.1,<4",
3534
"black>=19.10b0",
@@ -42,7 +41,12 @@ dependencies = [
4241
"pyyaml>=6.0.1",
4342
"tomli>=2.2.1,<3; python_version<='3.11'",
4443
]
45-
44+
optional-dependencies.all = [
45+
"datamodel-code-generator[debug]",
46+
"datamodel-code-generator[graphql]",
47+
"datamodel-code-generator[http]",
48+
"datamodel-code-generator[validation]",
49+
]
4650
optional-dependencies.debug = [
4751
"pysnooper>=0.4.1,<2",
4852
]
@@ -63,15 +67,11 @@ scripts.datamodel-codegen = "datamodel_code_generator.__main__:main"
6367
[dependency-groups]
6468
dev = [
6569
{ include-group = "coverage" },
66-
{ include-group = "debug" },
6770
{ include-group = "docs" },
6871
{ include-group = "fix" },
69-
{ include-group = "graphql" },
70-
{ include-group = "http" },
7172
{ include-group = "pkg-meta" },
7273
{ include-group = "test" },
7374
{ include-group = "type" },
74-
{ include-group = "validation" },
7575
]
7676
test = [
7777
"diff-cover>=7.7",
@@ -85,10 +85,6 @@ test = [
8585
"pytest-mock>=3.14",
8686
"pytest-xdist>=3.3.1",
8787
"setuptools; python_version<'3.9'",
88-
{ include-group = "debug" },
89-
{ include-group = "graphql" },
90-
{ include-group = "http" },
91-
{ include-group = "validation" },
9288
]
9389
type = [
9490
"pyright>=1.1.393",
@@ -102,19 +98,6 @@ docs = [
10298
"mkdocs>=1.6",
10399
"mkdocs-material>=9.5.31",
104100
]
105-
debug = [
106-
"pysnooper>=0.4.1,<2",
107-
]
108-
graphql = [
109-
"graphql-core>=3.2.3",
110-
]
111-
http = [
112-
"httpx>=0.24.1",
113-
]
114-
validation = [
115-
"openapi-spec-validator>=0.2.8,<0.7",
116-
"prance>=0.18.2",
117-
]
118101
black19-pydantic18 = [ "black==19.10b0", "pydantic==1.8.2" ]
119102
black22 = [ "black==22.1" ]
120103
black23 = [ "black==23.12" ]

Diff for: tox.ini

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ runner = uv-venv-lock-runner
2323
description = run the unit tests with pytest under {base_python}
2424
package = wheel
2525
wheel_build_env = .pkg
26+
extras =
27+
all
2628
pass_env =
2729
DIFF_AGAINST
2830
HTTP_IGNORE_TLS
@@ -106,6 +108,7 @@ dependency_groups = type
106108

107109
[testenv:docs]
108110
description = generate documentation
111+
extras =
109112
commands =
110113
mkdocs build --verbose --clean --strict -d {posargs:{env_tmp_dir}}
111114
python -c 'print("Documentation generated at file://{posargs:{env_tmp_dir}}{/}index.html")'

0 commit comments

Comments
 (0)