bskinn / sphobjinv

Toolkit for manipulation and inspection of Sphinx objects.inv files
https://sphobjinv.readthedocs.io
MIT License
78 stars 9 forks source link

2.2: python 2.x syntax used in sphobjinv/_vendored/fuzzywuzzy/benchmarks.py #223

Closed kloczek closed 2 years ago

kloczek commented 2 years ago

Brief description Looks like 2.2 has some python 2.x code.

Generate pyc files fails on

+ /usr/bin/python3 -sBm compileall2 -f -j12 -o 0 -o 1 -o 2 -s /home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64 -p / /home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages /home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages'...
Can't list '/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages'
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages'...
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages/sphobjinv'...
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages/sphobjinv/_vendored'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages/sphobjinv/__init__.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages/sphobjinv/__main__.py'...
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages/sphobjinv/_vendored/fuzzywuzzy'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages/sphobjinv/_vendored/__init__.py'...
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages/sphobjinv/cli'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages/sphobjinv/_vendored/fuzzywuzzy/__init__.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-sphobjinv-2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages/sphobjinv/_vendored/fuzzywuzzy/benchmarks.py'...
***   File "/usr/lib/python3.8/site-packages/sphobjinv/_vendored/fuzzywuzzy/benchmarks.py", line 38
    print 'Test for string: "%s"' % s
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Test for string: "%s"' % s)?

Python 3.8.112.

bskinn commented 2 years ago

Yes, I hit that and just ignored it in my lint config. Probably best not to have broken code in the codebase, though.

Since it's benchmark code & probably not functional, I'll rip it out (along with any other pieces of that vendored copy of fuzzywuzzy that don't import cleanly) and release a 2.2.1 soon.

Thanks for the report!

kloczek commented 2 years ago

Thx 😄

bskinn commented 2 years ago

Would it be difficult for you to confirm that just deleting benchmarks.py fixes your build process? The rest of the vendored fuzzywuzzy imports fine for me under 3.x, so I think it's just the benchmarks file -- but I'd rather only cut one additional release to fix this, if I can, and it'd be good to confirm that it's just the one vendored file that's giving you trouble.

bskinn commented 2 years ago

Nvm, python -m compileall . after removing benchmarks.py finishes fine, so I think that solves it. 2.2.1 will be out shortly.

bskinn commented 2 years ago

Fixed in v2.2.1