auditwheel icon indicating copy to clipboard operation
auditwheel copied to clipboard

Auditwheel should warn on invalid versions, e.g. `dev`

Open safijari opened this issue 5 years ago • 6 comments

dev was just a special case, from what I can tell if the x.y.z kind of string isn't present I'll get:

> auditwheel repair pyapriltags_eth-dev-cp27-cp27mu-linux_x86_64.whl

.
.
.

Grafting: /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25 -> .libsapriltags_eth/libstdc++-637c843a.so.6.0.25
Grafting: /lib/x86_64-linux-gnu/libm-2.27.so -> .libsapriltags_eth/libm-2-24310d2a.27.so
Setting RPATH: apriltags_eth.so to "$ORIGIN/.libsapriltags_eth"
Traceback (most recent call last):
  File "/home/jari/.local/share/virtualenvs/auditwheel_pipenv-zl3561H8/bin/auditwheel", line 11, in <module>
    sys.exit(main())
  File "/home/jari/.local/share/virtualenvs/auditwheel_pipenv-zl3561H8/lib/python3.6/site-packages/auditwheel/main.py", line 49, in main
    rval = args.func(args, p)
  File "/home/jari/.local/share/virtualenvs/auditwheel_pipenv-zl3561H8/lib/python3.6/site-packages/auditwheel/main_repair.py", line 81, in execute
    update_tags=args.UPDATE_TAGS)
  File "/home/jari/.local/share/virtualenvs/auditwheel_pipenv-zl3561H8/lib/python3.6/site-packages/auditwheel/repair.py", line 98, in repair_wheel
    get_replace_platforms(abi))
  File "/home/jari/.local/share/virtualenvs/auditwheel_pipenv-zl3561H8/lib/python3.6/site-packages/auditwheel/wheeltools.py", line 202, in add_platforms
    fparts = parsed_fname.groupdict()
AttributeError: 'NoneType' object has no attribute 'groupdict'

Is this known? Intended? I can get still get away by doing something like 0.0.1-dev but still.

safijari avatar Oct 18 '18 07:10 safijari

I bet this is an incompatibility with the latest version of wheel. Try install wheel 0.31.1. Does that work?

matthew-brett avatar Oct 18 '18 09:10 matthew-brett

Nah. I'm already pinned at 0.31.1. Nothing works with latest version.

On Thu, Oct 18, 2018, 2:29 AM Matthew Brett [email protected] wrote:

I bet this is an incompatibility with the latest version of wheel. Try install wheel 0.31.1. Does that work?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pypa/auditwheel/issues/108#issuecomment-430940705, or mute the thread https://github.com/notifications/unsubscribe-auth/AE84pHShJ7IHuyfquj9Yf39G0lDMLx4Jks5umEoAgaJpZM4Xs0dO .

safijari avatar Oct 18 '18 12:10 safijari

Ah - sorry. Yes, I think what is happening is that auditwheel is using wheel code to determine the parts of the file name, according to this spec:

https://www.python.org/dev/peps/pep-0427/#file-name-convention

It's doing this so it can work out which bit is the platform tag, to replace it with manylinux1. If your filename does not conform to that spec, then it's going to fail, in the way you've seen, because the regular expression doesn't match.

matthew-brett avatar Oct 18 '18 12:10 matthew-brett

I see, it doesn't seem to specify a particular format for version but I can understand the constraint. Do you think it would be valuable to catch this case and throw a more intelligible error at the user?

On Thu, Oct 18, 2018, 5:52 AM Matthew Brett [email protected] wrote:

Ah - sorry. Yes, I think what is happening is that auditwheel is using wheel code to determine the parts of the file name, according to this spec:

https://www.python.org/dev/peps/pep-0427/#file-name-convention

It's doing this so it can work out which bit is the platform tag, to replace it with manylinux1. If your filename does not conform to that spec, then it's going to fail, in the way you've seen, because the regular expression doesn't match.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pypa/auditwheel/issues/108#issuecomment-430996617, or mute the thread https://github.com/notifications/unsubscribe-auth/AE84pJwCnvhywCKOaphyisjRkj3YgkREks5umHmegaJpZM4Xs0dO .

safijari avatar Oct 18 '18 13:10 safijari

Yes, a better error would be good. Would you consider doing a PR to put one in? I guess it's just a check for None, in parsed_fname, maybe in the add_platforms routine.

matthew-brett avatar Oct 18 '18 15:10 matthew-brett

Btw version numbers are supposed to follow the format given in PEP 440: https://www.python.org/dev/peps/pep-0440/

njsmith avatar Oct 18 '18 18:10 njsmith