diff --git a/.cruft.json b/.cruft.json index 041b28b..7338dc9 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/cthoyt/cookiecutter-snekpack", - "commit": "3089b545d90ceb95f3e6bf354fad86e75c0c89dc", + "commit": "12edfcfa5f519467b5d834f0d4e706fb7cf4f065", "checkout": null, "context": { "cookiecutter": { diff --git a/README.md b/README.md index dd5f159..9091193 100644 --- a/README.md +++ b/README.md @@ -217,30 +217,15 @@ You only have to do the following steps once. #### Configuring your machine's connection to PyPI -You have to do the following steps once per machine. Create a file in your home directory called -`.pypirc` and include the following: - -```ini -[distutils] -index-servers = - pypi - testpypi - -[pypi] -username = __token__ -password = - -# This block is optional in case you want to be able to make test releases to the Test PyPI server -[testpypi] -repository = https://test.pypi.org/legacy/ -username = __token__ -password = +You have to do the following steps once per machine. + +```console +$ uv tool install keyring +$ keyring set https://upload.pypi.org/legacy/ __token__ +$ keyring set https://test.pypi.org/legacy/ __token__ ``` -Note that since PyPI is requiring token-based authentication, we use `__token__` as the user, verbatim. -If you already have a `.pypirc` file with a `[distutils]` section, just make sure that there is an `index-servers` -key and that `pypi` is in its associated list. More information on configuring the `.pypirc` file can -be found [here](https://packaging.python.org/en/latest/specifications/pypirc). +Note that this deprecates previous workflows using `.pypirc`. #### Uploading to PyPI @@ -259,8 +244,7 @@ This script does the following: and [`docs/source/conf.py`](docs/source/conf.py) to not have the `-dev` suffix 2. Packages the code in both a tar archive and a wheel using [`uv build`](https://docs.astral.sh/uv/guides/publish/#building-your-package) -3. Uploads to PyPI using [`twine upload`](https://github.com/pypa/twine). - This will be replaced soon with `uv publish` (see https://github.com/cthoyt/cookiecutter-snekpack/issues/29) +3. Uploads to PyPI using [`uv publish`](https://docs.astral.sh/uv/guides/publish/#publishing-your-package). 4. Push to GitHub. You'll need to make a release going with the commit where the version was bumped. 5. Bump the version to the next patch. If you made big changes and want to bump the version by minor, you can use `tox -e bumpversion -- minor` after. diff --git a/docs/source/index.rst.rej b/docs/source/index.rst.rej new file mode 100644 index 0000000..893886f --- /dev/null +++ b/docs/source/index.rst.rej @@ -0,0 +1,12 @@ +diff a/docs/source/index.rst b/docs/source/index.rst (rejected hunks) +@@ -21,8 +21,8 @@ It comes with the following: + - Testing of MANIFEST correctness with ``check-manifest`` + - Testing of optional static typing with ``mypy`` + - Version management with `bump-my-version `_ +- - Building with ``uv build`` +- - Releasing to PyPI with ``twine`` ++ - Building with `uv build `_ ++ - Releasing to PyPI with `uv publish `_ + - A command line interface with ``click`` + - A vanity CLI via python entrypoints + - A `py.typed` file so other packages can use your type hints diff --git a/tox.ini b/tox.ini index 11d7abc..973ff83 100644 --- a/tox.ini +++ b/tox.ini @@ -210,34 +210,19 @@ commands = # 3. Get account recovery codes # 4. Set up 2-Factor Authentication # 5. Get an API token from https://pypi.org/manage/account/token/ -# 6. Create a file called .pypirc in the home directory if it does not already exist. -# 7. Add the following content to the .pypirc file -# -# [distutils] -# index-servers= -# pypi -# testpypi -# -# [pypi] -# username = __token__ -# password = -# -# If there's already an `index-servers =` list, just make sure you add `pypi` to it. -# More information about .pypirc can be found at https://packaging.python.org/en/latest/specifications/pypirc/ +# 6. Install keyring with `uv tool install keyring` +# 7. Add your token to keyring with `keyring set https://upload.pypi.org/legacy/ __token__` [testenv:release] description = Release the code to PyPI so users can pip install it skip_install = true -passenv = - TWINE_USERNAME - TWINE_PASSWORD deps = {[testenv:build]deps} - twine >= 1.5.0 + uv + keyring commands = {[testenv:build]commands} - twine check dist/* - twine upload --skip-existing dist/* + uv publish --username __token__ --keyring-provider subprocess --publish-url https://upload.pypi.org/legacy/ [testenv:finish] description = @@ -246,8 +231,6 @@ description = skip_install = true passenv = HOME - TWINE_USERNAME - TWINE_PASSWORD deps = {[testenv:release]deps} bump-my-version @@ -272,35 +255,19 @@ allowlist_externals = # 3. Get account recovery codes # 4. Set up 2-Factor Authentication # 5. Get an API token from https://test.pypi.org/manage/account/token/ -# 6. Create a file called .pypirc in the home directory if it does not already exist. -# 7. Add the following content to the .pypirc file -# -# [distutils] -# index-servers= -# pypi -# testpypi -# -# [testpypi] -# repository = https://test.pypi.org/legacy/ -# username = __token__ -# password = -# -# If there's already an `index-servers =` list, just make sure you add `testpypi` to it. -# More information about .pypirc can be found at https://packaging.python.org/en/latest/specifications/pypirc/ +# 6. Install keyring with `uv tool install keyring` +# 7. Add your token to keyring with `keyring set https://test.pypi.org/legacy/ __token__` [testenv:testrelease] description = Release the code to the test PyPI site skip_install = true -passenv = - TWINE_USERNAME - TWINE_PASSWORD deps = {[testenv:build]deps} - twine >= 1.5.0 + uv + keyring commands = {[testenv:build]commands} - twine check dist/* - twine upload --skip-existing --repository testpypi dist/* + uv publish --username __token__ --keyring-provider subprocess --publish-url https://test.pypi.org/legacy/ [testenv:testfinish] description = @@ -309,8 +276,6 @@ description = skip_install = true passenv = HOME - TWINE_USERNAME - TWINE_PASSWORD deps = {[testenv:testrelease]deps} bump-my-version