Skip to content
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

Support numpy>=1.17.3 #1204

Merged
merged 1 commit into from
Jun 14, 2022

Conversation

arcondello
Copy link
Member

@arcondello arcondello commented Jun 13, 2022

This makes it easier for packages that depend on dimod to use oldest-supported-numpy.

The issue is when a package specifies say dimod==0.11.0,oldest-supported-numpy in their pyproject.toml, the pip install fails because dimod requires numpy>=1.20.0 at runtime.
E.g. https://app.circleci.com/pipelines/github/dwavesystems/dwave-preprocessing/83/workflows/1bd72543-e11d-463d-a56e-5cdcad38f3c9/jobs/2368

So we loosen the range as much as possible. Unfortunately, the oldest supported numpy for Python 3.7 (1.14.5) is missing some pretty key stuff, like default_rng. So it's not really practical to support it. That means that dwave-preprocessing will need to do something like

    'numpy==1.17.3;python_version<"3.8"',
    'oldest-supported-numpy;python_version>="3.8"',

in its pyproject.toml. At least until we can drop Python 3.7 on June 27 2023.

See also dwavesystems/dwave-ocean-sdk#208

@arcondello arcondello force-pushed the loosen-numpy-requirements branch from fe01f18 to d94ae63 Compare June 13, 2022 22:31
This makes it easier for packages that depend on dimod to use
oldest-supported-numpy.
@arcondello arcondello force-pushed the loosen-numpy-requirements branch from d94ae63 to b43b269 Compare June 13, 2022 22:37
@arcondello arcondello requested a review from randomir June 13, 2022 22:43
Copy link
Member

@randomir randomir left a comment

Choose a reason for hiding this comment

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

LGTM

'numpy>=1.20.0,<2.0.0',
# this is the oldest supported NumPy on Python 3.8, we cannot
# support the oldest for 3.7, 1.14.5
'numpy>=1.17.3,<2.0.0',
Copy link
Member

Choose a reason for hiding this comment

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

I also think we should lift the 2.0 upper bound, but we can discuss that and/or do it in a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree it's a bit pointless, we should probably either lift it altogether or tighten it down to 1.n+2.0. But yeah, followup PR.

@arcondello arcondello merged commit 6f161c0 into dwavesystems:main Jun 14, 2022
@arcondello arcondello deleted the loosen-numpy-requirements branch June 14, 2022 15:44
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.

2 participants