Skip to content

Instantly share code, notes, and snippets.

@gh640
Last active August 14, 2022 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gh640/01dff3f3bcd20415fe5270938e795a5c to your computer and use it in GitHub Desktop.
Save gh640/01dff3f3bcd20415fe5270938e795a5c to your computer and use it in GitHub Desktop.
Poetry setting to make the project private (prevent accidental push)
[tool.poetry]
name = "mypackage"
version = "0.1.0"
description = ""
authors = []
classifiers = [
"Private :: Do not Upload"
]
@gh640
Copy link
Author

gh640 commented Mar 16, 2022

By adding Private :: Do not Upload to classifiers in [tool.poetry], you can prevent the project form being made public with a mistake.

classifiers = [
    "Private :: Do not Upload"
]

It appears this is the Python official way.

To prevent a package from being uploaded to PyPI, use the special "Private :: Do Not Upload" classifier. PyPI will always reject packages with classifiers beginning with "Private ::".

See also:

@gh640
Copy link
Author

gh640 commented Mar 16, 2022

The latest Poetry version when I made this gist is 1.1.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment