[go: nahoru, domu]

Skip to content

Commit

Permalink
Update numpy build constraints for numpy 1.25 (#12839)
Browse files Browse the repository at this point in the history
* Update numpy build constraints for numpy 1.25

Starting in numpy 1.25 (see
https://github.com/numpy/numpy/releases/tag/v1.25.0), the numpy C API is
backwards-compatible by default.

For python 3.9+, we should be able to drop the specific numpy build
requirements and use `numpy>=1.25`, which is currently
backwards-compatible to `numpy>=1.19`.

In the future, the python <3.9 requirements could be dropped and the
lower numpy pin could correspond to the oldest supported version for the
current lower python pin.

* Turn off fail-fast

* Revert "Turn off fail-fast"

This reverts commit 4306f51.

* Update for python 3.6

* Fix typo
  • Loading branch information
adrianeboyd committed Jul 24, 2023
1 parent 4f8daa4 commit 5888afa
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
5 changes: 1 addition & 4 deletions build-constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ numpy==1.15.0; python_version<='3.7' and platform_machine!='aarch64'
numpy==1.19.2; python_version<='3.7' and platform_machine=='aarch64'
numpy==1.17.3; python_version=='3.8' and platform_machine!='aarch64'
numpy==1.19.2; python_version=='3.8' and platform_machine=='aarch64'
numpy==1.19.3; python_version=='3.9'
numpy==1.21.3; python_version=='3.10'
numpy==1.23.2; python_version=='3.11'
numpy; python_version>='3.12'
numpy>=1.25.0; python_version>='3.9'
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ requires = [
"preshed>=3.0.2,<3.1.0",
"murmurhash>=0.28.0,<1.1.0",
"thinc>=8.1.8,<8.2.0",
"numpy>=1.15.0",
"numpy>=1.15.0; python_version < '3.9'",
"numpy>=1.25.0; python_version >= '3.9'",
]
build-backend = "setuptools.build_meta"

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ pathy>=0.10.0
smart-open>=5.2.1,<7.0.0
weasel>=0.1.0,<0.2.0
# Third party dependencies
numpy>=1.15.0
numpy>=1.15.0; python_version < "3.9"
numpy>=1.19.0; python_version >= "3.9"
requests>=2.13.0,<3.0.0
tqdm>=4.38.0,<5.0.0
pydantic>=1.7.4,!=1.8,!=1.8.1,<1.11.0
Expand Down
8 changes: 7 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ project_urls =
zip_safe = false
include_package_data = true
python_requires = >=3.6
# NOTE: This section is superseded by pyproject.toml and will be removed in
# spaCy v4
setup_requires =
cython>=0.25,<3.0
# The newest supported pip for python 3.6 has bugs related to markers in
# this section, so this does not contain the same constraints as
# pyproject.toml
numpy>=1.15.0
# We also need our Cython packages here to compile against
cymem>=2.0.2,<2.1.0
Expand All @@ -57,7 +62,8 @@ install_requires =
pathy>=0.10.0
smart-open>=5.2.1,<7.0.0
tqdm>=4.38.0,<5.0.0
numpy>=1.15.0
numpy>=1.15.0; python_version < "3.9"
numpy>=1.19.0; python_version >= "3.9"
requests>=2.13.0,<3.0.0
pydantic>=1.7.4,!=1.8,!=1.8.1,<1.11.0
jinja2
Expand Down
3 changes: 2 additions & 1 deletion spacy/tests/package/test_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

def test_build_dependencies():
# Check that library requirements are pinned exactly the same across different setup files.
# TODO: correct checks for numpy rather than ignoring
libs_ignore_requirements = [
"numpy",
"pytest",
"pytest-timeout",
"mock",
Expand All @@ -23,6 +23,7 @@ def test_build_dependencies():
]
# ignore language-specific packages that shouldn't be installed by all
libs_ignore_setup = [
"numpy",
"fugashi",
"natto-py",
"pythainlp",
Expand Down

0 comments on commit 5888afa

Please sign in to comment.