Closed cclauss closed 5 months ago
The pyroject.toml has a build section, so it should be a matter of pip install build; python -m build .; python -m pip install dist/*.whl
, or something along those lines.
Or maybe just python -m pip install .
(note the .
)
Agreed... I was worried about how to handle three of the failing tests that do:
'setup.py', f'--hpy-abi={hpy_abi}', 'install'
I think you should be able to use python -m pip install . --config-settings="--hpy-api={hpy_abi}"
?
I think you need python -m pip install . --global-option="--hpy-abi={hpy_abi}"
but that is also deprecated.
--config-settings
does not seem to be passed through to the setup function currently: https://github.com/pypa/setuptools/issues/2491
To avoid this deprecation, Pillow uses a custom build backend wrapping setuptools (https://github.com/python-pillow/Pillow/pull/7171) and I've created https://github.com/python-pillow/Pillow/pull/7658 to fix some issues with that.
If there is no solution that isn't deprecated, I'm not sure we can do better than what we do now.
A problem is that Mac users are quite diligent about updating macOS and #472 demonstrates that installation tests fails on macOS 12, 13, and 14.
@cclauss You're quoting documentation about what pip would like to have happen, but I don't see a solution being offered. We can't not pass the information about which ABI to build for.
The pyroject.toml has a build section, so it should be a matter of
pip install build; python -m build .; python -m pip install dist/*.whl
, or something along those lines.
This doesn't work the last time I tried it. Build/setuptools will complain that the project script contains absolute paths (for the helper source files), and refuse to build. See my issue at #435 for related discussion.
Using python -m build
worked locally for me
We can't not pass the information about which ABI to build for.
We could use an environment variable
Correction: using python -m build
works for the hpy build itself, I did not try using hpy in a test package.
An environment variable might help. I tried that with pip awhile ago and the environment variable wasn't passed into the isolated build, but perhaps we can do the build with python -m build
and then pip install the generated wheels.
If others agree and someone wants to do this, we could try rewrite the tests in test/hpy_devel/test_distutils.py
to build with python -m build
where python setup.py
was used before.
we could try rewrite the tests...
https://github.com/hpyproject/hpy/pull/472/files#diff-8ca48d70aa8abbf3dec9764a6d23dc3d0879df302dd383d795011b487be2b898 was an attempt to do that but I think I am in over my head.
https://packaging.python.org/en/latest/discussions/setup-py-deprecated
From the test errors in #472 on macOS 12 and later.
----------------------------- Captured stderr call ----------------------------- /Users/runner/work/hpy/hpy/.tmpdir/popen-gw0/test_hpymod_legacy_cpython_0/venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !!
!! self.initialize_options() /Users/runner/work/hpy/hpy/.tmpdir/popen-gw0/test_hpymod_legacy_cpython_0/venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated. !!