Skip to main content

Meta-package that provides the oldest Numpy for given Python version and platform

Project description

PyPI

About

This is a meta-package which can be used in pyproject.toml files to automatically provide as a build-time dependency the oldest version of Numpy that supports the given Python version and platform. In case of platforms for which Numpy has prebuilt wheels, the provided version also has a prebuilt Numpy wheel.

The reason to use the oldest available Numpy version as a build-time dependency is because of ABI compatibility. Binaries compiled with old Numpy versions are binary compatible with newer Numpy versions, but not vice versa. This meta-package exists to make dealing with this more convenient, without having to duplicate the same list manually in all packages requiring it.

In other words:

[build-system]
requires = [
    "wheel",
    "setuptools",
    "numpy==1.13.3; python_version=='3.5',
    "numpy==1.13.3; python_version=='3.6',
    "numpy==1.14.5; python_version=='3.7',
    "numpy==1.17.3; python_version>='3.8'
]

can be replaced by:

[build-system]
requires = ["wheel", "setuptools", "oldest-supported-numpy"]

And as new Python versions are released, the pyproject.toml file does not need to be updated.

Q&A

Why define the Numpy pinnings using install_requires in this repository?

The Numpy version pinnings are defined inside the setup.cfg file as install_requires dependencies, rather than as build-time dependencies inside pyproject.toml. This is deliberate, since Numpy is not actually required to build wheels of oldest-supported-numpy. What we need here is to make sure that when oldest-supported-numpy is installed into the build environment of a package using it, Numpy gets installed too as a runtime dependency inside the build environment.

Another way to think about this is that since we only publish (universal) wheels of oldest-supported-numpy, the wheel contains no pyproject.toml, setup.cfg, or setup.py code - it only contains metadata including dependencies which get installed by pip when oldest-supported-numpy is installed.

Can I use this if my package requires a recent version of Numpy?

In many cases, even though your package may require a version of Numpy that is more recent than the pinned versions here, this is often a runtime requirement, i.e. for running (rather than building) your package. In many cases, unless you use recent features of the Numpy C API, you will still be able to build your package with an older version of Numpy and therefore you will still be able to use oldest-supported-numpy. You can still impose a more recent Numpy requirement in install_requires

What about having a catchier name for this package?

The current name is not very catchy as package names go, but it is very descriptive. This package is only meant to be used in pyproject.toml files for defining build-time dependencies, so it’s more important to have a descriptive than a catchy name!

What if I think that one of the pinnings is wrong or out of date?

Please feel free to open an issue or a pull request if you think something is wrong or could be improved!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oldest-supported-numpy-0.5.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

oldest_supported_numpy-0.5-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file oldest-supported-numpy-0.5.tar.gz.

File metadata

  • Download URL: oldest-supported-numpy-0.5.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.0

File hashes

Hashes for oldest-supported-numpy-0.5.tar.gz
Algorithm Hash digest
SHA256 5eae8a53887ce3db2879f5ac829d46bacb8df8c35b233f1449f9aa4cf15e0ddb
MD5 8f7d760b0d4a5e7a820f071c7759d64f
BLAKE2b-256 10114feb90f87271ebd82c4bbe9640378d0ec73f61a07a2ef3205530bd7af54c

See more details on using hashes here.

File details

Details for the file oldest_supported_numpy-0.5-py3-none-any.whl.

File metadata

  • Download URL: oldest_supported_numpy-0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.0

File hashes

Hashes for oldest_supported_numpy-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3f6e2bff21fb306567d0476763a99d5883f77cc43d0d685b691f5fa6cc455a21
MD5 7fc368f1bbd8443b15ab4e35bff7b640
BLAKE2b-256 d577c72ce60433668e366b682de222d1c39d9eaca529964b06c96c2b3bf3383b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page