Skip to content

Commit

Permalink
Revert "Update numpy build pins"
Browse files Browse the repository at this point in the history
This reverts commit 679934d.
  • Loading branch information
honnibal committed Dec 13, 2024
1 parent 679934d commit 0f1820c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 34 deletions.
2 changes: 1 addition & 1 deletion build-constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +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>=2.0.0,<3.0.0; python_version>='3.9'
numpy>=1.25.0; python_version>='3.9'
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[build-system]
requires = [
"setuptools",
"cython>=0.25,<4.0",
"cython>=0.25,<3.0",
"numpy>=1.15.0; python_version < '3.9'",
"numpy>=2.0.0,<3.0.0; python_version >= '3.9'",
"numpy>=1.25.0; python_version >= '3.9'",
]
build-backend = "setuptools.build_meta"

Expand Down
52 changes: 21 additions & 31 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,11 @@ def check_compiler_flag(self, flag):
DEVNULL = os.open(os.devnull, os.O_RDWR)
try:
subprocess.check_call(
" ".join(self.compiler.compiler)
+ " -march={flag} -E -xc - -o -".format(flag=flag),
" ".join(self.compiler.compiler) + " -march={flag} -E -xc - -o -".format(flag=flag),
stdin=DEVNULL,
stdout=DEVNULL,
stderr=DEVNULL,
shell=True,
shell=True
)
except Exception:
supports_flag = False
Expand Down Expand Up @@ -226,7 +225,9 @@ def compile_objects(self, platform, py_arch, obj_dir):
spec["compiler"] = locate_windows_llvm()
# Ensure that symbols are visible to aid debugging and profiling.
spec["flags"] = [
f for f in spec["flags"] if "visibility=hidden" not in f
f
for f in spec["flags"]
if "visibility=hidden" not in f
]
objects.append(self.build_object(env=env, **spec))
return objects
Expand Down Expand Up @@ -269,16 +270,11 @@ def chdir(new_dir):
if not BLIS_REALLY_COMPILE:
try:
import pip

version_parts = pip.__version__.split(".")
major = int(version_parts[0])
minor = int(version_parts[1])
if major < 19 or (major == 19 and minor < 3):
print(
"WARNING: pip versions <19.3 (currently installed: "
+ pip.__version__
+ ") are unable to detect binary wheel compatibility for blis. To avoid a source install with a very long compilation time, please upgrade pip with `pip install --upgrade pip`.\n\nIf you know what you're doing and you really want to compile blis from source, please set the environment variable BLIS_REALLY_COMPILE=1."
)
print("WARNING: pip versions <19.3 (currently installed: " + pip.__version__ + ") are unable to detect binary wheel compatibility for blis. To avoid a source install with a very long compilation time, please upgrade pip with `pip install --upgrade pip`.\n\nIf you know what you're doing and you really want to compile blis from source, please set the environment variable BLIS_REALLY_COMPILE=1.")
sys.exit(1)
except Exception:
pass
Expand All @@ -299,31 +295,25 @@ def chdir(new_dir):

setup(
setup_requires=[
"cython>=0.25,<4.0",
"numpy>=1.15.0,<3.0.0",
"cython>=0.25,<3.0",
"numpy>=1.15.0",
],
install_requires=[
"numpy>=1.15.0,<3.0.0; python_version < '3.9'",
"numpy>=1.19.0,<3.0.0; python_version >= '3.9'",
"numpy>=1.15.0; python_version < '3.9'",
"numpy>=1.19.0; python_version >= '3.9'",
],
ext_modules=cythonize(
[
Extension(
"blis.cy",
[os.path.join("blis", "cy.pyx")],
extra_compile_args=["-std=c99"],
),
Extension(
"blis.py",
[os.path.join("blis", "py.pyx")],
extra_compile_args=["-std=c99"],
),
],
language_level=2,
),
python_requires=">=3.6,<3.13",
ext_modules=cythonize([
Extension(
"blis.cy", [os.path.join("blis", "cy.pyx")], extra_compile_args=["-std=c99"]
),
Extension(
"blis.py", [os.path.join("blis", "py.pyx")], extra_compile_args=["-std=c99"]
),
], language_level=2),
cmdclass={"build_ext": ExtensionBuilder},
package_data={"": ["*.json", "*.jsonl", "*.pyx", "*.pxd"]},
package_data={
"": ["*.json", "*.jsonl", "*.pyx", "*.pxd"]
},
name="blis",
packages=["blis", "blis.tests"],
author=about["__author__"],
Expand Down

0 comments on commit 0f1820c

Please sign in to comment.