Skip to content

Commit 14c4282

Browse files
authored
fix: ci tests (#506)
1 parent 2c77014 commit 14c4282

File tree

13 files changed

+68
-41
lines changed

13 files changed

+68
-41
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ target/
6464
wheelhoust-*
6565
tests/integration/testpackage/testpackage/testprogram
6666
tests/integration/testpackage/testpackage/testprogram_nodeps
67+
tests/integration/sample_extension/src/sample_extension.c
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2+
requires = ["cython", "setuptools"]
23
build-backend = "setuptools.build_meta"
3-
requires = ["cython", "setuptools", "wheel"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2+
requires = ["cython", "setuptools"]
23
build-backend = "setuptools.build_meta"
3-
requires = ["cython", "setuptools", "wheel"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"

tests/integration/test_manylinux.py

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
}
8888
NUMPY_VERSION = NUMPY_VERSION_MAP[PYTHON_ABI_MAJ_MIN]
8989
ORIGINAL_NUMPY_WHEEL = f"numpy-{NUMPY_VERSION}-{PYTHON_ABI}-linux_{PLATFORM}.whl"
90-
ORIGINAL_SIX_WHEEL = "six-1.11.0-py2.py3-none-any.whl"
9190
SHOW_RE = re.compile(
9291
r'[\s](?P<wheel>\S+) is consistent with the following platform tag: "(?P<tag>\S+)"',
9392
flags=re.DOTALL,
@@ -321,7 +320,7 @@ def test_repair_exclude(self, any_manylinux_container, io_folder):
321320
build_cmd = (
322321
f"cd {test_path} && "
323322
"if [ -d ./build ]; then rm -rf ./build ./*.egg-info; fi && "
324-
"python setup.py bdist_wheel -d /io"
323+
"python -m pip wheel --no-deps -w /io ."
325324
)
326325
docker_exec(manylinux_ctr, ["bash", "-c", build_cmd])
327326
filenames = os.listdir(io_folder)
@@ -426,23 +425,13 @@ def test_build_wheel_with_binary_executable(
426425
def test_build_repair_pure_wheel(self, any_manylinux_container, io_folder):
427426
policy, tag, manylinux_ctr = any_manylinux_container
428427

429-
if op.exists(op.join(WHEEL_CACHE_FOLDER, policy, ORIGINAL_SIX_WHEEL)):
430-
# If six has already been built and put in cache, let's reuse this.
431-
shutil.copy2(
432-
op.join(WHEEL_CACHE_FOLDER, policy, ORIGINAL_SIX_WHEEL),
433-
op.join(io_folder, ORIGINAL_SIX_WHEEL),
434-
)
435-
logger.info(f"Copied six wheel from {WHEEL_CACHE_FOLDER} to {io_folder}")
436-
else:
437-
docker_exec(manylinux_ctr, "pip wheel -w /io --no-binary=:all: six==1.11.0")
438-
os.makedirs(op.join(WHEEL_CACHE_FOLDER, policy), exist_ok=True)
439-
shutil.copy2(
440-
op.join(io_folder, ORIGINAL_SIX_WHEEL),
441-
op.join(WHEEL_CACHE_FOLDER, policy, ORIGINAL_SIX_WHEEL),
442-
)
428+
docker_exec(
429+
manylinux_ctr,
430+
"pip download --no-deps -d /io --only-binary=:all: six==1.16.0",
431+
)
443432

444433
filenames = os.listdir(io_folder)
445-
assert filenames == [ORIGINAL_SIX_WHEEL]
434+
assert filenames == ["six-1.16.0-py2.py3-none-any.whl"]
446435
orig_wheel = filenames[0]
447436
assert "manylinux" not in orig_wheel
448437

@@ -477,7 +466,7 @@ def test_build_wheel_depending_on_library_with_rpath(
477466
(
478467
"cd /auditwheel_src/tests/integration/testrpath &&"
479468
"if [ -d ./build ]; then rm -rf ./build ./*.egg-info; fi && "
480-
f"DTAG={dtag} python setup.py bdist_wheel -d /io"
469+
f"DTAG={dtag} python -m pip wheel --no-deps -w /io ."
481470
),
482471
],
483472
)
@@ -860,15 +849,17 @@ def test_build_wheel_with_image_dependencies(
860849
# tested.
861850

862851
policy, tag, manylinux_ctr = any_manylinux_container
863-
852+
build_command = (
853+
"cd /auditwheel_src/tests/integration/testdependencies && "
854+
"if [ -d ./build ]; then rm -rf ./build ./*.egg-info; fi && "
855+
f"WITH_DEPENDENCY={with_dependency} python -m pip wheel --no-deps -w /io ."
856+
)
864857
docker_exec(
865858
manylinux_ctr,
866859
[
867860
"bash",
868861
"-c",
869-
"cd /auditwheel_src/tests/integration/testdependencies && "
870-
f"WITH_DEPENDENCY={with_dependency} python setup.py -v build_ext -f "
871-
"bdist_wheel -d /io",
862+
build_command,
872863
],
873864
)
874865

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"

tests/integration/testdependencies/setup.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
from os import getenv, path
55

66
from setuptools import Extension, setup
7-
8-
cmd = "gcc -shared -fPIC -D_GNU_SOURCE dependency.c -o libdependency.so -lm -lc"
9-
subprocess.check_call(cmd.split())
7+
from setuptools.command.build_ext import build_ext
108

119
define_macros = [("_GNU_SOURCE", None)]
1210
libraries = []
@@ -19,9 +17,18 @@
1917

2018
libraries.extend(["m", "c"])
2119

20+
21+
class BuildExt(build_ext):
22+
def run(self) -> None:
23+
cmd = "gcc -shared -fPIC -D_GNU_SOURCE dependency.c -o libdependency.so -lm -lc"
24+
subprocess.check_call(cmd.split())
25+
super().run()
26+
27+
2228
setup(
2329
name="testdependencies",
2430
version="0.0.1",
31+
cmdclass={"build_ext": BuildExt},
2532
ext_modules=[
2633
Extension(
2734
"testdependencies",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"

0 commit comments

Comments
 (0)