Commit graph

136 commits

Author SHA1 Message Date
peace-maker
e00a210a3d Test Python bindings in CI (#2161) 2023-09-15 14:35:09 +08:00
Anton Kochkov
d3a0e7ff99 ci: use cibuildwheel for python wheels (#2099)
* ci: use cibuildwheel for python wheels

* fix several issues

* fix setup.py

* fix issue

* Compatible with python2

* fix str

* trigger ci

---------

Co-authored-by: kabeor <kabeor00@gmail.com>
2023-07-21 23:15:46 +08:00
Rot127
102a6bdc28 Bumb manylinux version to 2014 (x86) and 2_28 (x86_64) repectivly.
manylinux1 is EOL since 2 years. Just like Python 3.6
Fixes wheel build.
2023-07-19 11:13:25 -05:00
Peace-Maker
68c8943e32 Normalize rc4 version string
/usr/local/lib/python2.7/dist-packages/setuptools/dist.py:476: UserWarning: Normalizing '5.0.0.rc4' to '5.0.0rc4'
  normalized_version,
2023-06-28 18:31:41 +02:00
kabeor
4d423560df [bindings] Adapt python2 for setup.py 2023-06-18 19:38:22 +08:00
kabeor
fd6832ce4b [bindings] fix twine issue when publish 2023-06-18 18:48:07 +08:00
kabeor
2c5074af63 [bindings] fix twine issue when publish 2023-06-18 18:44:46 +08:00
John Ott
9f727d495f Remove outdated ctypes requirement
The library ctypes has shipped with the python standard library since
Python 2.5, however this was still added via the `requires` keyword in
setuptools.setup. This results in a spurious requirement being created
in the .whl METADATA file, causing warnings when packaged via tools like
pex:

```
$ python3 -m pex capstone -o capstone.pex
/Users/ott/.venv/lib/python3.9/site-packages/pex/dist_metadata.py:397: PEXWarning: Ignoring 1 `Requires` field in /Users/ott/.pex/installed_wheels/2a4c7a0d4c87aceed3134ae20997a764af1811fee8e151cf5da90e0462822893/capstone-4.0.2-py3-none-macosx_12_arm64.whl metadata:
1.) Requires: ctypes

You may have issues using the 'capstone' distribution as a result.
More information on this workaround can be found here:
  https://github.com/pantsbuild/pex/issues/1201#issuecomment-791715585
```

Since this requirement is outdated, it can just be removed.
2022-08-24 11:29:48 -07:00
kabeor
2b05b8ef94 replace missing option CMAKE_BUILD_SHARED for python setup.py 2022-02-28 00:01:09 +08:00
Duncan Ogilvie
f4d86a3034 Modernize CMake and switch to CMake 3.15 2022-02-25 20:39:30 +01:00
Nguyen Anh Quynh
4e13196da8 python: classifier Python3 for setup.py 2020-01-26 13:26:58 +08:00
Benno Fünfstück
08ca4fa4bb bindings/python: fix install error due to old libname (#1338) 2019-01-11 00:10:25 +08:00
Hugo
633050764d Add python_requires and update Trove classifiers (#1251) 2018-10-02 17:45:45 +08:00
Nguyen Anh Quynh
76c1c3c4e9 merge next to master 2018-07-20 12:36:50 +08:00
Audrey Dutcher
f32a63b03b Add option for inhibiting the core build while installing the python components. Add option for loading the core from a custom path. (#1089) 2018-02-20 21:12:46 +08:00
Audrey Dutcher
10c4aa807d Add option for inhibiting the core build while installing the python components. Add option for loading the core from a custom path. (#1089) 2018-02-20 21:11:19 +08:00
Nguyen Anh Quynh
e9394bba5c python: cleanup 2018-01-15 13:42:00 +08:00
tdube
e1aaa50a5b python: fix merge confliction of #1073 2018-01-15 13:34:13 +08:00
tdube
1a1077db01 Update setup.py (#1073)
Check to make sure static library file exists before trying to copy it. Current build options include option to not build a static lib.
2018-01-15 13:30:51 +08:00
Andrew Dutcher
425bf530f2 Add ability to copy prebuilt libraries from prebuilt directory during python build 2017-03-04 17:09:07 -08:00
Andrew Dutcher
6e95167865 Add ability to copy prebuilt libraries from prebuilt directory during python build 2017-03-05 06:08:36 +08:00
Nguyen Anh Quynh
617c64fbb5 Python: Automatically conform to PEP440 for version numbers. ported from Unicorn Python binding 2017-02-01 13:23:15 +08:00
Nguyen Anh Quynh
3925b332ce Python: Automatically conform to PEP440 for version numbers. ported from Unicorn Python binding 2017-02-01 13:11:21 +08:00
Nguyen Anh Quynh
f1aa0a3d04 python: version 4.0.0 2016-11-04 23:55:20 +08:00
Andrew Dutcher
2f1c3ce8a6 On this branch, dylib and so files are versioned 2016-10-31 10:54:58 -07:00
Andrew Dutcher
b2504b963e Python setup: Clean up some merge failures, adapt for changes on next branch 2016-10-26 23:15:42 -07:00
Andrew Dutcher
06b26efbf4 Python: remove special case for cygwin build 2016-10-25 21:49:58 -07:00
Andrew Dutcher
816f131d27 Python: Make cython work with extreme prejudice 2016-10-25 21:49:58 -07:00
Andrew Dutcher
1008716ee5 Python: Clean up the capstone-windows stuff with extreme prejudice 2016-10-25 21:48:41 -07:00
Andrew Dutcher
3b5b5ff58c Python: make setup work as expected 2016-10-25 21:48:18 -07:00
Nguyen Anh Quynh
3bd582ef64 python: bump version to 3.0.5 2016-10-26 10:52:53 +08:00
Andrew Dutcher
0532314562 Python: remove special case for cygwin build 2016-10-21 03:30:53 -07:00
Andrew Dutcher
ac5121c7e0 Python: Make cython work with extreme prejudice 2016-10-21 03:30:50 -07:00
Andrew Dutcher
ad36604b55 Python: Clean up the capstone-windows stuff with extreme prejudice 2016-10-21 03:30:44 -07:00
Andrew Dutcher
fdcd607c99 Python: make setup work as expected 2016-10-14 05:06:30 -07:00
Benno Fünfstück
b446327f3b python-bindings: fix setup.py for wheel installation
When the python bindings are installed using the new wheels
infrastructure, data_files are relative to the site-packages directory
even if using absolute paths.

The following example demonstrates the bug fixed by this commit: (ran on archlinux)

```bash
$ pip install wheel       # if this package is installed, wheel installation is made the default
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |################################| 71kB 124kB/s
Installing collected packages: wheel
Successfully installed wheel-0.29.0

$ pip install capstone    # this will use the wheel installation method now
Collecting capstone
  Using cached capstone-3.0.4.tar.gz
Building wheels for collected packages: capstone
  Running setup.py bdist_wheel for capstone ... done
  Stored in directory: /root/.cache/pip/wheels/7c/d1/d0/db6e2c5ef1063aabb9de2dd8b92b4c27ee6f9fd213240099b8
Successfully built capstone
Installing collected packages: capstone
Successfully installed capstone-3.0.4

$ find /usr/lib/ -name "libcapstone.so"
/usr/lib/python3.5/site-packages/usr/lib/python3.5/site-packages/capstone/libcapstone.so
```

So the path `SITE_PACKAGES` in the `data_files` specification of the
setup.py file was interpreted relative to the python site-packages
directory. The fix for this is simple: use `/capstone` instead of an
absolute path for `SITE_PACKAGES`.
2016-10-03 10:50:08 +08:00
Benno Fünfstück
df96d9ee6d python-bindings: fix setup.py for wheel installation
When the python bindings are installed using the new wheels
infrastructure, data_files are relative to the site-packages directory
even if using absolute paths.

The following example demonstrates the bug fixed by this commit: (ran on archlinux)

```bash
$ pip install wheel       # if this package is installed, wheel installation is made the default
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |################################| 71kB 124kB/s
Installing collected packages: wheel
Successfully installed wheel-0.29.0

$ pip install capstone    # this will use the wheel installation method now
Collecting capstone
  Using cached capstone-3.0.4.tar.gz
Building wheels for collected packages: capstone
  Running setup.py bdist_wheel for capstone ... done
  Stored in directory: /root/.cache/pip/wheels/7c/d1/d0/db6e2c5ef1063aabb9de2dd8b92b4c27ee6f9fd213240099b8
Successfully built capstone
Installing collected packages: capstone
Successfully installed capstone-3.0.4

$ find /usr/lib/ -name "libcapstone.so"
/usr/lib/python3.5/site-packages/usr/lib/python3.5/site-packages/capstone/libcapstone.so
```

So the path `SITE_PACKAGES` in the `data_files` specification of the
setup.py file was interpreted relative to the python site-packages
directory. The fix for this is simple: use `/capstone` instead of an
absolute path for `SITE_PACKAGES`.
2016-10-02 15:25:13 +02:00
Michael Cohen
40a42b4939 Fix setup.py to use setuptools and put the libcapstone.so in the right place. 2016-02-15 02:34:32 +01:00
Michael Cohen
29ee560688 Support all OSs. 2016-02-11 23:43:22 +01:00
Michael Cohen
ff5b295b88 Fix setup.py. 2016-02-11 15:24:17 +01:00
Nguyen Anh Quynh
cc7434c57e python: do not copy msvc/headers directory in setup.py 2015-07-15 17:38:12 +08:00
Nguyen Anh Quynh
932381aacc python: do not copy msvc/headers directory in setup.py 2015-07-15 15:44:42 +08:00
Nguyen Anh Quynh
1a7a13e4da Merge branch 'master' into v3 2015-06-22 16:50:35 +08:00
Alex Chernetz
5799c485a6 [Python binding] Fix setup.py to allow installing in a virtualenv
In a virtualenv:
- site.getusersitepackages() won't import
- get_python_lib() will return the directory inside the virtualenv
- the "--user" option can therefore be safely ignored.
2015-06-19 23:22:36 -07:00
Alex Chernetz
38094b1098 [Python binding] Fix setup.py to allow installing in a virtualenv
In a virtualenv:
- site.getusersitepackages() won't import
- get_python_lib() will return the directory inside the virtualenv
- the "--user" option can therefore be safely ignored.
2015-06-19 23:18:52 -07:00
Nguyen Anh Quynh
ebc370ff40 bump version to 3.0.4 2015-06-08 22:29:55 +08:00
neuromancer
a210229a0f Allow local installations of the python bindings
These changes will allow a pypi user to locally install capstone using the --user flag. If it possible, please update the correspondent package (https://pypi.python.org/pypi/capstone/3.0.3)
2015-06-04 21:46:09 +08:00
neuromancer
911d0506cd Allow local installations of the python bindings
These changes will allow a pypi user to locally install capstone using the --user flag. If it possible, please update the correspondent package (https://pypi.python.org/pypi/capstone/3.0.3)
2015-06-02 14:31:36 +02:00
Nguyen Anh Quynh
b89c95fc99 python: bump package version to 3.0.3 (setup.py) 2015-05-08 17:06:59 +08:00
Nguyen Anh Quynh
c343a917fb python: revert to use distutils rather than setuptools 2015-04-07 16:03:01 +08:00