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

Trove classifiers prefixed with "Private ::" fail poetry check #7167

Closed
2 tasks done
sethfischer opened this issue Dec 10, 2022 · 2 comments · Fixed by #7271
Closed
2 tasks done

Trove classifiers prefixed with "Private ::" fail poetry check #7167

sethfischer opened this issue Dec 10, 2022 · 2 comments · Fixed by #7271
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged

Comments

@sethfischer
Copy link

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

Feature Request

pypi.org recommends:

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 ::".

The same recommendation is also published on packaging.python.org.

When validating a pyproject.toml file with the following, poetry check will fail.

classifiers = [
    "Private :: Do not Upload",  # Prevent uploading to PyPI
]

Error message:

Error: Unrecognized classifiers: ['Private :: Do not Upload'].

This is correct behaviour for projects that are intended to be uploaded to PyPI.

However, there are projects that are not intended to be uploaded to PyPI and follow the above recommendation. How should those projects validate their pyproject.toml?

Suggestions

  1. Would it be reasonable to add an option such as --allow-private-classifiers to poetry check? This option could allow classifiers with the prefix "Private ::".
  2. See Implement private projects #1537 which discusses a number of alternatives to "Private :: Do not Upload". Possibly one of these alternatives could be used as a flag which, if present, adds the "Private :: Do not Upload" classifier to the built package.
@sethfischer sethfischer added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Dec 10, 2022
@johnthagen
Copy link
Contributor

johnthagen commented Dec 20, 2022

This is implemented here:

The current valid trove classifier list is taken from a PyPA third party library:

Would it be reasonable to add an option such as --allow-private-classifiers to poetry check?

Given that this is the prescribed classifier to use, I don't think any special flag should be needed to allow this.

Should probably filter out any unrecognized here that start with Private ::

I also think that a better long term solution is to have a dedicated Poetry private = true setting as described in

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants