You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was considering moving parts of setup.py and setup.cfg to pyproject.toml. As I understand it, it is possible to mix and match, so whatever can be moved (I can move) will cooperate with what is left.
Since we have a setup.py with a bit of magic in it, I do no expect that I will be able to completely transition, but is it worthwhile even starting? Or do we expect that moving away from setup.py (which I guess should be the long term goal) requires more or less rewriting everything anyway, possibly changing packaging tool etc?
I am in favour of this. The pybind11 work becomes much simpler if we at least replace setup_requires in setup.py with [build-system] in pyproject.toml. I was going to talk about it tomorrow's call.
I gave it a quick try to just move over the more basic things and got stuck in that setupext could not be imported from setup.py anymore. I take it that it executes from another directory or something so that it does not find setupext.py.
Copying the contents doesn't seem like the best way to solve it...
A temporary environment is used to build a wheel which is then installed into your working environment. The temporary environment doesn't seem to have access to the full project directory.
I've seen some problems with numpy versions. My guess is that using pyproject.toml somehow uses a different version of NumPy headers than possibly installed. For example, when installing using 1.22 installed I got an error about not matching API versions, which I didn't get with a plain setup.py install, while upgrading to 1.23 (and reinstalling, so not completely sure) I didn't. Seen similar problems with another package with a much simpler install procedure as well.
Note that in both cases, the actual compilation happened in setup.py, so moving all the way may be a solution.
Activity
ianthomas23 commentedon Sep 7, 2022
I am in favour of this. The
pybind11work becomes much simpler if we at least replacesetup_requiresinsetup.pywith[build-system]inpyproject.toml. I was going to talk about it tomorrow's call.FWIW Bokeh has just made this transition.
oscargus commentedon Sep 7, 2022
I gave it a quick try to just move over the more basic things and got stuck in that
setupextcould not be imported fromsetup.pyanymore. I take it that it executes from another directory or something so that it does not findsetupext.py.Copying the contents doesn't seem like the best way to solve it...
ianthomas23 commentedon Sep 7, 2022
A temporary environment is used to build a wheel which is then installed into your working environment. The temporary environment doesn't seem to have access to the full project directory.
I have had success with:
Removing the
setup_requiressection fromsetup.pyNew
pyproject.tomlcontainingsetup.pyjust beforeimport setupext:so basically botching the
sys.pathso that it can findsetupext.py.oscargus commentedon Sep 12, 2022
I've seen some problems with numpy versions. My guess is that using pyproject.toml somehow uses a different version of NumPy headers than possibly installed. For example, when installing using 1.22 installed I got an error about not matching API versions, which I didn't get with a plain setup.py install, while upgrading to 1.23 (and reinstalling, so not completely sure) I didn't. Seen similar problems with another package with a much simpler install procedure as well.
Note that in both cases, the actual compilation happened in setup.py, so moving all the way may be a solution.
tacaswell commentedon Sep 12, 2022
@oscargus See https://github.com/matplotlib/matplotlib/pull/23829/files#r968896893 for the numpy API version issue.
QuLogic commentedon Sep 24, 2024
This was completed as part of the Meson port in #26621.