diff --git a/src/packagedcode/pypi.py b/src/packagedcode/pypi.py index 271e98a69e..c074106a6a 100644 --- a/src/packagedcode/pypi.py +++ b/src/packagedcode/pypi.py @@ -517,6 +517,10 @@ def parse(cls, location, package_only=False): if license_file: extra_data['license_file'] = license_file + classifiers = project_data.get('classifiers', []) + is_private = any('Private ::' in classifier for classifier in classifiers) + extra_data['is_private'] = is_private + dependencies = [] parsed_dependencies = get_requires_dependencies( requires=project_data.get("dependencies", []), diff --git a/tests/packagedcode/test_pypi.py b/tests/packagedcode/test_pypi.py index 37bd204327..7d94032c6c 100644 --- a/tests/packagedcode/test_pypi.py +++ b/tests/packagedcode/test_pypi.py @@ -339,6 +339,12 @@ def test_parse_pyproject_toml_standard_lc0(self): expected_loc = self.get_test_loc('pypi/pyproject-toml/standard/lc0-pyproject.toml-expected.json') self.check_packages_data(package, expected_loc, regen=REGEN_TEST_FIXTURES) + def test_parse_pyproject_toml_private_package(self): + test_file = self.get_test_loc('pypi/pyproject-toml/private/private_package/pyproject.toml') + package = pypi.PyprojectTomlHandler.parse(test_file) + expected_loc = self.get_test_loc('pypi/pyproject-toml/private/private_package-pyproject.toml-expected.json') + self.check_packages_data(package, expected_loc, regen=REGEN_TEST_FIXTURES) + class TestPoetryHandler(PackageTester):