Skip to content

Commit f715d2b

Browse files
committed
Separate publish dependencies from dev group
1 parent c79b2dc commit f715d2b

6 files changed

Lines changed: 51 additions & 301 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ jobs:
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

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ build: clean-build
4848
uv build $(UV_PYTHON_FLAG)
4949

5050
check:
51-
uv run $(UV_PYTHON_FLAG) twine check dist/*
51+
uv run $(UV_PYTHON_FLAG) --group publish twine check dist/*
5252

5353
publish:
5454
uv publish

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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]
4244
requires = ["setuptools>=77", "wheel"]

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ coverage
44
psutil
55
setuptools>=77
66
tomli>=2.0.1; python_version < "3.11"
7-
twine>=6.0.0
87
wheel

tests/test_project_config.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
2031
def 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

0 commit comments

Comments
 (0)