File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 - name : Set up uv
2222 uses : astral-sh/setup-uv@v8.1.0
2323 - name : Install dependencies
24- run : uv sync --group dev
24+ run : uv sync --group dev --group publish
2525 - name : Build distributions
2626 run : uv build
27+ - name : Check distributions
28+ run : uv run --group publish twine check dist/*
2729 - name : Run tests
2830 run : uv run pytest
2931 - name : Upload distribution artifacts
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ build: clean-build
4848 uv build $(UV_PYTHON_FLAG )
4949
5050check :
51- uv run $(UV_PYTHON_FLAG ) twine check dist/*
51+ uv run $(UV_PYTHON_FLAG ) --group publish twine check dist/*
5252
5353publish :
5454 uv publish
Original file line number Diff line number Diff line change @@ -34,9 +34,11 @@ dev = [
3434 " pytest-xdist" ,
3535 " setuptools>=77" ,
3636 " tomli>=2.0.1; python_version < '3.11'" ,
37- " twine>=6.0.0" ,
3837 " wheel" ,
3938]
39+ publish = [
40+ " twine>=6.0.0; python_version >= '3.10'" ,
41+ ]
4042
4143[build-system ]
4244requires = [" setuptools>=77" , " wheel" ]
Original file line number Diff line number Diff line change 44psutil
55setuptools >= 77
66tomli >= 2.0.1 ; python_version < "3.11"
7- twine >= 6.0.0
87wheel
Original file line number Diff line number Diff line change @@ -17,6 +17,17 @@ def test_pyproject_configures_uv_and_setuptools_build():
1717 assert 'dev' in pyproject ['dependency-groups' ]
1818
1919
20+ def test_publish_tools_are_isolated_from_python39_dev_group ():
21+ dependency_groups = tomllib .loads ((ROOT / 'pyproject.toml' ).read_text ())['dependency-groups' ]
22+
23+ assert all ('twine' not in dependency for dependency in dependency_groups ['dev' ])
24+ assert 'publish' in dependency_groups
25+ assert any (
26+ 'twine' in dependency and "python_version >= '3.10'" in dependency
27+ for dependency in dependency_groups ['publish' ]
28+ )
29+
30+
2031def test_makefile_uses_uv_for_common_development_tasks ():
2132 makefile = (ROOT / 'Makefile' ).read_text ()
2233
@@ -31,6 +42,7 @@ def test_release_workflow_builds_github_release_and_publishes_with_uv():
3142
3243 assert 'v*.*.*' in workflow
3344 assert 'uv build' in workflow
45+ assert 'twine check' in workflow
3446 assert 'softprops/action-gh-release' in workflow
3547 assert 'UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}' in workflow
3648 assert 'uv publish' in workflow
You can’t perform that action at this time.
0 commit comments