Skip to content

Commit

Permalink
Remove vendored packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Jan 5, 2025
1 parent 95a8099 commit 1da4db3
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 1,232 deletions.
18 changes: 2 additions & 16 deletions flit_core/flit_core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
except ImportError:
import tomli as tomllib

try:
from .vendor.packaging import licenses
# Some downstream distributors remove the vendored packaging.
# When that is removed, import packaging from the regular location.
except ImportError:
from packaging import licenses

from .common import normalise_core_metadata_name
from .versionno import normalise_version

Expand Down Expand Up @@ -544,10 +537,7 @@ def read_pep621_metadata(proj, path) -> LoadedConfig:
_check_types(proj, 'license', (str, dict))
if isinstance(proj['license'], str):
license_expr = proj['license']
try:
license_expr = licenses.canonicalize_license_expression(license_expr)
except licenses.InvalidLicenseExpression as ex:
raise ConfigError(ex.args[0])
# TODO Validate and normalize license expression
md_dict['license_expression'] = license_expr
else:
license_tbl = proj['license']
Expand All @@ -567,11 +557,7 @@ def read_pep621_metadata(proj, path) -> LoadedConfig:
lc.referenced_files.append(license_tbl['file'])
elif 'text' in license_tbl:
license = license_tbl['text']
try:
# Normalize license if it's a valid SPDX expression
license = licenses.canonicalize_license_expression(license)
except licenses.InvalidLicenseExpression:
pass
# TODO Normalize license if it's a valid SPDX expression
md_dict['license'] = license
else:
raise ConfigError(
Expand Down
3 changes: 0 additions & 3 deletions flit_core/flit_core/vendor/packaging-24.2.dist-info/LICENSE

This file was deleted.

177 changes: 0 additions & 177 deletions flit_core/flit_core/vendor/packaging-24.2.dist-info/LICENSE.APACHE

This file was deleted.

23 changes: 0 additions & 23 deletions flit_core/flit_core/vendor/packaging-24.2.dist-info/LICENSE.BSD

This file was deleted.

102 changes: 0 additions & 102 deletions flit_core/flit_core/vendor/packaging-24.2.dist-info/METADATA

This file was deleted.

15 changes: 0 additions & 15 deletions flit_core/flit_core/vendor/packaging/__init__.py

This file was deleted.

Loading

0 comments on commit 1da4db3

Please sign in to comment.