uranusjr / packaging-dists Goto Github PK
View Code? Open in Web Editor NEWParse distribution file names for project information
Home Page: https://pypi.org/project/packaging-dists
License: ISC License
Parse distribution file names for project information
Home Page: https://pypi.org/project/packaging-dists
License: ISC License
In pypa/packaging#407 the LegacyVersion
class was removed from packaging
, which means this module can no longer be used (without pinning packaging back).
This has the flow on effect of breaking simpleindex
, even though it shouldn't need to. Can we make the use of LegacyVersion
optional by delaying the import? (Or remove the dependency from simpleindex
is fine by me, too.)
It would be convenient to keep as an attribute the filename used to construct a Distribution with parse()
. This would be both Sdist and Wheel. Note that because of package canonicalization, this may not be something that may be recreated exactly from the parsed parts hence the need to keep it around.
Technically wheels can use non-PEP-440 versions if they use Corer Metadata 1.1 (the version restriction was only introduced in 1.2). So we should add a legacy
flag to allow that.
The lines below exclude the "+" character from a valid name - I'm unsure if there is a PEP actually specifying valid characters, however: the "+" is often in filenames especially for wheels built from git repos. There are also several packages on Pypi with a "+" in the filename. (see https://pypi.org/pypi/docky/json) for a random example.
packaging-dists/src/packaging_dists/__init__.py
Lines 28 to 30 in 726d132
When running Docker image built with python:3-alpine
, simpleindex run with error unknown encoding
.
change base image to python:3.8-alpine
solved the issue.
pypi-simpleindex-1 | Traceback (most recent call last):
pypi-simpleindex-1 | File "/usr/local/bin/simpleindex", line 5, in <module>
pypi-simpleindex-1 | from simpleindex.__main__ import main
pypi-simpleindex-1 | File "/usr/local/lib/python3.10/site-packages/simpleindex/__main__.py", line 11, in <module>
pypi-simpleindex-1 | from . import configs, routes
pypi-simpleindex-1 | File "/usr/local/lib/python3.10/site-packages/simpleindex/configs.py", line 12, in <module>
pypi-simpleindex-1 | from .routes import Route
pypi-simpleindex-1 | File "/usr/local/lib/python3.10/site-packages/simpleindex/routes.py", line 7, in <module>
pypi-simpleindex-1 | import packaging_dists
pypi-simpleindex-1 | File "/usr/local/lib/python3.10/site-packages/packaging_dists/__init__.py", line 0
pypi-simpleindex-1 | SyntaxError: unknown encoding: future_annotations
I would suggest to use name
rather than project
as Distribution attribute for the package name. This is the attribute used elsewhere as in the packaging
library and in pip.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.