capstone
capstone copied to clipboard
Py bindings: use pkg_resources to set package version
This was inspired by the fact we forgot to set the package version when Capstone 4.0.1 was released: https://github.com/aquynh/capstone/issues/1315#issuecomment-454386418
...now we won't need to set the Python bindings version manually :).
So this fails the build:
0.16s$ if [[ "$NOPYTEST" != "true" ]]; then cd bindings/python && make check; fi
Check test_basic.py ...
Traceback (most recent call last):
File "./test_basic.py", line 5, in <module>
from capstone import *
File "/home/travis/build/aquynh/capstone/bindings/python/capstone/__init__.py", line 131, in <module>
__version__ = pkg_resources.get_distribution("capstone").version
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 564, in get_distribution
dist = get_provider(dist)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 436, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 984, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 870, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'capstone' distribution was not found and is required by the application
FAILED
make: *** [check] Error 1
The command "if [[ "$NOPYTEST" != "true" ]]; then cd bindings/python && make check; fi" exited with 2.
as the tests doesn't install the package, but they should! ;)
will you continue to update this pull req?
@aquynh Updated. Lets see if it builds/passes now.
this is better, but still breaks on Mac
Thank you for the PR! I closed it because it is out of date. With the new auto-sync update for v6 we made many changes to some main architectures and will do also to others. This also changed the requirements we have now for new PRs.
If you still want to merge the changes, please rebase your fix onto the newest next branch and open a new PR.