bskinn/sphobjinv

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

Closed this issue · 5 comments

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.

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!

Thx 😄

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.

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

Fixed in v2.2.1