jupyterlab / extension-template

A `copier` template for JupyterLab extensions
Creative Commons Zero v1.0 Universal
55 stars 19 forks source link

twine reports "InvalidDistribution: Metadata is missing required fields: Name, Version." #68

Closed psychemedia closed 6 months ago

psychemedia commented 6 months ago

Using the template, a build seems to work fine, except for when I try to push to pypi with twine:

python -m build
twine upload dist/*

gives:

ERROR    InvalidDistribution: Metadata is missing required fields: Name, Version.                   
         Make sure the distribution includes the files where those fields are specified, and is     
         using a supported Metadata-Version: 1.0, 1.1, 1.2, 2.0, 2.1, 2.2.    

The package.json file has name and version both set.

welcome[bot] commented 6 months ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

krassowski commented 6 months ago

I do not see this problem. https://github.com/pypi/warehouse/issues/15611 suggests that this may happen when an outdated pkginfo is installed. Can you check it you have the latest version of it and twine?

psychemedia commented 6 months ago

pkginfo, twine and hatchling were all latest releases. Downgrading to hatchling==1.21.1 gives a build that twine seems to be happy with.

psychemedia commented 6 months ago

Ah... seems like pkginfo in was outdated in the env twine was calling from...