Skip to content

Conversation

@levje
Copy link
Contributor

@levje levje commented Nov 7, 2024

Quick description

pip install -e . as it is currently implemented seemed to call the implementation of python setup.py develop which 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 running pip 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 the pyproject.toml file falls back to the legacy mechanism of python 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 running pip 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_requires in the setup.py which now seems deprecated. That would make sense since setup_requires=['cython', 'numpy'] didn't specify any versions.

...

Type of change

Check the relevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Provide data, screenshots, command line to test (if relevant)

python -m virtualenv new_venv
source new_venv/bin/activate
pip install git+https://github.com/scilus/scilpy.git # make sure to use this branch to test it.

Checklist

  • My code follows the style guidelines of this project (run autopep8)
  • I added relevant citations to scripts, modules and functions docstrings and descriptions
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I moved all functions from the script file (except the argparser and main) to scilpy modules
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@levje levje changed the title [FIX] pyproject.toml and right build dependencies. [WIP] [FIX] pyproject.toml and right build dependencies. Nov 7, 2024
@pep8speaks
Copy link

pep8speaks commented Nov 7, 2024

Hello @levje, Thank you for updating !

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-11-07 21:59:38 UTC

@levje levje changed the title [WIP] [FIX] pyproject.toml and right build dependencies. [FIX] pyproject.toml and right build dependencies. Nov 7, 2024
@codecov
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.79%. Comparing base (81765a2) to head (4039503).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1048   +/-   ##
=======================================
  Coverage   68.79%   68.79%           
=======================================
  Files         432      432           
  Lines       22454    22454           
  Branches     3041     3041           
=======================================
  Hits        15448    15448           
  Misses       5706     5706           
  Partials     1300     1300           
Components Coverage Δ
Scripts 69.66% <ø> (ø)
Library 67.56% <ø> (ø)

@arnaudbore arnaudbore self-requested a review November 8, 2024 13:38
@arnaudbore arnaudbore merged commit 2443514 into scilus:master Nov 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants