-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Adopt PEP518 and PEP631 #217
Open
jhlegarreta
wants to merge
1
commit into
SlicerDMRI:master
Choose a base branch
from
jhlegarreta:TransitionToPyprojectToml
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
ENH: Adopt PEP518 and PEP631 #217
jhlegarreta
wants to merge
1
commit into
SlicerDMRI:master
from
jhlegarreta:TransitionToPyprojectToml
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jhlegarreta
force-pushed
the
TransitionToPyprojectToml
branch
30 times, most recently
from
December 8, 2023 20:04
080d138
to
7861abb
Compare
jhlegarreta
force-pushed
the
TransitionToPyprojectToml
branch
8 times, most recently
from
December 8, 2023 22:36
87f5216
to
ee2c12c
Compare
Adopt PEP518 to specify minimum build system requirements for the package. Partially comply with PEP631: - Dependencies are now stored in the `pyproject.toml` file, including packages that are not in PyPI (e.g. source code URLs -GitHub, etc.), so the related requirements file is removed. Require `setuptools >= 66` so that the package can be effectively installed in editable mode when using the minimum required version of it. Avoids: ``` ERROR: Project file:///home/runner/work/whitematteranalysis/whitematteranalysis has a 'pyproject.toml' and its build backend is missing the 'build_editable' hook. Since it does not have a 'setup.py' nor a 'setup.cfg', it cannot be installed in editable mode. Consider using a build backend that supports PEP 660. ``` Require `nibabel > 3.0.0` to avoid: ``` File "bin/wm_cluster_volumetric_measurements.py", line 7, in <module> import nibabel as nib File "python3.10/site-packages/nibabel/__init__.py", line 66, in <module> (...) AttributeError: module 'numpy' has no attribute 'float'. `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'? ``` Require `"scipy >= 1.7.0` for `python_version == '3.9'` to avoid: ``` whitematteranalysis/cluster.py:14: in <module> import scipy.cluster.hierarchy (...) python3.9/site-packages/scipy/special/orthogonal.py:79: in <module> from numpy import (exp, inf, pi, sqrt, floor, sin, cos, around, int, E ImportError: cannot import name 'int' from 'numpy' (python3.9/site-packages/numpy/__init__.py) ``` Require `statsmodels >= 0.14.0` to avoid: ``` ModuleNotFoundError: No module named 'statsmodels' ``` when using the minimum required version builds. Require `vtk>=9.2.2` for `python_version == '3.9'` to avoid: ``` import vtk ModuleNotFoundError: No module named 'vtk' ``` Require `vtk>=9.2.2` for `python_version >= '3.10'` to avoid: ``` ERROR: Could not find a version that satisfies the requirement vtk==9.2.0 (from versions: 9.2.2, 9.2.4, 9.2.5, 9.2.6, 9.3.0rc1, 9.3.0rc2, 9.3.0, 9.3.20230807rc0) ERROR: No matching distribution found for vtk==9.2.0 ``` and `vtk>=9.2.4` for Python 3.11 to avoid: ``` File "whitematteranalysis/cluster.py", line 16, in <module> import vtk ModuleNotFoundError: No module named 'vtk' ``` List `importlib-resources` as a dependency explicitly to avoid Python 3.9 not finding the package. Use `float` instad of `np.float` in `tract_measurement.py`. Fixes: ``` AttributeError: module 'numpy' has no attribute 'float'. `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here. ``` Adapt the Sphinx documentation config file to read the necessary metadata from the `pyproject.toml` file. Add the `tomli` package to the documentation dependencies so that `readthedocs` can successfully find it. Prepend the module location to the script testing `script_runner.run` calls. Adopt `tox.ini` for testing automation and standardization. Adapt the GitHub Actions workflow accordingly Do not use the `--doctest-modules` for now to avoid: ``` _____________________ ERROR collecting docs/source/conf.py _____________________ E FileNotFoundError: [Errno 2] No such file or directory: '../../pyproject.toml' ``` Documentation: https://www.python.org/dev/peps/pep-0518/ https://www.python.org/dev/peps/pep-0631/
jhlegarreta
force-pushed
the
TransitionToPyprojectToml
branch
from
December 13, 2023 22:39
ee2c12c
to
8408d06
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adopt PEP518 to specify minimum build system requirements for the
package.
Partially comply with PEP631:
pyproject.toml
file, includingpackages that are not in PyPI (e.g. source code URLs -GitHub, etc.),
so the related requirements file is removed.
Require
setuptools >= 66
so that the package can be effectivelyinstalled in editable mode when using the minimum required version of
it. Avoids:
Require
nibabel > 3.0.0
to avoid:Require
"scipy >= 1.7.0
forpython_version == '3.9'
to avoid:Require
statsmodels >= 0.14.0
to avoid:when using the minimum required version builds.
Require
vtk>=9.2.2
forpython_version == '3.9'
to avoid:Require
vtk>=9.2.2
forpython_version >= '3.10'
to avoid:and
vtk>=9.2.4
for Python 3.11 to avoid:List
importlib-resources
as a dependency explicitly to avoid Python3.9 not finding the package.
Use
float
instad ofnp.float
intract_measurement.py
. Fixes:Adapt the Sphinx documentation config file to read the necessary
metadata from the
pyproject.toml
file.Add the
tomli
package to the documentation dependencies so thatreadthedocs
can successfully find it.Prepend the module location to the script testing
script_runner.run
calls.
Adopt
tox.ini
for testing automation and standardization.Adapt the GitHub Actions workflow accordingly
Do not use the
--doctest-modules
for now to avoid:Documentation:
https://www.python.org/dev/peps/pep-0518/
https://www.python.org/dev/peps/pep-0631/