-
Notifications
You must be signed in to change notification settings - Fork 35
Use setuptools instead of distutils #100
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
Merged
+48
−45
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ac7d735
Use setuptools instead of distutils
oscarbenjamin 9958bfe
Add Python 3.12 to the wheel build matrix
oscarbenjamin 7b8dba9
Install setuptools in CI
oscarbenjamin 621531e
Install setuptools in CI
oscarbenjamin 17852e7
Don't unstall from PyPI when testing in CI
oscarbenjamin 3b6b11e
Add 3.12 to the Cirrus build matrix
oscarbenjamin bc63dfd
Update cibuildwheel version
oscarbenjamin 211aba0
Fix use of private Fraction methods for 3.12
oscarbenjamin 3d162df
Only build wheels for 3.12
oscarbenjamin 1e77473
Build for all Python versions in CI
oscarbenjamin c343f39
Use version checks for setuptools in setup.py
oscarbenjamin 27d4b54
Install numpy and fix up CI testing for source builds
oscarbenjamin 159426b
Change name of pip CI job
oscarbenjamin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
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.
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.
@deinst presumably something better needs to go here but I'm not sure what. I think that you said you worked out some code for this...
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.
Ive spent a bit of time rummaging about in the numpy.distutils code to see what it does to fill the default_*_dirs variables. The above works for me, but that is because I keep my flint in a non standard place and need to supply the directory to setup.py.
On the unix/osx side, this is easy, just make a list of the usual suspects, and filter out the ones that don't exist. On the windows side things are more complicated and I'm working on figuring out what is needed.
I believe you still need get
config_varsfor the python dirs, but you can get it fromsysconfiginstead ofdistutils.sysconfigThere 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.
In the version of setup.py on master this is only used to set the
OPTenvironment variable:python-flint/setup.py
Lines 38 to 39 in 2fd4fd6
What uses that environment variable?
The value I have locally on Linux is:
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.
As I understand it
OPTsupplies default options to gcc. All setup.py does is removes-Wstrict-prototypesfrom it. Considering the number of compiler warnings already generated, it seems that filtering out-Wstrict_prototypesis probably not particularly helpful.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.
With Python 3.12 I have:
Either way there does not seem to be any
-Wstrict-prototypes.Probably that can be removed but I'll leave it there for now while getting the main problems fixed.
I think I might have get the setup.py working for all Python version or OS combinations. Fingers crossed that the Windows build is about to succeed in CI...
The only thing currently missing is
default_include_dirsanddefault_lib_dirsbut I'm not sure why we should need to get those anyway. I would have thought that it was setuptools job to handle the default dirs.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.
If setuptools can get the directories correctly that is great. If not, I think I have gotten the requisite code from numpy.distutils.system_info to generate the default paths. I have only a foggy notion of exactly what the windows code is doing as things like
vcpkgare inovations that postdate my working on code for windows.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 think let's get this PR in for now because it at least means we have CI built wheels for 3.12 and that building a development checkout for 3.12 now works.
We can follow up with another PR for generating the paths. I don't know whether there is actually a reason for doing something other than just trusting setuptools to do it for us though.
Longer term if we can move to meson and meson-python then they should take care of default paths and library discovery etc so in principle it should not be a concern for us.