[FIX] pyproject.toml and right build dependencies. #1048
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Quick description
pip install -e .as it is currently implemented seemed to call the implementation ofpython setup.py developwhich is now deprecated will be removed/enforced in pip 25.0 and onwards. As suggested by the deprecation message, the creation of a basic pyproject.toml can fix the deprecation warning. When runningpip install -e .the file will be detected and the modern building mechanism will be used when installing the project. From what I read, it seems that not having thepyproject.tomlfile falls back to the legacy mechanism ofpython setup.py develop.Also, while I was exploring the deprecation fix, I encountered some issue that occurred when installing scilpy from HTTPS/SSH. I found that the issue was related to the specific version of Cython/numpy/packaging that was used in the sandbox environment that is used by pip when building the project. Prior to this PR, to fix that building issue, we would have to manually download
pip install numpy==1.25.* Cython==3.0.* packaging==23.2.*before actually runningpip install git+https://github.com/scilus/scilpy.git, this way, it somehow made sure that the sandbox environment used for building used the right versions of these packages.Now, I also specified the Cython/numpy/packaging with their respective versions that were required to properly build and "cythonize" the code, and now it's working fine! The dependencies in the pyproject.toml are the new equivalent of
setup_requiresin the setup.py which now seems deprecated. That would make sense sincesetup_requires=['cython', 'numpy']didn't specify any versions....
Type of change
Check the relevant options.
Provide data, screenshots, command line to test (if relevant)
Checklist