Commit 7279a073 by johnthagen Committed by GitHub

Support `Private ::` trove classifiers (#7271)

parent 2d54ec97
......@@ -31,6 +31,10 @@ class CheckCommand(Command):
unrecognized = sorted(
project_classifiers - set(classifiers) - set(deprecated_classifiers)
)
# Allow "Private ::" classifiers as recommended on PyPI and the packaging guide
# to allow users to avoid accidentally publishing private packages to PyPI.
# https://pypi.org/classifiers/
unrecognized = [u for u in unrecognized if not u.startswith("Private ::")]
if unrecognized:
errors.append(f"Unrecognized classifiers: {unrecognized!r}.")
......
......@@ -59,3 +59,21 @@ Warning: Deprecated classifier\
"""
assert tester.io.fetch_error() == expected
def test_check_private(mocker: MockerFixture, tester: CommandTester):
mocker.patch(
"poetry.factory.Factory.locate",
return_value=Path(__file__).parent.parent.parent
/ "fixtures"
/ "private_pyproject"
/ "pyproject.toml",
)
tester.execute()
expected = """\
All set!
"""
assert tester.io.fetch_output() == expected
[tool.poetry]
name = "private"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"
classifiers = [
"Private :: Do Not Upload",
]
[tool.poetry.dependencies]
python = "^3.7"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment