-
Notifications
You must be signed in to change notification settings - Fork 105
Change examples in accordance to review comments in #348 #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b150e62
c1af5a7
8530b86
41db159
c76af32
5c1cce4
624f5db
c7c9c7f
ecba282
3772b27
f9fb03e
e90228c
b28f5a9
b85e7bf
95de1bd
fdc9950
a075252
27dd25d
86748d3
831918c
dc2607d
8930627
71e28fd
634efa8
745a781
1d3d921
085013b
023dc7b
81ec0b0
e9b85eb
849cfb1
a808242
85df414
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,8 +120,8 @@ jobs: | |
PYO3_CROSS_LIB_DIR: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib | ||
run: | | ||
cd examples/namespace_package | ||
pip install wheel | ||
python setup.py bdist_wheel | ||
pip install build wheel | ||
python -m build --no-isolation | ||
ls -l dist/ | ||
pip install --force-reinstall dist/namespace_package*_universal2.whl | ||
cd - | ||
|
@@ -159,16 +159,18 @@ jobs: | |
|
||
- name: Build an abi3 wheel | ||
shell: bash | ||
env: | ||
# https://github.com/actions/setup-python/issues/26 | ||
MACOSX_DEPLOYMENT_TARGET: 10.9 | ||
DIST_EXTRA_CONFIG: /tmp/build-opts.cfg | ||
run: | | ||
set -e | ||
cd examples/rust_with_cffi/ | ||
python --version | ||
pip install -U wheel | ||
python setup.py bdist_wheel --py-limited-api=cp39 | ||
pip install -U build cffi wheel | ||
echo -e "[bdist_wheel]\npy_limited_api=cp39" > $DIST_EXTRA_CONFIG | ||
python -m build --no-isolation | ||
ls -la dist/ | ||
env: | ||
# https://github.com/actions/setup-python/issues/26 | ||
MACOSX_DEPLOYMENT_TARGET: 10.9 | ||
|
||
# Now we switch to a differnet Python version and ensure we can install | ||
# the wheel we just built. | ||
|
@@ -222,12 +224,20 @@ jobs: | |
python3.9 -m pip install crossenv | ||
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 | ||
. venv/bin/activate | ||
build-pip install cffi wheel "setuptools>=62.4" | ||
|
||
build-pip install -U pip>=23.2.1 setuptools>=68.0.0 wheel>=0.41.1 | ||
cross-pip install -U pip>=23.2.1 setuptools>=68.0.0 wheel>=0.41.1 | ||
build-pip install cffi | ||
cross-expose cffi | ||
pip install wheel | ||
pip install -e ../../ | ||
python setup.py bdist_wheel --py-limited-api=cp37 | ||
cross-pip install -e ../../ | ||
cross-pip list | ||
|
||
export DIST_EXTRA_CONFIG=/tmp/build-opts.cfg | ||
echo -e "[bdist_wheel]\npy_limited_api=cp37" > $DIST_EXTRA_CONFIG | ||
|
||
cross-pip wheel --no-build-isolation --no-deps --wheel-dir dist . | ||
ls -la dist/ | ||
python -m zipfile -l dist/*.whl # debug all files inside wheel file | ||
' > build-wheels.sh | ||
|
||
docker run --rm -v "$PWD":/io -w /io messense/manylinux2014-cross:${{ matrix.platform.arch }} bash build-wheels.sh | ||
|
@@ -269,12 +279,15 @@ jobs: | |
CARGO: cross | ||
CARGO_BUILD_TARGET: aarch64-unknown-linux-gnu | ||
PYO3_CROSS_LIB_DIR: /opt/python/cp38-cp38/lib | ||
DIST_EXTRA_CONFIG: /tmp/build-opts.cfg | ||
run: | | ||
cd examples/namespace_package | ||
docker build -t cross-pyo3:aarch64-unknown-linux-gnu . | ||
python -m pip install wheel | ||
python setup.py bdist_wheel --plat-name manylinux2014_aarch64 | ||
python -m pip install build wheel | ||
echo -e "[bdist_wheel]\nplat_name=manylinux2014_aarch64" > $DIST_EXTRA_CONFIG | ||
python -m build --no-isolation | ||
ls -la dist/ | ||
unzip -l dist/*.whl # debug all files inside wheel file | ||
- uses: uraimo/run-on-arch-action@v2.5.0 | ||
name: Install built wheel | ||
with: | ||
|
@@ -313,13 +326,16 @@ jobs: | |
CARGO: cargo-zigbuild | ||
CARGO_BUILD_TARGET: aarch64-unknown-linux-gnu | ||
PYO3_CROSS_LIB_DIR: /opt/python/cp38-cp38/lib | ||
DIST_EXTRA_CONFIG: /tmp/build-opts.cfg | ||
run: | | ||
mkdir -p $PYO3_CROSS_LIB_DIR | ||
docker cp -L $(docker create --rm quay.io/pypa/manylinux2014_aarch64:latest):/opt/python/cp38-cp38 /opt/python | ||
cd examples/namespace_package | ||
python -m pip install wheel | ||
python setup.py bdist_wheel --plat-name manylinux2014_aarch64 | ||
python -m pip install build wheel | ||
echo -e "[bdist_wheel]\nplat_name=manylinux2014_aarch64" > $DIST_EXTRA_CONFIG | ||
python -m build --no-isolation | ||
Comment on lines
333
to
+336
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potentially you could also rework this test to use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @davidhewitt, before going back to In the CI logs, we can see that for this PR,
For the main branch the message is different though:
They differ in the target file name In both cases however the name of the wheel is identical: Do you have any idea why that is happening? I can see in The problem that I seem to be seen is that both I wonder if instead of passing this parameter to UPDATE: I see now that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that changing the following fixes the problem with --- a/setuptools_rust/setuptools_ext.py
+++ b/setuptools_rust/setuptools_ext.py
@@ -163,9 +163,11 @@ def add_rust_extension(dist: Distribution) -> None:
- options = self.distribution.get_cmdline_options().get("bdist_wheel", {})
- plat_name = options.get("plat-name") or self.plat_name
+ bdist_wheel = self.distribution.get_command_obj("bdist_wheel")
+ plat_name = bdist_wheel.plat_name or self.plat_name (Probably related to the fact that when the test calls |
||
ls -la dist/ | ||
unzip -l dist/*.whl # debug all files inside wheel file | ||
- uses: uraimo/run-on-arch-action@v2.5.0 | ||
name: Install built wheel | ||
with: | ||
|
@@ -346,9 +362,15 @@ jobs: | |
- uses: pypa/cibuildwheel@v2.3.1 | ||
env: | ||
CIBW_BUILD: cp39-* | ||
CIBW_BEFORE_BUILD: pip install -e . | ||
CIBW_BEFORE_BUILD: pip install -U 'pip>=23.2.1' 'setuptools>=68.0.0' 'wheel<=0.37.1' && pip install -e . && pip list | ||
# ^-- cap on `wheel` is a workaround for pypa/auditwheel#436 | ||
# setuptools needs to be upgraded before installing setuptools-rust | ||
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_BUILD_VERBOSITY: 3 | ||
CIBW_BUILD_FRONTEND: pip # pip allows disabling isolation via env var | ||
CIBW_ENVIRONMENT: PIP_NO_BUILD_ISOLATION=false | ||
# ^-- necessary to use working copy of setuptools-rust, | ||
# (however PIP_NO_BUILD_ISOLATION is counter-intuitive: see pypa/pip#5735) | ||
with: | ||
package-dir: examples/namespace_package | ||
|
||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the changes for
test-cross
andtest-crossenv
can be reverted and left for now to ease your pain in CI? Givenrust_with_cffi/setup.py
still exists I'd be ok with leaving those as-is in this PR and dealing with them another time.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @davidhewitt, thank you very much for the review.
I can try to do that. For
test-crossenv
it should be just a matter of reverting 1d3fe5f. Although, I am not sure how the problem with the failures in the CI are related tosetup.py
vs.DIST_EXTRA_CONFIG
as a form of passing build options:In https://github.com/PyO3/setuptools-rust/actions/runs/5834731386/job/15824909577#step:3:232 we can see that the error in CI for test-crossenv seems unrelated (somehow it is missing
decimal
, which is supposedly happening beforebuild
creates an isolated environment.)In https://github.com/PyO3/setuptools-rust/actions/runs/5834731386/job/15824908490#step:7:488), we can see that Rust seems to be having problems to find Python information and failing with:
Maybe that is related to the use of a virtual environment in https://github.com/PyO3/setuptools-rust/actions/runs/5834731386/job/15824908490#step:7:6?
I might try a couple of things before, but if they don't work I will proceed with the suggestion of sticking with
python setup.py
for the problematic tests.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is something weird going on with
test-crossenv
when I try to usebuild
:I do
pip install cffi
and it saysRequirement already satisfied
, then I try to runpython -m build --no-isolation
and it complains aboutcffi
being a missing dependency.I am not sure how the
cross-expose
tools work, but maybe there is a clash with the way build provisions "no-isolation" build enviroments...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crossenv
seems to have a problem withbuild
: benfogle/crossenv#108