Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New updates detected with Cruft #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/cthoyt/cookiecutter-snekpack",
"commit": "3089b545d90ceb95f3e6bf354fad86e75c0c89dc",
"commit": "12edfcfa5f519467b5d834f0d4e706fb7cf4f065",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
32 changes: 8 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <the API token you just got>

# 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 = <an API token from test PyPI>
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

Expand All @@ -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.
Expand Down
12 changes: 12 additions & 0 deletions docs/source/index.rst.rej
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/callowayproject/bump-my-version>`_
- - Building with ``uv build``
- - Releasing to PyPI with ``twine``
+ - Building with `uv build <https://docs.astral.sh/uv/guides/publish/#building-your-package>`_
+ - Releasing to PyPI with `uv publish <https://docs.astral.sh/uv/guides/publish/#publishing-your-package>`_
- A command line interface with ``click``
- A vanity CLI via python entrypoints
- A `py.typed` file so other packages can use your type hints
55 changes: 10 additions & 45 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <the API token you just got>
#
# 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 =
Expand All @@ -246,8 +231,6 @@ description =
skip_install = true
passenv =
HOME
TWINE_USERNAME
TWINE_PASSWORD
deps =
{[testenv:release]deps}
bump-my-version
Expand All @@ -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 = <the API token you just got>
#
# 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 =
Expand All @@ -309,8 +276,6 @@ description =
skip_install = true
passenv =
HOME
TWINE_USERNAME
TWINE_PASSWORD
deps =
{[testenv:testrelease]deps}
bump-my-version
Expand Down