Skip to content
Merged
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
15 changes: 15 additions & 0 deletions docs/concepts/projects/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This got me thinking: apparently the Do Not Upload classifier actually isn't really specified anywhere (PyPUG mentions PyPI's behavior, but doesn't say anything about other indices). It's kind of unfortunate that we can't say that all indices should honor this, but oh well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding was that that's specifically for PyPI, so a uv publish doesn't accidentally land your internal code on PyPI, while an internal - private - index is fine.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(We had longer convos about this when introducing uv publish, the current options are all bad in their own way)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding was that that's specifically for PyPI, so a uv publish doesn't accidentally land your internal code on PyPI, while an internal - private - index is fine.

Could be -- in that case we might be a little too conservative on pyx 😅

https://docs.pyx.dev/publishing#private-classifiers


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.
16 changes: 0 additions & 16 deletions docs/guides/package.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
Loading