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

Add a project setting to control if and where a project can be published #3692

Open
2 tasks done
J-M0 opened this issue Feb 13, 2021 · 6 comments
Open
2 tasks done

Add a project setting to control if and where a project can be published #3692

J-M0 opened this issue Feb 13, 2021 · 6 comments
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged

Comments

@J-M0
Copy link

J-M0 commented Feb 13, 2021

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

I would like to propose that poetry have a project-level configuration option that would let you restrict which repositories a package gets published to or even prevent it from being published at all.

Rust's package manager cargo has a field in its Cargo.toml file that does just that. I think the behavior described here is exactly what poetry should adopt.

https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field

I work on both public and private projects and this would be a nice addition for my peace of mind. I could make sure a private package doesn't accidentally get published to PyPI or even just prevent a package that is early in development from being published prematurely. It would also make publishing to private repositories easier as you would not need to specify the private repository with poetry publish -r.

@J-M0 J-M0 added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Feb 13, 2021
@NickleDave
Copy link

The way to do this is to include it in the "classifiers" section

[tool.poetry]
# ...
classifiers = [
    "Topic :: Software Development :: Build Tools",
    "Topic :: Software Development :: Libraries :: Python Modules"
]

You want to add

        "Private :: Do not Upload"

for your private projects

@NickleDave
Copy link

AFAIK this is the "official Pythonic" way, see
pypa/packaging.python.org#643

@J-M0
Copy link
Author

J-M0 commented Jun 5, 2021

That's a good trick to know, thank you. I still think being able to specify a default repository to publish to would be useful and that enforcing not uploading a package would be better served at the tool level rather than having PyPI reject a package after upload.

@gh640
Copy link

gh640 commented Sep 4, 2021

This might be same as #1537 .

@skewty
Copy link

skewty commented Apr 11, 2022

Is this supported now? Its been over a year with no comments / updates.

@imochoa
Copy link

imochoa commented Aug 29, 2022

Is this supported now? Its been over a year with no comments / updates.

I think this doesn't actually depend on poetry. It's specified by PyPI already:
https://pypi.org/classifiers/

So it should work, I guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

5 participants