setup.pyimportsfrom ivpm.setup import setup— this couples the build to the fullivpmruntime package.ivpm-buildwas extracted specifically to break this dependency.- CI uses the deprecated
setup.py bdist_wheelinvocation. Modern pip/setuptools emits warnings and will eventually drop support. - The Windows CI job is commented out and broken.
- There is no
[build-system]table inpyproject.toml(none exists), so pip falls back to legacy build isolation with unpredictable behaviour. setup_requires=['cython', 'ivpm']pulls in the heavyivpmpackage at build time just to getivpm.setup.setup.
This project uses Path 1 (single import swap) with one minor addition: also
add ivpm-build to the build-system requirements.
Create pyproject.toml with a [build-system] table:
[build-system]
requires = [
"setuptools>=64",
"wheel",
"cython",
"ivpm-build",
"ivpm", # still needed at build time for PkgInfoRgy queries
]
build-backend = "setuptools.build_meta"Change one line in setup.py:
# Before
from ivpm.setup import setup
# After
from ivpm_build.setup import setupUpdate setup_requires to match [build-system].requires
(remove the redundancy or drop setup_requires entirely — it is ignored
when a [build-system] table is present):
# Remove or keep for legacy pip compatibility:
setup_requires = ['cython', 'ivpm-build', 'ivpm']pip install ivpm-build
python -m build --wheel --no-isolation # dry-run with local depsOld (all three jobs):
- name: Build Python wheels
run: |
for py in cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312; do
/opt/python/${py}/bin/python setup.py bdist_wheel
doneNew:
- name: Build Python wheels
run: |
for py in cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312; do
/opt/python/${py}/bin/python -m pip install build
/opt/python/${py}/bin/python -m build --wheel --no-isolation
done--no-isolation is correct here because the manylinux job already
pre-installs all build deps in the loop above.
In every job's "Install additional build dependencies" / "Install Packages" step,
add ivpm-build alongside ivpm:
# Linux manylinux loop:
/opt/python/${py}/bin/python -m pip install ninja wheel cython setuptools ivpm ivpm-build
# macOS / Windows single-python:
python -m pip install ivpm ivpm-build twine cython ninja wheel cmakeThe Windows job is commented out. Issues to fix before re-enabling:
| Issue | Fix |
|---|---|
cmake .. -GNinja may fail without explicit Ninja path |
Add ninja to PATH via pip install ninja (already done) |
setup.py bdist_wheel → replace with python -m build --wheel --no-isolation |
See 3a |
DLL install path: pssparser.dll must land in build/lib/ |
Already fixed in CMake (CMAKE_INSTALL_BINDIR=lib), verify |
auditwheel not available on Windows |
Remove auditwheel step from Windows job |
Uncomment the ci-win32 job once the above are confirmed working locally.
The current logic is fragile:
for whl in dist/*.whl; do
[ -f "$whl" ] || break # BUG: should be 'continue', not 'break'
...Fix the guard:
for whl in dist/*.whl; do
[ -f "$whl" ] || continue
/opt/python/cp39-cp39/bin/auditwheel repair "$whl"
rm "$whl"
doneThe CI has no Python unit-test step. Add after wheel build:
- name: Run Python tests
run: |
/opt/python/cp312-cp312/bin/python -m pip install pytest dist/*cp312*.whl
/opt/python/cp312-cp312/bin/python -m pytest tests/python -v --tb=short- Create
pyproject.toml(Step 1) - One-line
setup.pychange (Step 2) - Update CI: fix
bdist_wheel→python -m build, addivpm-build, fix auditwheel guard (Steps 3a–3d) - Add Python test step to CI (Step 3e)
- Verify CI passes on Linux and macOS
- Re-enable Windows job (Step 3c)
ivpmstill needed at build time:PkgInfoRgyqueries insetup.py(viaivpm_extdep_pkgs) still requireivpmat build time. This can be eliminated in a later step by switching to Path 3 (purepyproject.toml+[tool.ivpm-build]), but that requires more invasive changes.- Windows CI: Leave commented out until Linux/macOS are confirmed green; then address DLL path issues separately.
setup.py bdist_wheeldeprecation warning: Replacing withpython -m buildis sufficient; no change to thesetup.pycontent is needed.