-
Notifications
You must be signed in to change notification settings - Fork 30
Transition to pyproject.toml; pin numpy > 2 #27
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
base: master
Are you sure you want to change the base?
Conversation
…mp venv as specced by PEP517
…e imports in setup.py
…n extra file in the repository; remove MANIFEST.in
…d testing, remove uneeded dependencies; pin numpy to >2 everywhere
|
Thanks @austin2118ace. I figured at one point I should modernize my Since the previous version on conda-forge only supported Python ≤3.10, I finally released v0.2.1 on PyPI and conda-forge a few days ago. For conda-forge, it built successfully on Linux, macOS, and Windows using Python 3.9–3.13. I’m curious if pinning NumPy to >=2 would interfere with this build. What OS and installation process did you use that caused issues? Did you clone the repo and compile from source? With your changes, would the "Compile from source" section in the README now simply look like this? |
|
I was building using 3.10 I believe, but using numpy > 2 passed all the Github CI build tests using my files. TBH, it was a while ago and this upgrade was a adhd-fueled on-a-whim project, so I don't remember exactly what our issue was. All I am certain of is that importing oasis when numpy>2 was causing an import error (wasn't just a warning) due to some mismatches in expected variable size I think. I fairly certain we were using the version on conda to avoid the hassle of compiling the extension. Wish I had better info for you unfortunately. However, Yes!
I'm sure there are plenty of other ways, but your recommendation is likely the simplest. |
|
@j-friedrich Hi! Just checking in to make sure you saw my last comment. Cheers :) |
|
Hey @j-friedrich, I just wanted to confirm for you that oasis builds fine for me using numpy > 2 and python 3.11 using pip. Hope all is well! |
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.
Pull Request Overview
This PR migrates project configuration from setup.py/setup.cfg to pyproject.toml and pins numpy to versions greater than 2 to ensure compatibility with newer numpy releases.
- Removed external requirements from test_requirements.txt and setup.cfg.
- Simplified setup.py by eliminating dependency and metadata handling in favor of centralized configuration in pyproject.toml.
- Introduced pyproject.toml with updated project metadata and dependency definitions.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test_requirements.txt | Removed test dependency declarations now managed elsewhere. |
| setup.py | Simplified configuration; package name changed from 'oasis' to 'oasis.oasis_methods'. |
| setup.cfg | Removed since metadata is now in pyproject.toml. |
| pyproject.toml | New file centralizing project metadata with pinned dependencies. |
Comments suppressed due to low confidence (1)
setup.py:16
- The package name in setup.py ('oasis.oasis_methods') does not match the project name in pyproject.toml ('oasis-deconv'). Consider aligning the package naming to maintain consistency in distribution and installation.
setup(name='oasis.oasis_methods',
I ran into an issue integrating oasis into our processing pipeline as we use
numpy > 2. This caused issues when importing oasis as thePyPaoasis wheels were built againstnumpy < 2To approach automatic wheel building for our use case, and to make the package compliant with PEP 518 and PEP 621, I moved most of the information out of
setup.pyintopyproject.yaml. I also pinnednumpy > 2so the wheels will be built against the newest headers and make oasis compatible with newer code.setup.pyis still required for building the extension, as thepyproject.tomlspec only has experimental support for building extensions, and I didn't want to stray too far from the known working build environment.An additional note is that
cvxpy==1.6typically gets pulled during the install. This generates some warning messages about depreciated syntax as of version <1.1, but the code still appears to work as intended.All Github CI builds succeed, and my local runs of the provided test code succeed without issue. I am able to build the package using PyPa
buildand Astral'suv buildboth of which invokesetuptools. The resultant wheel then is installable with no errors and oasis can be imported successfully.Using
pip install -e .(which automatically builds extensions) succeeds. Further, manually building withpython setup.py build_ext -iand then runningpip install .also works.I figured I would share these changes with you in case you were interested in applying them to the main repository.
Cheers!
Austin
Dewan Lab
Florida State University