Skip to content

BLD: require numpy>=2.0.0rc1 at compile time - #144

Merged
astrofrog merged 1 commit into
liberfa:mainfrom
neutrinoceros:bld/build_metadata
Apr 5, 2024
Merged

BLD: require numpy>=2.0.0rc1 at compile time#144
astrofrog merged 1 commit into
liberfa:mainfrom
neutrinoceros:bld/build_metadata

Conversation

@neutrinoceros

Copy link
Copy Markdown
Contributor

As discussed in #143

This isn't just for the sake of following guidelines: it's actually helpful to anyone that would build pyerfa from source and would like to easily switch back and forth between versions of numpy, which, if we can't have pre-built wheels for macOS AMD (see #143 (comment)), includes me 😅

Comment thread setup.cfg Outdated
tests_require = pytest-doctestplus
setup_requires = setuptools_scm
install_requires = numpy>=1.19
install_requires = numpy>=2.0.0rc1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this line seems entirely redundant with pyproject.toml, however, it's been a while since I actually used setup.cfg so I'm only 99% confident. If that's desired, I'm game to pull the band aid and merge those two files together (which is essentially automated with the right tooling)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's do that in a separate PR...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Of course

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We don't want to pin numpy>2.0rc1 in install_requires - this is for runtime dependencies!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(this is different from setup_requires which is the old way of specifying build-time dependencies)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh my you're right. I meant to touch the previous line and didn't realize my mistake in review... will fix !

@neutrinoceros

Copy link
Copy Markdown
Contributor Author

I'm not convinced that failures are related. I'll try to refresh this later today and see if it's reproducible

@neutrinoceros
neutrinoceros marked this pull request as ready for review April 2, 2024 09:56

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I should have gotten this PR in before trying to put out a new pyerfa version. I had not realized our wheel building was dependent on what exactly was going on - pretty bad form really.

I still find the whole pip description of building things excruciating, but to be honest cannot quite care enough any more to try to make sense of it. If this works to get the right wheels on pypi, then let's just roll with it.

Comment thread setup.cfg Outdated
tests_require = pytest-doctestplus
setup_requires = setuptools_scm
install_requires = numpy>=1.19
install_requires = numpy>=2.0.0rc1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's do that in a separate PR...

Comment thread setup.py Outdated
include_dirs = []
libraries = []
define_macros = []
define_macros = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why this change? It seems reasonable, but perhaps good to add why it is even needed?

Comment thread setup.cfg Outdated
# We set packages to find: to automatically find all sub-packages
packages = find:
requires = numpy
requires = numpy>=1.19.3 # keep in sync with NPY_TARGET_VERSION (setup.py)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think requires is recommended anymore

@astrofrog

Copy link
Copy Markdown
Contributor

I think this PR would be fine if we remove requires and update install_requires to specify the minimum runtime dependency of numpy. @neutrinoceros - if you can make those updates, I'm happy to review tomorrow and see if we can cut another PyERFA release as @mhvk is away.

@neutrinoceros

neutrinoceros commented Apr 5, 2024

Copy link
Copy Markdown
Contributor Author

I just dropped the second commit as it was never necessary for this PR and actually broken (thanks @astrofrog for pointing it out). Now this PR should be minimal and will hopefully resolve the situation at astropy on release.
I'll set out to remove setup.cfg in another PR once we're out of trouble.

@neutrinoceros neutrinoceros changed the title BLD: move build metadata to pyproject.toml BLD: require numpy>=2.0.0rc1 at compile time Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants