-
Notifications
You must be signed in to change notification settings - Fork 308
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
twine should fail more gracefully when encountering a metadata version it doesn't support #341
Comments
Er, and to be clear, I've found 7f86514, so gonna try to see whether this works with that commit. |
Yes, it seems like you've built a Metadata 2.1 distribution, but are using an old version of |
@di which versions of |
Line 23 in fa55c0c
|
Also note that some package index implementations do not support receiving Metadata 2.1 packaged uploads - an example is the current version of Artifactory (see https://www.jfrog.com/jira/browse/RTFACT-16189 tracking the issue). In this case there is a response from the server but all the user gets as notification is the HTTP response code of 400, despite there being a useful server response revealing the issue. Current output...
The useful information that is discarded is... {
"errors" : [ {
"status" : 400,
"message" : "No enum constant org.jfrog.repomd.pypi.model.PypiMetadata.MetadataVersion.v2_1"
} ]
} I'm running a forked version which does a |
the |
It seems recent versions of Artifactory no longer choke on 2.1 metadata packaging (though a warning is still issued in the artifactory logs). That said, I can exactly reproduce this issue as described when using twine to upload to our Artifactory:
I CAN, however, upload the exact same package using curl without any issues. |
@ljohnston I hit the same thing. If you build your sdist / wheel using setuptools < 38.6.0 it should work fine. http://setuptools.readthedocs.io/en/latest/history.html#v38-6-0 |
@gatesn I'm experiencing the same issue. I tried downgrading to setuptools 38.5.2, rebuilding my sdist and wheels and for some reason I still see the same error. I verified I'm getting the exact same response from Aritfactory by pulling master on this repo and using the |
If you use —verbose you should see more than just the 400 error. What’s the reason that’s printed out? |
I'm seeing the exact same response that @goodtune mentioned above:
|
You will need to pin setuptools==35.5.2 and wheel==0.30.0 for the workaround until artifactory support 2.1. |
For me I only had to pin wheel==0.30.0 the latest setuptools (which is 40.0.0 at this moment) worked just fine. |
For those who needs to verify whether it is the same issue you need to patch utils.py in the method check_status_code with something similar like this
|
|
At the time of writing 35.5.2 is not available. In the proposed list i see 35.0.2 is working for me (together with wheels==0.30.0) |
This issue is not resolved yet? |
This worked for me: |
(It's hard to provide a full reproduce here, so if any of the below isn't clear enough, apologies, but it's a first shot:)
I'm uploading a package (a wheel specifically) generated in the "standard way" with new setuptools and using twine upload, but twine dies by simply saying:
Stepping through with a debugger, it looks like what's failing is that
metadata.name
isNone
inPackageFile.from_filename
, whichpkg_resources.safe_str
can't cope with (because it regexes it for some reason).(So that sounds like possibly one improvement, that
None
shouldn't make it all the way down there)The way it gets to be
None
seems to be thatDistribution.parse
calls_getHeaderAttrs
to look up a callback to use for extracting metadata for a particular setuptools version, but if the version isn't present, that function returns an empty list, and no metadata is parsed (soname
isNone
).Seems like another nice improvement would be failing loudly if the setuptools metadata version isn't supported.
The text was updated successfully, but these errors were encountered: