setuptools-rust 1.5.1__tar.gz → 1.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- setuptools-rust-1.6.0/.bumpversion.cfg +9 -0
- setuptools-rust-1.6.0/.gitattributes +1 -0
- setuptools-rust-1.6.0/.github/dependabot.yml +22 -0
- setuptools-rust-1.6.0/.github/workflows/ci.yml +440 -0
- setuptools-rust-1.6.0/.github/workflows/python-publish.yml +37 -0
- setuptools-rust-1.6.0/.gitignore +12 -0
- setuptools-rust-1.6.0/.readthedocs.yaml +7 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/CHANGELOG.md +13 -0
- {setuptools-rust-1.5.1/setuptools_rust.egg-info → setuptools-rust-1.6.0}/PKG-INFO +2 -2
- setuptools-rust-1.6.0/docs/Makefile +20 -0
- setuptools-rust-1.6.0/docs/README.md +2 -0
- setuptools-rust-1.6.0/docs/building_wheels.md +59 -0
- setuptools-rust-1.6.0/docs/conf.py +89 -0
- setuptools-rust-1.6.0/docs/index.md +12 -0
- setuptools-rust-1.6.0/docs/make.bat +35 -0
- setuptools-rust-1.6.0/docs/reference.rst +9 -0
- setuptools-rust-1.6.0/docs/requirements.txt +4 -0
- setuptools-rust-1.6.0/emscripten/.gitignore +6 -0
- setuptools-rust-1.6.0/emscripten/_sysconfigdata__emscripten_wasm32-emscripten.py +16 -0
- setuptools-rust-1.6.0/emscripten/emcc_wrapper.py +23 -0
- setuptools-rust-1.6.0/emscripten/pyo3_config.ini +7 -0
- setuptools-rust-1.6.0/emscripten/runner.js +107 -0
- setuptools-rust-1.6.0/examples/hello-world/Cargo.lock +7 -0
- setuptools-rust-1.6.0/examples/hello-world/Cargo.toml +12 -0
- setuptools-rust-1.6.0/examples/hello-world/MANIFEST.in +2 -0
- setuptools-rust-1.6.0/examples/hello-world/hello_world/__init__.py +0 -0
- setuptools-rust-1.6.0/examples/hello-world/noxfile.py +21 -0
- setuptools-rust-1.6.0/examples/hello-world/pyproject.toml +2 -0
- setuptools-rust-1.6.0/examples/hello-world/pytest.ini +0 -0
- setuptools-rust-1.6.0/examples/hello-world/setup.py +16 -0
- setuptools-rust-1.6.0/examples/hello-world/src/main.rs +3 -0
- setuptools-rust-1.6.0/examples/hello-world-script/Cargo.lock +7 -0
- setuptools-rust-1.6.0/examples/hello-world-script/Cargo.toml +12 -0
- setuptools-rust-1.6.0/examples/hello-world-script/MANIFEST.in +2 -0
- setuptools-rust-1.6.0/examples/hello-world-script/hello_world/__init__.py +0 -0
- setuptools-rust-1.6.0/examples/hello-world-script/noxfile.py +21 -0
- setuptools-rust-1.6.0/examples/hello-world-script/pyproject.toml +2 -0
- setuptools-rust-1.6.0/examples/hello-world-script/pytest.ini +0 -0
- setuptools-rust-1.6.0/examples/hello-world-script/setup.py +18 -0
- setuptools-rust-1.6.0/examples/hello-world-script/src/main.rs +3 -0
- setuptools-rust-1.6.0/examples/html-py-ever/.github/workflows/upload.yml +30 -0
- setuptools-rust-1.6.0/examples/html-py-ever/Cargo.lock +685 -0
- setuptools-rust-1.6.0/examples/html-py-ever/Cargo.toml +14 -0
- setuptools-rust-1.6.0/examples/html-py-ever/MANIFEST.in +2 -0
- setuptools-rust-1.6.0/examples/html-py-ever/README.md +103 -0
- setuptools-rust-1.6.0/examples/html-py-ever/build-wheels.sh +22 -0
- setuptools-rust-1.6.0/examples/html-py-ever/html_py_ever/__init__.py +1 -0
- setuptools-rust-1.6.0/examples/html-py-ever/noxfile.py +21 -0
- setuptools-rust-1.6.0/examples/html-py-ever/pyproject.toml +2 -0
- setuptools-rust-1.6.0/examples/html-py-ever/pytest.ini +0 -0
- setuptools-rust-1.6.0/examples/html-py-ever/requirements.txt +3 -0
- setuptools-rust-1.6.0/examples/html-py-ever/setup.cfg +26 -0
- setuptools-rust-1.6.0/examples/html-py-ever/setup.py +10 -0
- setuptools-rust-1.6.0/examples/html-py-ever/src/lib.rs +58 -0
- setuptools-rust-1.6.0/examples/html-py-ever/src/main.rs +27 -0
- setuptools-rust-1.6.0/examples/html-py-ever/tests/conftest.py +11 -0
- setuptools-rust-1.6.0/examples/html-py-ever/tests/empty.html +0 -0
- setuptools-rust-1.6.0/examples/html-py-ever/tests/monty-python.html +1145 -0
- setuptools-rust-1.6.0/examples/html-py-ever/tests/python.html +14716 -0
- setuptools-rust-1.6.0/examples/html-py-ever/tests/run_all.py +62 -0
- setuptools-rust-1.6.0/examples/html-py-ever/tests/rust.html +9098 -0
- setuptools-rust-1.6.0/examples/html-py-ever/tests/small.html +10 -0
- setuptools-rust-1.6.0/examples/html-py-ever/tests/test_parsing.py +32 -0
- setuptools-rust-1.6.0/examples/html-py-ever/tests/test_selector.py +23 -0
- setuptools-rust-1.6.0/examples/namespace_package/.cargo/config.toml +11 -0
- setuptools-rust-1.6.0/examples/namespace_package/Cargo.lock +251 -0
- setuptools-rust-1.6.0/examples/namespace_package/Cargo.toml +10 -0
- setuptools-rust-1.6.0/examples/namespace_package/Cross.toml +7 -0
- setuptools-rust-1.6.0/examples/namespace_package/Dockerfile +10 -0
- setuptools-rust-1.6.0/examples/namespace_package/MANIFEST.in +2 -0
- setuptools-rust-1.6.0/examples/namespace_package/namespace_package/python/__init__.py +2 -0
- setuptools-rust-1.6.0/examples/namespace_package/noxfile.py +21 -0
- setuptools-rust-1.6.0/examples/namespace_package/pyproject.toml +2 -0
- setuptools-rust-1.6.0/examples/namespace_package/pytest.ini +0 -0
- setuptools-rust-1.6.0/examples/namespace_package/setup.py +18 -0
- setuptools-rust-1.6.0/examples/namespace_package/src/lib.rs +15 -0
- setuptools-rust-1.6.0/examples/namespace_package/tests/test_namespace_package.py +9 -0
- setuptools-rust-1.6.0/examples/rust_with_cffi/Cargo.lock +251 -0
- setuptools-rust-1.6.0/examples/rust_with_cffi/Cargo.toml +12 -0
- setuptools-rust-1.6.0/examples/rust_with_cffi/MANIFEST.in +3 -0
- setuptools-rust-1.6.0/examples/rust_with_cffi/cffi_module.py +17 -0
- setuptools-rust-1.6.0/examples/rust_with_cffi/noxfile.py +21 -0
- setuptools-rust-1.6.0/examples/rust_with_cffi/pyproject.toml +2 -0
- setuptools-rust-1.6.0/examples/rust_with_cffi/pytest.ini +0 -0
- setuptools-rust-1.6.0/examples/rust_with_cffi/rust_with_cffi/__init__.py +0 -0
- setuptools-rust-1.6.0/examples/rust_with_cffi/setup.py +26 -0
- setuptools-rust-1.6.0/examples/rust_with_cffi/src/lib.rs +14 -0
- setuptools-rust-1.6.0/examples/rust_with_cffi/tests/test_rust_with_cffi.py +10 -0
- setuptools-rust-1.6.0/mypy.ini +19 -0
- setuptools-rust-1.6.0/noxfile.py +121 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setup.cfg +6 -3
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust/build.py +58 -20
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust/command.py +1 -2
- setuptools-rust-1.6.0/setuptools_rust/py.typed +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust/setuptools_ext.py +2 -4
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust/version.py +1 -1
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0/setuptools_rust.egg-info}/PKG-INFO +2 -2
- setuptools-rust-1.6.0/setuptools_rust.egg-info/SOURCES.txt +114 -0
- setuptools-rust-1.6.0/tests/test_build.py +24 -0
- setuptools-rust-1.6.0/tests/test_extension.py +59 -0
- setuptools-rust-1.5.1/setuptools_rust.egg-info/SOURCES.txt +0 -23
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/LICENSE +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/MANIFEST.in +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/README.md +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/pyproject.toml +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setup.py +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust/__init__.py +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust/_utils.py +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust/clean.py +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust/extension.py +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust/rustc_info.py +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust.egg-info/dependency_links.txt +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust.egg-info/entry_points.txt +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust.egg-info/requires.txt +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust.egg-info/top_level.txt +0 -0
- {setuptools-rust-1.5.1 → setuptools-rust-1.6.0}/setuptools_rust.egg-info/zip-safe +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
html-py-ever/test/*.html linguist-vendored=true
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
|
|
4
|
+
- package-ecosystem: "cargo"
|
|
5
|
+
directory: "examples/hello-world"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: "monthly"
|
|
8
|
+
|
|
9
|
+
- package-ecosystem: "cargo"
|
|
10
|
+
directory: "examples/html-py-ever"
|
|
11
|
+
schedule:
|
|
12
|
+
interval: "monthly"
|
|
13
|
+
|
|
14
|
+
- package-ecosystem: "cargo"
|
|
15
|
+
directory: "examples/namespace_package"
|
|
16
|
+
schedule:
|
|
17
|
+
interval: "monthly"
|
|
18
|
+
|
|
19
|
+
- package-ecosystem: "cargo"
|
|
20
|
+
directory: "examples/rust_with_cffi"
|
|
21
|
+
schedule:
|
|
22
|
+
interval: "monthly"
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
fmt:
|
|
14
|
+
runs-on: "ubuntu-latest"
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v3
|
|
17
|
+
|
|
18
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
19
|
+
uses: actions/setup-python@v4
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.x"
|
|
22
|
+
|
|
23
|
+
- run: pip install black
|
|
24
|
+
|
|
25
|
+
- run: black --check .
|
|
26
|
+
|
|
27
|
+
mypy:
|
|
28
|
+
runs-on: "ubuntu-latest"
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v3
|
|
31
|
+
|
|
32
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
33
|
+
uses: actions/setup-python@v4
|
|
34
|
+
with:
|
|
35
|
+
python-version: "3.x"
|
|
36
|
+
|
|
37
|
+
- run: pip install nox
|
|
38
|
+
|
|
39
|
+
- run: nox -s mypy
|
|
40
|
+
|
|
41
|
+
pytest:
|
|
42
|
+
runs-on: "ubuntu-latest"
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v3
|
|
45
|
+
|
|
46
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
47
|
+
uses: actions/setup-python@v4
|
|
48
|
+
with:
|
|
49
|
+
python-version: "3.x"
|
|
50
|
+
|
|
51
|
+
- name: Install Rust toolchain
|
|
52
|
+
uses: dtolnay/rust-toolchain@stable
|
|
53
|
+
|
|
54
|
+
- run: pip install nox
|
|
55
|
+
|
|
56
|
+
- run: nox -s test
|
|
57
|
+
|
|
58
|
+
build:
|
|
59
|
+
name: ${{ matrix.python-version }} ${{ matrix.platform.os }}-${{ matrix.platform.python-architecture }}
|
|
60
|
+
runs-on: ${{ matrix.platform.os }}
|
|
61
|
+
strategy:
|
|
62
|
+
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
|
|
63
|
+
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
|
|
64
|
+
matrix:
|
|
65
|
+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev", pypy-3.7, pypy-3.8, pypy-3.9]
|
|
66
|
+
platform: [
|
|
67
|
+
{ os: "macos-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
|
|
68
|
+
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
|
|
69
|
+
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
|
|
70
|
+
{ os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" },
|
|
71
|
+
]
|
|
72
|
+
exclude:
|
|
73
|
+
# No 32-bit pypy 3.7 on Windows
|
|
74
|
+
- python-version: pypy-3.7
|
|
75
|
+
platform: { os: "windows-latest", python-architecture: "x86" }
|
|
76
|
+
# No 32-bit pypy 3.8 on Windows
|
|
77
|
+
- python-version: pypy-3.8
|
|
78
|
+
platform: { os: "windows-latest", python-architecture: "x86" }
|
|
79
|
+
# No 32-bit pypy 3.9 on Windows
|
|
80
|
+
- python-version: pypy-3.9
|
|
81
|
+
platform: { os: "windows-latest", python-architecture: "x86" }
|
|
82
|
+
|
|
83
|
+
steps:
|
|
84
|
+
- uses: actions/checkout@v3
|
|
85
|
+
|
|
86
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
87
|
+
uses: actions/setup-python@v4
|
|
88
|
+
with:
|
|
89
|
+
python-version: ${{ matrix.python-version }}
|
|
90
|
+
architecture: ${{ matrix.platform.python-architecture }}
|
|
91
|
+
|
|
92
|
+
- name: Install Rust toolchain
|
|
93
|
+
uses: dtolnay/rust-toolchain@stable
|
|
94
|
+
with:
|
|
95
|
+
targets: ${{ matrix.platform.rust-target }}
|
|
96
|
+
|
|
97
|
+
- name: Install Rust aarch64-apple-darwin target
|
|
98
|
+
if: matrix.platform.os == 'macos-latest'
|
|
99
|
+
run: rustup target add aarch64-apple-darwin
|
|
100
|
+
|
|
101
|
+
- name: Install test dependencies
|
|
102
|
+
run: pip install --upgrade nox
|
|
103
|
+
|
|
104
|
+
- name: Build package
|
|
105
|
+
run: pip install -e .
|
|
106
|
+
|
|
107
|
+
- name: Test examples
|
|
108
|
+
shell: bash
|
|
109
|
+
env:
|
|
110
|
+
PYTHON: ${{ matrix.python-version }}
|
|
111
|
+
run: nox -s test-examples
|
|
112
|
+
|
|
113
|
+
- name: Test macOS universal2
|
|
114
|
+
if: matrix.platform.os == 'macos-latest' && !startsWith(matrix.python-version, 'pypy')
|
|
115
|
+
shell: bash
|
|
116
|
+
env:
|
|
117
|
+
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
|
|
118
|
+
MACOSX_DEPLOYMENT_TARGET: '10.9'
|
|
119
|
+
ARCHFLAGS: -arch x86_64 -arch arm64
|
|
120
|
+
PYO3_CROSS_LIB_DIR: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib
|
|
121
|
+
run: |
|
|
122
|
+
cd examples/namespace_package
|
|
123
|
+
pip install wheel
|
|
124
|
+
python setup.py bdist_wheel
|
|
125
|
+
ls -l dist/
|
|
126
|
+
pip install --force-reinstall dist/namespace_package*_universal2.whl
|
|
127
|
+
cd -
|
|
128
|
+
python -c "from namespace_package import rust; assert rust.rust_func() == 14"
|
|
129
|
+
python -c "from namespace_package import python; assert python.python_func() == 15"
|
|
130
|
+
|
|
131
|
+
- name: Test sdist vendor Rust crates
|
|
132
|
+
shell: bash
|
|
133
|
+
run: nox -s test-sdist-vendor
|
|
134
|
+
env:
|
|
135
|
+
CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }}
|
|
136
|
+
|
|
137
|
+
test-abi3:
|
|
138
|
+
runs-on: ${{ matrix.os }}
|
|
139
|
+
strategy:
|
|
140
|
+
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
|
|
141
|
+
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
|
|
142
|
+
matrix:
|
|
143
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
144
|
+
steps:
|
|
145
|
+
- uses: actions/checkout@master
|
|
146
|
+
- name: Setup python
|
|
147
|
+
uses: actions/setup-python@v4
|
|
148
|
+
with:
|
|
149
|
+
python-version: 3.9
|
|
150
|
+
|
|
151
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
152
|
+
|
|
153
|
+
- name: Install Rust aarch64-apple-darwin target
|
|
154
|
+
if: matrix.os == 'macos-latest'
|
|
155
|
+
run: rustup target add aarch64-apple-darwin
|
|
156
|
+
|
|
157
|
+
- name: Build package
|
|
158
|
+
run: pip install -e .
|
|
159
|
+
|
|
160
|
+
- name: Build an abi3 wheel
|
|
161
|
+
shell: bash
|
|
162
|
+
run: |
|
|
163
|
+
set -e
|
|
164
|
+
cd examples/rust_with_cffi/
|
|
165
|
+
python --version
|
|
166
|
+
pip install -U wheel
|
|
167
|
+
python setup.py bdist_wheel --py-limited-api=cp39
|
|
168
|
+
ls -la dist/
|
|
169
|
+
env:
|
|
170
|
+
# https://github.com/actions/setup-python/issues/26
|
|
171
|
+
MACOSX_DEPLOYMENT_TARGET: 10.9
|
|
172
|
+
|
|
173
|
+
# Now we switch to a differnet Python version and ensure we can install
|
|
174
|
+
# the wheel we just built.
|
|
175
|
+
- name: Setup python
|
|
176
|
+
uses: actions/setup-python@v4
|
|
177
|
+
with:
|
|
178
|
+
python-version: "3.10"
|
|
179
|
+
|
|
180
|
+
- name: Install abi3 wheel and run tests
|
|
181
|
+
shell: bash
|
|
182
|
+
run: |
|
|
183
|
+
set -e
|
|
184
|
+
cd examples/
|
|
185
|
+
pip install -U wheel
|
|
186
|
+
python --version
|
|
187
|
+
pip install rust_with_cffi/dist/rust_with_cffi*.whl
|
|
188
|
+
python -c "from rust_with_cffi import rust; assert rust.rust_func() == 14"
|
|
189
|
+
python -c "from rust_with_cffi.cffi import lib; assert lib.cffi_func() == 15"
|
|
190
|
+
|
|
191
|
+
- name: Run abi3audit
|
|
192
|
+
shell: bash
|
|
193
|
+
run: |
|
|
194
|
+
set -e
|
|
195
|
+
pip install abi3audit
|
|
196
|
+
cd examples/
|
|
197
|
+
abi3audit rust_with_cffi/dist/rust_with_cffi*.whl
|
|
198
|
+
|
|
199
|
+
test-crossenv:
|
|
200
|
+
runs-on: ubuntu-latest
|
|
201
|
+
strategy:
|
|
202
|
+
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
|
|
203
|
+
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
|
|
204
|
+
matrix:
|
|
205
|
+
platform: [
|
|
206
|
+
{ target: "aarch64-unknown-linux-gnu", arch: "aarch64" },
|
|
207
|
+
{ target: "armv7-unknown-linux-gnueabihf", arch: "armv7" },
|
|
208
|
+
]
|
|
209
|
+
steps:
|
|
210
|
+
- uses: actions/checkout@master
|
|
211
|
+
- name: Build wheels
|
|
212
|
+
run: |
|
|
213
|
+
echo 'set -ex
|
|
214
|
+
curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
|
|
215
|
+
source ~/.cargo/env
|
|
216
|
+
rustup target add ${{ matrix.platform.target }}
|
|
217
|
+
|
|
218
|
+
# https://github.com/pypa/setuptools_scm/issues/707
|
|
219
|
+
git config --global --add safe.directory /io
|
|
220
|
+
|
|
221
|
+
cd examples/rust_with_cffi/
|
|
222
|
+
python3.9 -m pip install crossenv
|
|
223
|
+
python3.9 -m crossenv "/opt/python/cp39-cp39/bin/python3" --cc $TARGET_CC --cxx $TARGET_CXX --sysroot $TARGET_SYSROOT --env LIBRARY_PATH= --manylinux manylinux1 venv
|
|
224
|
+
. venv/bin/activate
|
|
225
|
+
build-pip install cffi wheel "setuptools>=62.4"
|
|
226
|
+
cross-expose cffi
|
|
227
|
+
pip install wheel
|
|
228
|
+
pip install -e ../../
|
|
229
|
+
python setup.py bdist_wheel --py-limited-api=cp37
|
|
230
|
+
ls -la dist/
|
|
231
|
+
' > build-wheels.sh
|
|
232
|
+
|
|
233
|
+
docker run --rm -v "$PWD":/io -w /io messense/manylinux2014-cross:${{ matrix.platform.arch }} bash build-wheels.sh
|
|
234
|
+
- name: Install abi3 wheel and run tests
|
|
235
|
+
uses: uraimo/run-on-arch-action@v2.0.5
|
|
236
|
+
with:
|
|
237
|
+
arch: ${{ matrix.platform.arch }}
|
|
238
|
+
distro: ubuntu20.04
|
|
239
|
+
dockerRunArgs: |
|
|
240
|
+
--volume "${PWD}/examples:/examples"
|
|
241
|
+
install: |
|
|
242
|
+
apt-get update
|
|
243
|
+
apt-get install -y --no-install-recommends python3 python3-dev python3-pip build-essential libffi-dev
|
|
244
|
+
run: |
|
|
245
|
+
cd /examples
|
|
246
|
+
python3 --version
|
|
247
|
+
pip3 install rust_with_cffi/dist/rust_with_cffi*.whl
|
|
248
|
+
python3 -c "from rust_with_cffi import rust; assert rust.rust_func() == 14"
|
|
249
|
+
python3 -c "from rust_with_cffi.cffi import lib; assert lib.cffi_func() == 15"
|
|
250
|
+
|
|
251
|
+
test-cross:
|
|
252
|
+
runs-on: ubuntu-latest
|
|
253
|
+
steps:
|
|
254
|
+
- uses: actions/checkout@v3
|
|
255
|
+
- name: Setup python
|
|
256
|
+
uses: actions/setup-python@v4
|
|
257
|
+
with:
|
|
258
|
+
python-version: 3.8
|
|
259
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
260
|
+
- name: Install cross
|
|
261
|
+
uses: taiki-e/install-action@v1
|
|
262
|
+
with:
|
|
263
|
+
tool: cross
|
|
264
|
+
- name: Build package
|
|
265
|
+
run: pip install -e .
|
|
266
|
+
- name: Build wheel using cross
|
|
267
|
+
shell: bash
|
|
268
|
+
env:
|
|
269
|
+
CARGO: cross
|
|
270
|
+
CARGO_BUILD_TARGET: aarch64-unknown-linux-gnu
|
|
271
|
+
PYO3_CROSS_LIB_DIR: /opt/python/cp38-cp38/lib
|
|
272
|
+
run: |
|
|
273
|
+
cd examples/namespace_package
|
|
274
|
+
docker build -t cross-pyo3:aarch64-unknown-linux-gnu .
|
|
275
|
+
python -m pip install wheel
|
|
276
|
+
python setup.py bdist_wheel --plat-name manylinux2014_aarch64
|
|
277
|
+
ls -la dist/
|
|
278
|
+
- uses: uraimo/run-on-arch-action@v2.1.1
|
|
279
|
+
name: Install built wheel
|
|
280
|
+
with:
|
|
281
|
+
arch: aarch64
|
|
282
|
+
distro: ubuntu20.04
|
|
283
|
+
dockerRunArgs: |
|
|
284
|
+
--volume "${PWD}/examples/namespace_package:/io"
|
|
285
|
+
install: |
|
|
286
|
+
apt-get update
|
|
287
|
+
apt-get install -y --no-install-recommends python3 python3-pip
|
|
288
|
+
pip3 install -U pip
|
|
289
|
+
run: |
|
|
290
|
+
pip3 install namespace_package --no-index --find-links /io/dist/ --force-reinstall
|
|
291
|
+
python3 -c "from namespace_package import rust; assert rust.rust_func() == 14"
|
|
292
|
+
python3 -c "from namespace_package import python; assert python.python_func() == 15"
|
|
293
|
+
|
|
294
|
+
test-zigbuild:
|
|
295
|
+
runs-on: ubuntu-latest
|
|
296
|
+
steps:
|
|
297
|
+
- uses: actions/checkout@v3
|
|
298
|
+
- name: Setup python
|
|
299
|
+
uses: actions/setup-python@v4
|
|
300
|
+
with:
|
|
301
|
+
python-version: 3.8
|
|
302
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
303
|
+
with:
|
|
304
|
+
targets: aarch64-unknown-linux-gnu
|
|
305
|
+
- name: Install cargo-zigbuild
|
|
306
|
+
run: |
|
|
307
|
+
python3 -m pip install cargo-zigbuild
|
|
308
|
+
- name: Build package
|
|
309
|
+
run: pip install -e .
|
|
310
|
+
- name: Build wheel using cargo-zigbuild
|
|
311
|
+
shell: bash
|
|
312
|
+
env:
|
|
313
|
+
CARGO: cargo-zigbuild
|
|
314
|
+
CARGO_BUILD_TARGET: aarch64-unknown-linux-gnu
|
|
315
|
+
PYO3_CROSS_LIB_DIR: /opt/python/cp38-cp38/lib
|
|
316
|
+
run: |
|
|
317
|
+
mkdir -p $PYO3_CROSS_LIB_DIR
|
|
318
|
+
docker cp -L $(docker create --rm quay.io/pypa/manylinux2014_aarch64:latest):/opt/python/cp38-cp38 /opt/python
|
|
319
|
+
cd examples/namespace_package
|
|
320
|
+
python -m pip install wheel
|
|
321
|
+
python setup.py bdist_wheel --plat-name manylinux2014_aarch64
|
|
322
|
+
ls -la dist/
|
|
323
|
+
- uses: uraimo/run-on-arch-action@v2.1.1
|
|
324
|
+
name: Install built wheel
|
|
325
|
+
with:
|
|
326
|
+
arch: aarch64
|
|
327
|
+
distro: ubuntu20.04
|
|
328
|
+
dockerRunArgs: |
|
|
329
|
+
--volume "${PWD}/examples/namespace_package:/io"
|
|
330
|
+
install: |
|
|
331
|
+
apt-get update
|
|
332
|
+
apt-get install -y --no-install-recommends python3 python3-pip
|
|
333
|
+
pip3 install -U pip
|
|
334
|
+
run: |
|
|
335
|
+
pip3 install namespace_package --no-index --find-links /io/dist/ --force-reinstall
|
|
336
|
+
python3 -c "from namespace_package import rust; assert rust.rust_func() == 14"
|
|
337
|
+
python3 -c "from namespace_package import python; assert python.python_func() == 15"
|
|
338
|
+
|
|
339
|
+
test-cibuildwheel:
|
|
340
|
+
runs-on: macos-latest
|
|
341
|
+
steps:
|
|
342
|
+
- uses: actions/checkout@v3
|
|
343
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
344
|
+
with:
|
|
345
|
+
targets: aarch64-apple-darwin
|
|
346
|
+
- uses: pypa/cibuildwheel@v2.3.1
|
|
347
|
+
env:
|
|
348
|
+
CIBW_BUILD: cp39-*
|
|
349
|
+
CIBW_BEFORE_BUILD: pip install -e .
|
|
350
|
+
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
|
|
351
|
+
CIBW_BUILD_VERBOSITY: 1
|
|
352
|
+
with:
|
|
353
|
+
package-dir: examples/namespace_package
|
|
354
|
+
|
|
355
|
+
test-mingw:
|
|
356
|
+
runs-on: windows-latest
|
|
357
|
+
name: ${{ matrix.python-version }} mingw-${{ matrix.arch }}
|
|
358
|
+
strategy:
|
|
359
|
+
fail-fast: false
|
|
360
|
+
matrix:
|
|
361
|
+
include: [
|
|
362
|
+
{ msystem: MINGW64, arch: x86_64, path: mingw64, rust_target: x86_64-pc-windows-gnu },
|
|
363
|
+
{ msystem: MINGW32, arch: i686, path: mingw32, rust_target: i686-pc-windows-gnu }
|
|
364
|
+
]
|
|
365
|
+
steps:
|
|
366
|
+
- uses: actions/checkout@v2
|
|
367
|
+
- name: Install MSys2 and dependencies
|
|
368
|
+
uses: msys2/setup-msys2@v2
|
|
369
|
+
with:
|
|
370
|
+
update: true
|
|
371
|
+
msystem: ${{ matrix.msystem }}
|
|
372
|
+
install: >-
|
|
373
|
+
git
|
|
374
|
+
mingw-w64-${{ matrix.arch }}-python
|
|
375
|
+
mingw-w64-${{ matrix.arch }}-python-pip
|
|
376
|
+
mingw-w64-${{ matrix.arch }}-openssl
|
|
377
|
+
mingw-w64-${{ matrix.arch }}-toolchain
|
|
378
|
+
|
|
379
|
+
- uses: dtolnay/rust-toolchain@master
|
|
380
|
+
with:
|
|
381
|
+
toolchain: stable-${{ matrix.rust_target }}
|
|
382
|
+
|
|
383
|
+
- name: Install test dependencies
|
|
384
|
+
shell: msys2 {0}
|
|
385
|
+
run: python -m pip install --upgrade nox pip wheel
|
|
386
|
+
|
|
387
|
+
- name: Create libpython symlink
|
|
388
|
+
shell: msys2 {0}
|
|
389
|
+
run: ln -s /${{ matrix.path }}/lib/libpython3.10.dll.a /${{ matrix.path }}/lib/libpython310.dll.a
|
|
390
|
+
|
|
391
|
+
- name: Test examples
|
|
392
|
+
shell: msys2 {0}
|
|
393
|
+
run: |
|
|
394
|
+
PATH="$PATH:/c/Users/runneradmin/.cargo/bin" nox -s test-mingw
|
|
395
|
+
|
|
396
|
+
test-emscripten:
|
|
397
|
+
name: Test Emscripten
|
|
398
|
+
runs-on: ubuntu-latest
|
|
399
|
+
steps:
|
|
400
|
+
- uses: actions/checkout@v3
|
|
401
|
+
- uses: actions/setup-node@v3
|
|
402
|
+
with:
|
|
403
|
+
node-version: 18
|
|
404
|
+
- run: |
|
|
405
|
+
PYODIDE_VERSION=0.21.0
|
|
406
|
+
|
|
407
|
+
cd emscripten
|
|
408
|
+
npm i pyodide@0.21.0 prettier
|
|
409
|
+
cd node_modules/pyodide/
|
|
410
|
+
node ../prettier/bin-prettier.js -w pyodide.asm.js
|
|
411
|
+
EMSCRIPTEN_VERSION=$(node -p "require('./repodata.json').info.platform.split('_').slice(1).join('.')")
|
|
412
|
+
PYTHON_VERSION=3.10
|
|
413
|
+
|
|
414
|
+
echo "PYODIDE_VERSION=$PYODIDE_VERSION" >> $GITHUB_ENV
|
|
415
|
+
echo "EMSCRIPTEN_VERSION=$EMSCRIPTEN_VERSION" >> $GITHUB_ENV
|
|
416
|
+
echo "PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_ENV
|
|
417
|
+
echo "ORIG_PATH=$PATH" >> $GITHUB_ENV
|
|
418
|
+
- uses: dtolnay/rust-toolchain@nightly
|
|
419
|
+
with:
|
|
420
|
+
components: rust-src
|
|
421
|
+
targets: wasm32-unknown-emscripten
|
|
422
|
+
- uses: mymindstorm/setup-emsdk@v11
|
|
423
|
+
with:
|
|
424
|
+
version: ${{env.EMSCRIPTEN_VERSION}}
|
|
425
|
+
actions-cache-folder: emsdk-cache
|
|
426
|
+
- uses: actions/setup-python@v4
|
|
427
|
+
id: setup-python
|
|
428
|
+
with:
|
|
429
|
+
python-version: ${{env.PYTHON_VERSION}}
|
|
430
|
+
- run: pip install nox
|
|
431
|
+
- uses: actions/cache@v3
|
|
432
|
+
with:
|
|
433
|
+
path: |
|
|
434
|
+
tests/pyodide
|
|
435
|
+
key: ${{ hashFiles('tests/*.js') }} - ${{ hashFiles('noxfile.py') }} - ${{ steps.setup-python.outputs.python-path }}
|
|
436
|
+
- uses: Swatinem/rust-cache@v2
|
|
437
|
+
- name: Test
|
|
438
|
+
run: |
|
|
439
|
+
export PATH=$ORIG_PATH:$PATH
|
|
440
|
+
nox -s test-examples-emscripten
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# This workflows will upload a Python Package using Twine when a release is created
|
|
2
|
+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
|
3
|
+
|
|
4
|
+
name: Upload Python Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [published]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
deploy:
|
|
13
|
+
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v3
|
|
18
|
+
with:
|
|
19
|
+
# Fetch all history so that setuptools_scm works correctly
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
- name: Set up Python
|
|
22
|
+
uses: actions/setup-python@v4
|
|
23
|
+
with:
|
|
24
|
+
python-version: '3.x'
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
# Install build and packaging dependencies.
|
|
27
|
+
# setuptools-scm is necessary for ensuring all files from VCS (such as
|
|
28
|
+
# examples) are in the sdist.
|
|
29
|
+
run: |
|
|
30
|
+
pip install --upgrade pip setuptools wheel twine setuptools-scm
|
|
31
|
+
- name: Build and publish
|
|
32
|
+
env:
|
|
33
|
+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
|
34
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
35
|
+
run: |
|
|
36
|
+
python setup.py sdist bdist_wheel
|
|
37
|
+
twine upload dist/*
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.6.0 (2023-04-27)
|
|
4
|
+
### Changed
|
|
5
|
+
- Prefer passing `--crate-type` option to cargo if "toolchain >= 1.64". [#322](https://github.com/PyO3/setuptools-rust/pull/322)
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Fix a bug where rebuilding the library would cause any running processes using it to segfault. [#295](https://github.com/PyO3/setuptools-rust/pull/295)
|
|
9
|
+
- Fix `setup.cfg` format for compatibility with "poetry==1.4.0". [#319](https://github.com/PyO3/setuptools-rust/pull/319)
|
|
10
|
+
|
|
11
|
+
## 1.5.2 (2022-09-19)
|
|
12
|
+
### Fixed
|
|
13
|
+
- Fix regression in `dylib` build artifacts not being found since 1.5.0. [#290](https://github.com/PyO3/setuptools-rust/pull/290)
|
|
14
|
+
- Fix regression in sdist missing examples and other supplementary files since 1.5.0. [#291](https://github.com/PyO3/setuptools-rust/pull/291)
|
|
15
|
+
|
|
3
16
|
## 1.5.1 (2022-08-14)
|
|
4
17
|
### Fixed
|
|
5
18
|
- Fix regression in `get_lib_name` crashing since 1.5.0. [#280](https://github.com/PyO3/setuptools-rust/pull/280)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: setuptools-rust
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.0
|
|
4
4
|
Summary: Setuptools Rust extension plugin
|
|
5
5
|
Home-page: https://github.com/PyO3/setuptools-rust
|
|
6
6
|
Author: Nikolay Kim
|
|
@@ -11,11 +11,11 @@ Classifier: Topic :: Software Development :: Version Control
|
|
|
11
11
|
Classifier: License :: OSI Approved :: MIT License
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.7
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.8
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
19
|
Classifier: Development Status :: 5 - Production/Stable
|
|
20
20
|
Classifier: Operating System :: POSIX
|
|
21
21
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = .
|
|
9
|
+
BUILDDIR = _build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Building wheels
|
|
2
|
+
|
|
3
|
+
Because `setuptools-rust` is an extension to `setuptools`, the standard `setup.py bdist_wheel` command is used to build distributable wheels. These wheels can be uploaded to PyPI using standard tools such as [twine](https://github.com/pypa/twine).
|
|
4
|
+
|
|
5
|
+
`setuptools-rust` supports building for the [PEP 384](https://www.python.org/dev/peps/pep-0384/) "stable" (aka "limited") API when the `--py-limited-api` option is passed to `setup.py bdist_wheel`. If using PyO3 bindings for `RustExtension`, then the correct [`pyo3/abi3`](https://pyo3.rs/v0.14.5/features.html#abi3) sub-feature is automatically enabled. In this way, abi3 wheels can be uploaded to make package distributors' roles easier, and package users installing from source with `python setup.py install` can use optimizations specific to their Python version.
|
|
6
|
+
|
|
7
|
+
This chapter of the documentation explains two possible ways to build wheels for multiple Python versions below.
|
|
8
|
+
|
|
9
|
+
## Using `cibuildwheel`
|
|
10
|
+
|
|
11
|
+
[`cibuildwheel`][cibuildwheel] is a tool to build wheels for multiple platforms using Github Actions.
|
|
12
|
+
|
|
13
|
+
The [`rtoml` package does this, for example](https://github.com/samuelcolvin/rtoml/blob/143ee0907bba616cbcd5cc58eefe9000fcc2b5f2/.github/workflows/ci.yml#L99-L195).
|
|
14
|
+
|
|
15
|
+
## Building manually
|
|
16
|
+
|
|
17
|
+
Place a script called `build-wheels.sh` with the following contents in your project root (next to the `setup.py` file):
|
|
18
|
+
|
|
19
|
+
```{eval-rst}
|
|
20
|
+
.. literalinclude:: ../examples/html-py-ever/build-wheels.sh
|
|
21
|
+
:language: bash
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This script can be used to produce wheels for multiple Python versions.
|
|
25
|
+
|
|
26
|
+
### Binary wheels on linux
|
|
27
|
+
|
|
28
|
+
To build binary wheels on linux, you need to use the [manylinux docker container](https://github.com/pypa/manylinux). You will run the `build-wheels.sh` from above inside that container.
|
|
29
|
+
|
|
30
|
+
First, pull the `manylinux2014` Docker image:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
docker pull quay.io/pypa/manylinux2014_x86_64
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Then use the following command to build wheels for supported Python versions:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
docker run --rm -v `pwd`:/io quay.io/pypa/manylinux2014_x86_64 bash /io/build-wheels.sh
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This will create wheels in the `dist` directory:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
$ ls dist
|
|
46
|
+
hello_rust-0.1.0-cp37-cp37m-linux_x86_64.whl hello_rust-0.1.0-cp37-cp37m-manylinux2014_x86_64.whl
|
|
47
|
+
hello_rust-0.1.0-cp38-cp38-linux_x86_64.whl hello_rust-0.1.0-cp38-cp38-manylinux2014_x86_64.whl
|
|
48
|
+
hello_rust-0.1.0-cp39-cp39-linux_x86_64.whl hello_rust-0.1.0-cp39-cp39-manylinux2014_x86_64.whl
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
It is possible to use any of the `manylinux` docker images: `manylinux1`, `manylinux2010` or `manylinux2014`. (Just replace `manylinux2014` in the above instructions with the alternative version you wish to use.)
|
|
52
|
+
|
|
53
|
+
### Binary wheels on macOS
|
|
54
|
+
|
|
55
|
+
For building wheels on macOS it is sufficient to run the `bdist_wheel` command, i.e. `setup.py bdist_wheel`.
|
|
56
|
+
|
|
57
|
+
To build `universal2` wheels set the `ARCHFLAGS` environment variable to contain both `x86_64` and `arm64`, for example `ARCHFLAGS="-arch x86_64 -arch arm64"`. Wheel-building solutions such as [`cibuildwheel`][cibuildwheel] set this environment variable automatically.
|
|
58
|
+
|
|
59
|
+
[cibuildwheel]: https://github.com/pypa/cibuildwheel
|