Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
marfrh committed Nov 12, 2023
1 parent a4ab822 commit d36a8bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions py2pack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

SPDX_LICENSES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'spdx_license_map.json')
with open(SPDX_LICENSES_FILE, 'r') as fp:
SDPX_LICENSES = json.load(fp)
SPDX_LICENSES = json.load(fp)


def pypi_json(project, release=None):
Expand Down Expand Up @@ -216,7 +216,7 @@ def _augment_data_from_tarball(args, filename, data):
license_re = re.compile(r"{0}-{1}\/((?:COPYING|LICENSE).*)".format(args.name, args.version), re.IGNORECASE)

data_pyproject = parse_pyproject(filename)
if data_pyproject is not None and "license" in data and data["license"] in SDPX_LICENSES:
if data_pyproject is not None and "license" in data and data["license"] in SPDX_LICENSES:
# Trust the PyPI Metadata and don't try to update with a possible non SPDX identifier
data_pyproject.pop("license", None)
data.update(data_pyproject)
Expand Down Expand Up @@ -265,14 +265,14 @@ def _license_from_classifiers(data):


def _normalize_license(data):
"""try to get SDPX license"""
"""try to get SPDX license"""
license = data.get('license', None)
if not license:
# try to get license from classifiers
license = _license_from_classifiers(data)
if license:
if license in SDPX_LICENSES.keys():
data['license'] = SDPX_LICENSES[license]
if license in SPDX_LICENSES.keys():
data['license'] = SPDX_LICENSES[license]
else:
data['license'] = "%s (FIXME:No SPDX)" % (license)
else:
Expand Down
2 changes: 1 addition & 1 deletion tools/update-spdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


def update_spdx():
"""Update SDPX license map."""
"""Update SPDX license map."""
response = requests.get('https://docs.google.com/spreadsheet/pub?key=0AqPp4y2wyQsbdGQ1V3pRRDg5NEpGVWpubzdRZ0tjUWc')
html = lxml.html.fromstring(response.text)
licenses = {}
Expand Down

0 comments on commit d36a8bc

Please sign in to comment.