Hello. As part of the spring cleanup for NumPy 2.0 I'm soliciting opinions on the removal of the numpy.f2py.compile() function (documented here (https://link.getmailspring.com/link/937e4c5c-47d5-40d9-89bb-8fc04b19d...@getmailspring.com/0?redirect=https%3A%2F%2Fnumpy.org%2Fdoc%2Fstable%2Ff2py%2Fusage.html%23python-module-numpy-f2py&recipient=bnVtcHktZGlzY3Vzc2lvbkBweXRob24ub3Jn)). The associated issue is gh-25122 (https://link.getmailspring.com/link/937e4c5c-47d5-40d9-89bb-8fc04b19d...@getmailspring.com/1?redirect=https%3A%2F%2Fgithub.com%2Fnumpy%2Fnumpy%2Fissues%2F25122&recipient=bnVtcHktZGlzY3Vzc2lvbkBweXRob24ub3Jn). Here are the main points against it: Hasn't been updated (beyond compatibility) in 18 years
Is a (not great) wrapper around subprocess.run Leaks memory (noted in this test case (https://link.getmailspring.com/link/937e4c5c-47d5-40d9-89bb-8fc04b19d...@getmailspring.com/2?redirect=https%3A%2F%2Fgithub.com%2Fnumpy%2Fnumpy%2Fblob%2F9340fcaeda5aa783a76ab356a58f52b9f76debe3%2Fnumpy%2Ff2py%2Ftests%2Ftest_compile_function.py%23L26&recipient=bnVtcHktZGlzY3Vzc2lvbkBweXRob24ub3Jn)) As for why now.. After the meson transition, the -c workflow is mostly to generate a skeleton Many of the older -c flags are not coming back (since parsing build arguments and forwarding them to meson is basically resurrecting distutils ) It still generates a .so file in the working directory which is weird at best .. and likely to be very broken very often in practice The expectation that -c based builds work exactly the same post meson is not correct, and removing this function would also make downstream users come check the new documentation (https://link.getmailspring.com/link/937e4c5c-47d5-40d9-89bb-8fc04b19d...@getmailspring.com/3?redirect=https%3A%2F%2Fnumpy.org%2Fdevdocs%2Ff2py%2Fusage.html%23building-a-module&recipient=bnVtcHktZGlzY3Vzc2lvbkBweXRob24ub3Jn) Projects should generate their own subprocess.run wrappers for the post meson f2py , so they can set the environment variables to interact with meson or provide native files... All said, it also seems to be mostly (https://link.getmailspring.com/link/937e4c5c-47d5-40d9-89bb-8fc04b19d...@getmailspring.com/4?redirect=https%3A%2F%2Fgithub.com%2Fsearch%3Fq%3Df2py.compile%26type%3Dcode&recipient=bnVtcHktZGlzY3Vzc2lvbkBweXRob24ub3Jn) (but not completely) unused. Happy to hear thoughts against / for this, though the default assumption is going to be remove it :) --- Rohit
_______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: arch...@mail-archive.com