-
Notifications
You must be signed in to change notification settings - Fork 145
Remove setup.py information from info.py #551
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
Conversation
Shift away from info.py as source of setup information.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #551 +/- ##
==========================================
- Coverage 84.71% 84.69% -0.02%
==========================================
Files 297 297
Lines 27632 27592 -40
Branches 3361 3361
==========================================
- Hits 23409 23370 -39
+ Misses 3269 3268 -1
Partials 954 954
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some quick notes. Nothing blocking.
pyproject.toml
Outdated
build = [ | ||
'meson-python>=0.13', | ||
'wheel', | ||
'setuptools>=67', | ||
'ninja', | ||
'Cython>=3', | ||
'numpy>=1.22', | ||
'spin==0.3', | ||
'build', | ||
] | ||
default = [ | ||
'numpy>=1.22', | ||
'scipy>=1.8', | ||
'nibabel>=3.2', | ||
'sympy>=1.9', | ||
'transforms3d' | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO build and default don't make much sense. nipy[default]
is equivalent to nipy
and now you have duplication.
I'm not sure what nipy[build]
is adding, since to install it you will already need something capable of building, while also duplicating (and extending?) the build-system.requires
table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefanv - any thoughts? I copied this brainlessly from scikit-image: https://github.com/scikit-image/scikit-image/blob/main/pyproject.toml#L46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefanv - any reason not to just delete the build
and default
sections of the optional-dependencies
?
[build-system] | ||
build-backend = "mesonpy" | ||
requires = [ | ||
"meson-python>=0.13", | ||
"ninja", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm able to build without this. Is ninja
a dependency of meson-python
that you just want to be explicit about? Do you actually depend on ninja-specifics, or could the other build tools stop using it without you needing to change anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was getting errors trying to build without it, for the wheel builds. I'm afraid I don't understand the build mechanics well enough to respond. If ninja is missing, with meson-python use something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are you building? I'm using python -m build
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip wheel
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Possibly an old pip? I just created a fresh environment:
$ mamba create -n tmp python=3.11
$ mamba activate tmp
$ pip wheel .
Processing /home/chris/Projects/nipy/nipy
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: nipy
Building wheel for nipy (pyproject.toml) ... done
Created wheel for nipy: filename=nipy-0.5.1.dev1-cp311-cp311-linux_x86_64.whl size=1916097 sha256=7ff5b2a9a9fe053c913dd2e487ee8c8fd11991893cf96e0f806846c79d17cd8b
Stored in directory: /tmp/pip-ephem-wheel-cache-sn4mrur1/wheels/a1/58/f7/1af5aca9b8327defaf19028fc61c6f4850bd54b33e92f89a43
Successfully built nipy
$ pip --version
pip 23.3.1 from /home/chris/mambaforge/envs/tmp/lib/python3.11/site-packages/pip (python 3.11)
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
This reverts commit ee349e8, and adds some comments.
I'm curious why dropping ninja works. You need to get it into your environment somehow, and it is not installed as a dependency of meson or meson-python. |
I just verified that, if ninja is not presence, it will fail on a build. It can be confusing to test, because if ninja is already on the PATH (from a different venv), it will still be picked up and used. To see that in action, clone https://github.com/stefanv/test-ninja-missing-compile-failure and run |
I don't have ninja installed in my path, and using $ pipx run build
[...]
Build targets in project: 16
nipy 0.5.1.dev1
User defined options
Native files: /tmp/build-via-sdist-48bra0w8/nipy-0.5.1.dev1/.mesonpy-x0vcp63g/meson-python-native-file.ini
buildtype : release
b_ndebug : if-release
b_vscrt : md
Found ninja-1.11.1.git.kitware.jobserver-1 at /tmp/build-env-bge1hi3c/bin/ninja So it does seem to be getting pulled in somewhere. I don't know how right now... |
Hmm. Missed an important bit: $ pipx run build
* Creating venv isolated environment...
* Installing packages in isolated environment... (cython>=3, meson-python>=0.13, numpy==1.22; python_version >= '3.7' and python_version < '3.9', numpy>=1.25; python_version > '3.8', setuptools)
* Getting build dependencies for sdist...
* Installing packages in isolated environment... (ninja >= 1.8.2) I would guess meson is injecting it. Edit: https://github.com/mesonbuild/meson-python/blob/551962d/mesonpy/__init__.py#L993-L1000 |
I can confirm that |
Sounds like it would be safer to add it back, no? |
Sure, why not. |
OK, so it looks like you get ninja pulled in when building via |
No, I think skimage may have done the same. We used to use it to generate requirements, but those are now picked up from the correct locations in the file. |
Thanks Stefan. Chris - does this look right to you now? |
Yup, that all looks fine to me. |
Shift away from info.py as source of setup information.