Skip to content

Bug: License-Expression not found in local packages #121

Description

@Archieb13

Issue Details

LocalPackageInfo doesn't find licenses defined with License-Expression.

Description

I noticed this when checking a package playwright where no license was found. On inspection it would appear that the wrong string is used when searching for License-Expression (License_Expression is used). It should be a hyphen as per PEP-639.

Why did i notice it? It appears playwright has an issue in the json metadata on the latest version and the license cannot be found on remote either (which is the fallback) - https://pypi.org/pypi/playwright/1.52.0/json

	def get_license(self) -> str | None:
		return (
			meta_get(self.meta, "License_Expression")
			or from_classifiers(self.meta.get_all("Classifier"))
			or meta_get(self.meta, "License")
		)

Expected Behavior

License-Expression should be found in metadata

Actual Behavior

No License found (this happens for all PEP-639 packages except it is normally silent due to the remote fallback

System Information

environment:Python 3.10.12

  • Operating System (OS): Ubuntu
  • OS Version: 22.04

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions