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

Is pin_compatible("numpy") still the recommended way of dealing with numpy after introduction of the new backwards compatiple C-API? #2037

Open
maxnoe opened this issue Nov 29, 2023 · 6 comments
Labels

Comments

@maxnoe
Copy link

maxnoe commented Nov 29, 2023

Your question:

Numpy 1.25 introduced a backwards compatible C-API with a definable minimum supported numpy version.

For a project defining -DNPY_TARGET_VERSION NPY_1_21_API_VERSION one could thus I think do:

requirements:
    build:
        - numpy >=1.25 # 1.25 needed for backwards-compatible C-API
    host:
        - numpy >=1.25 # 1.25 needed for backwards-compatible C-API
    run:
        - numpy >=1.21 # But result will be compatible with all version larger than NPY_TARGET_VERSION

Given this new mechanism, is {{ pin_compatible("numpy") }} still the way to go?

If not, we should update the knowledge base section on numpy.

@hmaarrfk
Copy link
Contributor

I think for now we are still using the "old way".

Note that conda-forge today targets numpy 1.22+

The discussions:
#1997
conda-forge/conda-forge-pinning-feedstock#4816

are helpful to build context

@h-vetinari
Copy link
Member

Yeah, pin_compatible is not really ideal for numpy, unless one uses explicit arguments for lower & upper bounds. The lower bound corresponds to NPY_TARGET_VERSION, and the upper bound generally corresponds to 1.{N+3}. I think the latter scheme will continue also after numpy 2.0

@carterbox
Copy link
Member

carterbox commented Dec 4, 2023

I thought that the numpy feedstock defines its own run_exports now, so downstream recipes needn't do any pinning. i.e. It's the numpy feedstock maintainers who are responsible for pinnings.

@h-vetinari
Copy link
Member

Yes, we'll actually remove the pin_compatible("numpy") usage in the context of #1997.

@jakirkham
Copy link
Member

Looking at using a piggyback migrator to start making this change: regro/cf-scripts#2469

Though maintainers are welcome to start working on this sooner 🙂

@jakirkham
Copy link
Member

Also we are planning to drop this from the docs

xref: #2156

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

No branches or pull requests

5 participants