Skip to content

Commit 8b38261

Browse files
committed
Use uv for publishing to PyPI instead of twine
1 parent 781f613 commit 8b38261

File tree

5 files changed

+11
-56
lines changed

5 files changed

+11
-56
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ for a list of dependencies needed for building `cmd2`.
8585
| [setuptools](https://pypi.org/project/setuptools/) | `72.1.0` | Python package management |
8686
| [setuptools-scm](https://github.com/pypa/setuptools-scm) | `8.0.4` | Manage your versions by scm tags |
8787

88-
> [twine](https://github.com/pypa/twine) 5.1 or newer is also needed for publishing releases to
89-
> PyPI, but that is something only core maintainers need to worry about.
88+
> [uv-publish](https://pypi.org/project/uv-publish/) is also needed for publishing releases to PyPI,
89+
> but that is something only core maintainers need to worry about.
9090
9191
#### Additional prerequisites for developing cmd2
9292

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
## 4.0.0 (TBD, 2026)
1+
## 3.1.0 (December 25, 2025)
22

33
- Potentially Breaking Changes
44
- `cmd2` no longer has a dependency on `cmd` and `cmd2.Cmd` no longer inherits from `cmd.Cmd`
55
- We don't _think_ this should impact users, but there is theoretically a possibility
6+
- This opens the door for more impactful changes in the next major release
67

78
## 3.0.0 (December 7, 2025)
89

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ docs: ## Build and serve the documentation
4646
.PHONY: build
4747
build: clean-build ## Build wheel file
4848
@echo "🚀 Creating wheel file"
49-
@uvx --from build pyproject-build --installer uv
49+
@uv build
5050

5151
.PHONY: clean-build
5252
clean-build: ## Clean build artifacts
@@ -66,14 +66,14 @@ validate-tag: ## Check to make sure that a tag exists for the current HEAD and i
6666
@uv run inv validatetag
6767

6868
.PHONY: publish-test
69-
publish-test: validate-tag build ## Test publishing a release to PyPI.
69+
publish-test: validate-tag build ## Test publishing a release to PyPI, uses token from ~/.pypirc file.
7070
@echo "🚀 Publishing: Dry run."
71-
@uvx twine upload --repository testpypi dist/*
71+
@uv run uv-publish --repository testpypi
7272

7373
.PHONY: publish
74-
publish: validate-tag build ## Publish a release to PyPI.
74+
publish: validate-tag build ## Publish a release to PyPI, uses token from ~/.pypirc file.
7575
@echo "🚀 Publishing."
76-
@uvx twine upload dist/*
76+
@uv run uv-publish
7777

7878
.PHONY: help
7979
help:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ dev = [
5353
"pytest-cov>=5",
5454
"pytest-mock>=3.14.1",
5555
"ruff>=0.14.10",
56-
"twine>=6.1",
56+
"uv-publish>=1.3",
5757
]
5858
docs = [
5959
"black>=25",

tasks.py

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
"""Development related tasks to be run with 'invoke'.
2-
3-
Make sure you satisfy the following Python module requirements if you are trying to publish a release to PyPI:
4-
- twine >= 1.11.0
5-
- wheel >= 0.31.0
6-
- setuptools >= 39.1.0
7-
"""
1+
"""Development related tasks to be run with 'invoke'."""
82

93
import contextlib
104
import os
@@ -279,43 +273,3 @@ def validatetag(context: Context) -> None:
279273

280274

281275
namespace.add_task(validatetag)
282-
283-
284-
@invoke.task(pre=[clean_all])
285-
def sdist(context: Context) -> None:
286-
"""Create a source distribution."""
287-
with context.cd(TASK_ROOT_STR):
288-
context.run('python -m build --sdist')
289-
290-
291-
namespace.add_task(sdist)
292-
293-
294-
@invoke.task(pre=[clean_all])
295-
def wheel(context: Context) -> None:
296-
"""Build a wheel distribution."""
297-
with context.cd(TASK_ROOT_STR):
298-
context.run('python -m build --wheel')
299-
300-
301-
namespace.add_task(wheel)
302-
303-
304-
@invoke.task(pre=[validatetag, sdist, wheel])
305-
def pypi(context: Context) -> None:
306-
"""Build and upload a distribution to pypi."""
307-
with context.cd(TASK_ROOT_STR):
308-
context.run('twine upload dist/*')
309-
310-
311-
namespace.add_task(pypi)
312-
313-
314-
@invoke.task(pre=[validatetag, sdist, wheel])
315-
def pypi_test(context: Context) -> None:
316-
"""Build and upload a distribution to https://test.pypi.org."""
317-
with context.cd(TASK_ROOT_STR):
318-
context.run('twine upload --repository testpypi dist/*')
319-
320-
321-
namespace.add_task(pypi_test)

0 commit comments

Comments
 (0)