Skip to content

Conversation

@JuliaPoo
Copy link
Contributor

See #22027. Currently ufunc tutorials use depreciated distutils which is removed in Python 3.12. In addition, I've updated the sample output and fixed a mistake in the last example.

See numpy#22027. Currently ufunc tutorials use depreciated distutils
which is removed in Python 3.12. In addition, I've updated the
sample output and fixed a mistake in the last example.
@mattip
Copy link
Member

mattip commented May 29, 2024

I wonder if we could convert this tutorial (and the others like the cython one to use meson. The extending random examples have a meson.build file, but the documentation is a little sparse. The f2py migration guide is a little better, but could also use some fleshing out.

@rgommers
Copy link
Member

Thanks @JuliaPoo!

I wonder if we could convert this tutorial (and the others like the cython one to use meson.

I think that is a much larger exercise, and best done separately if someone has energy for that. setuptools is still a valid and common way of building extensions against numpy, so no need to get rid of that. Migrating from numpy.distutils to setuptools is a nice improvement in itself, that makes things work on Python 3.12. In an ideal world, we'd have examples for all the popular build backends (at least meson-python, scikit-build-core and setuptools) everywhere - but that's quite a bit of work.

Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, great to have documentation that actually works! And thanks for going through it carefully and ensuring the outputs are actually correct, etc.

Also indeed fine to just use setuptools for these examples - others can be added later if need be.

All my comments are nitpicks, of the "please align" and "please combine lines" type.

@JuliaPoo
Copy link
Contributor Author

Okie I've modified the PR to these comments

Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks! Looks all OK now, so let's get this in.

@mhvk mhvk merged commit 98e86d5 into numpy:main May 30, 2024
@rgommers rgommers added the 09 - Backport-Candidate PRs tagged should be backported label May 30, 2024
@rgommers rgommers added this to the 2.1.0 release milestone May 30, 2024
charris added a commit to charris/numpy that referenced this pull request Jun 1, 2024
Backports of numpy#26504, numpy#26517, and numpy#26566.

[skip azp] [skip azure] [skip cirrus]

commit e9fca3ee60006969d0e2c18b9e04f6a0fe6f6bc8
Author: Jules <57632293+JuliaPoo@users.noreply.github.com>
Date:   Thu May 30 20:27:28 2024 +0800

    DOC: update ufunc tutorials to use setuptools (numpy#26566)

    * DOC: update ufunc tutorials to use setuptools

    See numpy#22027. Currently ufunc tutorials use depreciated distutils
    which is removed in Python 3.12. In addition, I've updated the
    sample output and fixed a mistake in the last example.

commit 04cb2596fbce4a12dc88c3200b8940764c1d1711
Author: Mateusz Sokół <mat646@gmail.com>
Date:   Fri May 24 11:12:38 2024 +0200

    Add np.alltrue to migration guide [skip actions] [skip azp] [skip cirrus]

commit d05bce7388b96aaf8a3ac557228ea8cfb13daffe
Author: warren <warren.weckesser@gmail.com>
Date:   Wed May 22 14:31:45 2024 -0400

    DOC: Copy-edit numpy 2.0 migration guide.

    Fix a few typos and do a touch of copy-editing.

    [skip actions] [skip azp] [skip cirrus]
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jun 1, 2024
@rgommers rgommers added the 09 - Backport-Candidate PRs tagged should be backported label Jun 10, 2024
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jun 10, 2024
@charris
Copy link
Member

charris commented Jun 10, 2024

@rgommers already backported.

@rgommers
Copy link
Member

oops sorry, I missed that. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants