gorilla-co / s3pypi

CLI tool for creating a Python Package Repository in an S3 bucket.
https://novemberfive.co/blog/opensource-pypi-package-repository-tutorial/
MIT License
324 stars 85 forks source link

Extra METADATA file in wheel causes wrong distribution name chosen #129

Closed ethanhs-nv closed 2 months ago

ethanhs-nv commented 2 months ago

The current logic for selecting wheel distribution names breaks if there are multiple METADATA files in a distribution (e.g. you vendor a package and wish to keep the metadata).

Would you consider taking packaging as a dependency to correctly extract the distribution names from wheels and sdists? The package provides useful utilities which correctly extract a distribution name from a wheel file name (and same for sdists).

Alternatively code to extract just the version and name from the wheel/sdist filename should be straightforward.

I'm happy to contribute a PR with either of these solutions.

mdwint commented 2 months ago

Sure, adding packaging sounds good.

What do the filenames look like that currently fail parsing? Do you have an example?

ethanhs-nv commented 2 months ago

I realized that this is actually correctly handled in s3pypi 2.0, I initially thought it affected all versions because I didn't see anything in the changelogs. Sorry for the noise!