Skip to content

Commit

Permalink
Reuse extras instead of dependency groups (#2307)
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <[email protected]>
  • Loading branch information
gaborbernat authored Feb 7, 2025
1 parent 08d60be commit ba52cea
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync
run: uv sync --all-extras
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
Expand Down
29 changes: 6 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ classifiers = [
dynamic = [
"version",
]

dependencies = [
"argcomplete>=2.10.1,<4",
"black>=19.10b0",
Expand All @@ -42,7 +41,12 @@ dependencies = [
"pyyaml>=6.0.1",
"tomli>=2.2.1,<3; python_version<='3.11'",
]

optional-dependencies.all = [
"datamodel-code-generator[debug]",
"datamodel-code-generator[graphql]",
"datamodel-code-generator[http]",
"datamodel-code-generator[validation]",
]
optional-dependencies.debug = [
"pysnooper>=0.4.1,<2",
]
Expand All @@ -63,15 +67,11 @@ scripts.datamodel-codegen = "datamodel_code_generator.__main__:main"
[dependency-groups]
dev = [
{ include-group = "coverage" },
{ include-group = "debug" },
{ include-group = "docs" },
{ include-group = "fix" },
{ include-group = "graphql" },
{ include-group = "http" },
{ include-group = "pkg-meta" },
{ include-group = "test" },
{ include-group = "type" },
{ include-group = "validation" },
]
test = [
"diff-cover>=7.7",
Expand All @@ -85,10 +85,6 @@ test = [
"pytest-mock>=3.14",
"pytest-xdist>=3.3.1",
"setuptools; python_version<'3.9'",
{ include-group = "debug" },
{ include-group = "graphql" },
{ include-group = "http" },
{ include-group = "validation" },
]
type = [
"pyright>=1.1.393",
Expand All @@ -102,19 +98,6 @@ docs = [
"mkdocs>=1.6",
"mkdocs-material>=9.5.31",
]
debug = [
"pysnooper>=0.4.1,<2",
]
graphql = [
"graphql-core>=3.2.3",
]
http = [
"httpx>=0.24.1",
]
validation = [
"openapi-spec-validator>=0.2.8,<0.7",
"prance>=0.18.2",
]
black19-pydantic18 = [ "black==19.10b0", "pydantic==1.8.2" ]
black22 = [ "black==22.1" ]
black23 = [ "black==23.12" ]
Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ runner = uv-venv-lock-runner
description = run the unit tests with pytest under {base_python}
package = wheel
wheel_build_env = .pkg
extras =
all
pass_env =
DIFF_AGAINST
HTTP_IGNORE_TLS
Expand Down Expand Up @@ -106,6 +108,7 @@ dependency_groups = type

[testenv:docs]
description = generate documentation
extras =
commands =
mkdocs build --verbose --clean --strict -d {posargs:{env_tmp_dir}}
python -c 'print("Documentation generated at file://{posargs:{env_tmp_dir}}{/}index.html")'
Expand Down
Loading

0 comments on commit ba52cea

Please sign in to comment.