Skip to content

Commit cd4dcc0

Browse files
committed
matscipy: write the ase constraint inside the cibuildwheel container
CIBW_TEST_COMMAND runs matscipy's whole build+test lifecycle inside the manylinux Docker container; neither github.workspace nor runner.temp is a path that container ever sees; a host-side step writing to either one is invisible to it, which is why both prior attempts hit the same "Could not open constraint file" error. before-build/build/repair/test all run in that same container instance per identifier, so writing the constraint file from CIBW_BEFORE_BUILD instead puts it on a path the container actually has.
1 parent f4d62cb commit cd4dcc0

1 file changed

Lines changed: 17 additions & 18 deletions

File tree

‎.github/workflows/build-matscipy.yml‎

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,35 +63,34 @@ jobs:
6363
fetch-depth: 0
6464
persist-credentials: false
6565

66-
# ase 3.28.0 removed the whole ase.constraints module (UnitCellFilter and friends)
67-
# that this v1.2.0 tag's own tests/ still imports from; matscipy's pyproject.toml
68-
# floor (ase>=3.26.0) doesn't cap the other end, so an unconstrained resolve picks
69-
# today's ase and breaks 29 tests / errors on 12 modules. A PIP_CONSTRAINT file
70-
# (below, via CIBW_TEST_ENVIRONMENT) caps it for every pip invocation in the test
71-
# phase, however cibuildwheel orders installs -- unlike a version spec embedded
72-
# directly in CIBW_TEST_REQUIRES, which a prior commit tried and which silently did
73-
# nothing (the quoted token was a literal string, not a parsed requirement).
74-
# runner.temp, not github.workspace: cibuildwheel's manylinux test phase runs pip
75-
# inside the same docker container as the build, and github.workspace's host path
76-
# isn't what's mounted there on this self-hosted runner (confirmed by a failed
77-
# rerun); runner.temp is (build-kivy.yml's own PIP_CONSTRAINT fix proved it visible
78-
# in that same test-phase environment).
79-
- name: Constrain ase for the test run
80-
run: echo 'ase<3.28' > "${{ runner.temp }}/ase-constraint.txt"
81-
8266
- name: Build wheels
8367
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
8468
with:
8569
only: ${{ matrix.python }}-manylinux_riscv64
8670
env:
8771
CIBW_BUILD_FRONTEND: build
88-
CIBW_BEFORE_BUILD: pip install meson meson-python ninja
72+
# ase 3.28.0 removed the whole ase.constraints module (UnitCellFilter and
73+
# friends) that this v1.2.0 tag's own tests/ still imports from; matscipy's
74+
# pyproject.toml floor (ase>=3.26.0) doesn't cap the other end, so an
75+
# unconstrained resolve picks today's ase and breaks 29 tests / errors on 12
76+
# modules. A version spec embedded directly in CIBW_TEST_REQUIRES silently
77+
# does nothing (the quoted token is a literal string, not a parsed
78+
# requirement), so this pins it via a PIP_CONSTRAINT file instead.
79+
# CIBW_TEST_COMMAND runs matscipy's whole build+test lifecycle inside the
80+
# manylinux Docker container, and neither github.workspace nor runner.temp
81+
# -- both host paths -- is visible there (two prior attempts confirmed
82+
# each one the hard way). before-build/build/repair/test share one container
83+
# instance per identifier, so write the file here, from inside that
84+
# container, instead of from a host-side step.
85+
CIBW_BEFORE_BUILD: |
86+
pip install meson meson-python ninja
87+
echo 'ase<3.28' > /tmp/ase-constraint.txt
8988
CIBW_ENVIRONMENT: >-
9089
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
9190
PIP_ONLY_BINARY=numpy,scipy,matplotlib,contourpy,kiwisolver,pillow
9291
# Upstream's wheel job only imports the extension; run its tests.yml suite instead.
9392
CIBW_TEST_REQUIRES: pytest pytest-subtests pytest-timeout pytest-xdist sympy
94-
CIBW_TEST_ENVIRONMENT: PIP_CONSTRAINT=${{ runner.temp }}/ase-constraint.txt
93+
CIBW_TEST_ENVIRONMENT: PIP_CONSTRAINT=/tmp/ase-constraint.txt
9594
CIBW_TEST_COMMAND: cd {project}/tests && pytest -v --durations=20 --timeout=600 -n auto
9695

9796
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

0 commit comments

Comments
 (0)