-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MAINT Remove setup.py mentions from documentation and comments #29352
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
I tested and the new command works. It's actually the new default build command since asv 0.6.2 (latest version is 0.6.3). |
I'm ok to remove the alternative compilers section since we're remove setuptools support any time soon and this section was mostly about intel compilers support by setuptools. With other build systems one should use the |
@@ -97,8 +97,6 @@ Tips for performance | |||
|
|||
* Inline methods and function when it makes sense | |||
|
|||
* Make sure your Cython compilation units `use NumPy recent C API <https://github.com/scikit-learn/scikit-learn/blob/62a017efa047e9581ae7df8bbaa62cf4c0544ee4/setup.py#L64-L70>`_. |
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'd be interested to have more details about what we need/don't need to do about that before deciding to completely remove it and forget about it. ping @jjerphan, you seem familiar with this stuff :)
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.
This is now taken care of natively by setup.py
(note that this might need to be ported to meson):
Lines 121 to 128 in 87fa654
# Always use NumPy 1.7 C API for all compiled extensions. | |
# See: https://numpy.org/doc/stable/reference/c-api/deprecations.html | |
DEFINE_MACRO_NUMPY_C_API = ( | |
"NPY_NO_DEPRECATED_API", | |
"NPY_1_7_API_VERSION", | |
) | |
for ext in self.extensions: | |
ext.define_macros.append(DEFINE_MACRO_NUMPY_C_API) |
so this comment can be removed. 👍
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 NPY_NO_DEPRECATED_API
must be defined everywhere especially if NumPy 2 is used as old C APIs might be deprecated.
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.
Thanks, I think this part has not been ported to Meson, which is likely an oversight ... fixing this is probably doable.
Not 100% sure, but my understanding is that using NPY_NO_DEPRECATED_API
+ NPY_1_7_API_VERSION
makes sure that we don't use any Numpy C API that is deprecated in Numpy version 1.7.
@jjerphan but do you have a suggestion about which version we should pick? Is NPY_1_7_API_VERSION
OK? Would using NPY_1_9_API_VERSION
be better, which is what scipy is doing see https://github.com/scipy/scipy/blob/fffcaa8c58b6909d22063c29e4f9593059a40230/scipy/meson.build#L76-L77?
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.
In the meantime I have opened #29357 to do the same thing as what setup.py
was doing.
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 would also pick NPY_1_9_API_VERSION
to be consistent with SciPy's choice. 👍
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.
#29357 has been merged, so I guess this PR can be merged too?
Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
…t-learn#29352) Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
Preparing before removing
setup.py
completely i.e. #29346.Things I am not so sure about:
setup.py
not sure what the use case is to be honest, maybe Intel compilers? I am guessing there is a way to adapt it with Meson, one of them being settingCC
,CFLAGS
, and similar environment variables?NPY_NO_DEPRECATED_API
I certainly did not port this part in Meson, is it actually still needed now that we compile against Numpy 2? Probably more details are available at https://numpy.org/doc/stable/reference/c-api/deprecations.html and https://numpy.org/doc/stable/dev/depending_on_numpy.html. Scipy seems to use it:https://github.com/scipy/scipy/blob/fffcaa8c58b6909d22063c29e4f9593059a40230/scipy/meson.build#L76-L77
asv.conf.json
, I copied what numpy does,not testedtested by Jérémy it seems to work