Move do not upload publish note out of the guide into concepts (#16789)

This feels a little out of place here and it seems nice to be able to
link to it.
This commit is contained in:
Zanie Blue 2025-11-20 12:33:15 -06:00 committed by GitHub
parent fd7e6d0a05
commit 75bd2ea0c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 16 deletions

View File

@ -57,3 +57,18 @@ that the downloaded `setuptools` distribution matches the specified hash:
```console
$ uv build --build-constraint constraints.txt --require-hashes
```
## Preventing publish to PyPI
If you have internal packages that you do not want to be published, you can mark them as private:
```toml
[project]
classifiers = ["Private :: Do Not Upload"]
```
This setting makes PyPI reject your uploaded package from publishing. It does not affect security or
privacy settings on alternative registries.
We also recommend only generating [per-project PyPI API tokens](https://pypi.org/help/#apitoken):
Without a PyPI token matching the project, it can't be accidentally published.

View File

@ -18,22 +18,6 @@ build it by default. This means that your project may not be ready for distribut
the effect of declaring a build system in the
[project concept](../concepts/projects/config.md#build-systems) documentation.
!!! note
If you have internal packages that you do not want to be published, you can mark them as
private:
```toml
[project]
classifiers = ["Private :: Do Not Upload"]
```
This setting makes PyPI reject your uploaded package from publishing. It does not affect
security or privacy settings on alternative registries.
We also recommend only generating [per-project PyPI API tokens](https://pypi.org/help/#apitoken):
Without a PyPI token matching the project, it can't be accidentally published.
## Building your package
Build your package with `uv build`: