From a9d828e20c245b46af3adf4690f07ae0a800f6e8 Mon Sep 17 00:00:00 2001
From: PrimozGodec
Date: Tue, 25 Apr 2023 16:02:20 +0200
Subject: [PATCH] Use oldest-supported-numpy for build
---
.github/workflows/build-wheels.yml | 1 -
pyproject.toml | 8 ++++++++
2 files changed, 8 insertions(+), 1 deletion(-)
create mode 100644 pyproject.toml
diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml
index c100a179be..69c05d9ee3 100644
--- a/.github/workflows/build-wheels.yml
+++ b/.github/workflows/build-wheels.yml
@@ -41,7 +41,6 @@ jobs:
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_WINDOWS: AMD64 x86 ARM64
- CIBW_BEFORE_BUILD: pip install numpy scipy
CIBW_SKIP: pp* cp36-* cp37-* *-win32 *_i686 *-musllinux_*
CIBW_TEST_COMMAND: pytest -rfxEXs --durations=20 --disable-warnings --showlocals --pyargs gensim
CIBW_TEST_REQUIRES: pytest testfixtures mock
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000000..7bde83b380
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,8 @@
+[build-system]
+requires = [
+ "numpy==1.18.5; python_version=='3.8' and platform_machine not in 'arm64|aarch64'",
+ "oldest-supported-numpy; python_version>'3.8' or platform_machine in 'arm64|aarch64'",
+ "scipy",
+ "setuptools",
+ "wheel",
+]
\ No newline at end of file