Skip to content
Closed
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
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,31 @@ MIT — see LICENSE.
## Publish to PyPI

This repository is already structured as a Python package (`src` layout, metadata in `pyproject.toml`).

### 1. Prepare your PyPI credentials

1. Sign in (or create an account) on [PyPI](https://pypi.org/) and optionally on [TestPyPI](https://test.pypi.org/).
2. Go to **Account settings ▸ API tokens ▸ Add API token**.
3. Give the token a descriptive name (for example `sudoku-dlx-bitset-publish`) and choose the project scope
(selecting *Entire account* allows uploads for future projects, while *Project: sudoku-dlx-bitset* restricts it).
4. Copy the generated token immediately—PyPI only shows it once. The token will look like `pypi-AgENdGVzdC5weXBpLm9yZwIk...`.
5. Store it securely:
* For local publishing, create a `~/.pypirc` file and set the token as the password:

```ini
[pypi]
username = __token__
password = pypi-your-token-value

[testpypi]
username = __token__
password = pypi-your-test-token-value
```

* For GitHub Actions, add the token as an encrypted secret (e.g. `PYPI_API_TOKEN`) and pass it to `twine` using
`TWINE_USERNAME=__token__` and `TWINE_PASSWORD=${{ secrets.PYPI_API_TOKEN }}`.

### 2. Build the release artifacts
To publish a new version on [PyPI](https://pypi.org/project/sudoku-dlx-bitset/):

1. Update `pyproject.toml` with the new `version` and adjust the changelog/release notes.
Expand All @@ -93,12 +118,22 @@ To publish a new version on [PyPI](https://pypi.org/project/sudoku-dlx-bitset/):
python -m build # creates dist/*.tar.gz and dist/*.whl
```

### 3. Publish the release

1. (Optional) Upload to TestPyPI first to validate the release:

```bash
python -m twine upload --repository testpypi dist/*
```

2. Upload to the main PyPI index once satisfied:
3. Upload the artifacts with [Twine](https://twine.readthedocs.io/):

```bash
python -m twine upload dist/*
```

3. Tag the release in Git and push the tag so GitHub releases stay in sync.
4. Tag the release in Git and push the tag so GitHub releases stay in sync.

The CI workflow already runs tests against multiple Python versions and uploads coverage
Expand Down
Loading