Skip to content

Commit 0bc0466

Browse files
committed
pyscf: cd out of the checkout before the licence check
/work/pyscf still holds pyscf.egg-info from the --no-clean pip wheel build step. python -c puts cwd on sys.path[0], so importlib.metadata resolves that stale egg-info (no licenses/ subdirectory) instead of the installed wheel, and the licence assertion sees an empty set. Move the check after the cd /tmp the later import pyscf smoke test already relies on for the same reason.
1 parent 0584989 commit 0bc0466

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ jobs:
127127
"${PYTHON_BIN}" -m pip install -q --only-binary=:all: /work/wheelhouse/*.whl
128128
"${PYTHON_BIN}" -m pip install -q pytest
129129
130+
# cd out of /work/pyscf first (gotcha 612): the build step's --no-clean
131+
# pip wheel leaves pyscf.egg-info there, and `python -c` puts cwd on
132+
# sys.path[0], so importlib.metadata resolves that stale egg-info instead
133+
# of the installed wheel and the licence check below sees an empty set.
134+
cd /tmp
130135
licences=$("${PYTHON_BIN}" -c "
131136
import importlib.metadata as m
132137
print(sorted(p.name for p in m.files('pyscf') if '.dist-info/licenses/' in str(p)))
@@ -139,7 +144,6 @@ jobs:
139144
assert expected <= names, names
140145
"
141146
142-
cd /tmp
143147
echo 'pbc_tools_pbc_fft_engine = "NUMPY"' > .pyscf_conf.py
144148
echo 'scf_hf_SCF_mute_chkfile = True' >> .pyscf_conf.py
145149
export PYSCF_CONFIG_FILE=/tmp/.pyscf_conf.py

0 commit comments

Comments
 (0)