-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PEP 503 has not been implemented #634
Comments
Does that workaround works for you ? |
The buildout worked but the instance broke searching packages in a wrong format. def find_packages(self, requirement):
url_name = re.sub(r"[-_.]+", "-", requirement.unsafe_name).lower()
self.scan_url(self.index_url + url_name + '/')
if not self.package_pages.get(requirement.key):
# Fall back to safe version of the name
self.scan_url(self.index_url + requirement.project_name + '/')
if not self.package_pages.get(requirement.key):
# We couldn't find the target package, so search the index page too
self.not_found_in_index(requirement)
for url in list(self.package_pages.get(requirement.key, ())):
# scan each page that might be related to the desired package
self.scan_url(url) As I said the re.sub is taken directly from the pep. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found out that PEP 503 ( https://peps.python.org/pep-0503/ ) was not implemented, In particular the this section:
In my scenario I use zc.buildout with a gitlab pypi package repository as index.
In the documentation they claim to accept not-normalized forms of package names (as pypi does) but it in reality they do not: both from browser and from buildout, namspace-package works, namepsace.package dont.
I thought I could open a ticket to GITLAB for the pypi repo, but they MAY redirect unnormalized url, setuptools on the other hand, clients MUST request the normalized url.
It has already been asked various times both on setuptools and pkg_resources but with no solution in sight.
I did a minimal POC to implement the PEP but I really do not know if it could have other impacts.
My workaround would be to patch pkg_resources.safe_name removing the "." from the regex that defines allowed package name chars in order to get also the dots replaced with dashes.
Here it is the original method
Last line would be (dot removed from regexp after '9')
Given the fact that looks like the aforementioned issues will not be solved any time soon, maybe the method could be monkey-patched in zc.buildout as we do for process_url. If it's not the case I'm open to new ideas.
The text was updated successfully, but these errors were encountered: