|
1 | 1 | diff --git a/jaxlib_build_backend.py b/jaxlib_build_backend.py
|
2 | 2 | new file mode 100644
|
3 |
| -index 000000000..5e6e553d2 |
| 3 | +index 0000000..3727f7e |
4 | 4 | --- /dev/null
|
5 | 5 | +++ b/jaxlib_build_backend.py
|
6 |
| -@@ -0,0 +1,34 @@ |
| 6 | +@@ -0,0 +1,39 @@ |
7 | 7 | +import os
|
8 | 8 | +import re
|
9 | 9 | +import sys
|
@@ -32,21 +32,26 @@ index 000000000..5e6e553d2
|
32 | 32 | +
|
33 | 33 | +def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
|
34 | 34 | + with tempfile.TemporaryDirectory() as d:
|
35 |
| -+ subprocess.run([sys.executable, 'build/build.py', '--output_path', d], check=True) |
| 35 | ++ cmd = [sys.executable, 'build/build.py', '--output_path', d] |
| 36 | ++ if num_jobs := os.environ.get('CORE_COUNT'): |
| 37 | ++ cmd += [f'--bazel_options=--jobs={num_jobs}'] |
| 38 | ++ if max_mem := os.environ.get('MAX_MEMORY_GB'): |
| 39 | ++ cmd += [f'--bazel_options=--local_ram_resources={int(max_mem) * 1024}'] |
| 40 | ++ subprocess.run(cmd, check=True) |
36 | 41 | + wheels = list(Path(d).glob('*.whl'))
|
37 | 42 | + assert len(wheels) == 1, f"Expected 1 wheel, found {len(wheels)}"
|
38 | 43 | + wheel = wheels[0]
|
39 | 44 | + shutil.copyfile(wheel, Path(wheel_directory) / wheel.name)
|
40 | 45 | + return str(wheel.name)
|
41 | 46 | diff --git a/pyproject.toml b/pyproject.toml
|
42 |
| -index eb3eb4c1f..f521d3f36 100644 |
| 47 | +index eb3eb4c..5876c7b 100644 |
43 | 48 | --- a/pyproject.toml
|
44 | 49 | +++ b/pyproject.toml
|
45 | 50 | @@ -1,6 +1,7 @@
|
46 | 51 | [build-system]
|
47 | 52 | -requires = ["setuptools", "wheel"]
|
48 | 53 | -build-backend = "setuptools.build_meta"
|
49 |
| -+requires = ["setuptools", "wheel", "numpy"] |
| 54 | ++requires = ["setuptools", "wheel", "oldest-supported-numpy"] |
50 | 55 | +build-backend = "jaxlib_build_backend"
|
51 | 56 | +backend-path = ["."]
|
52 | 57 |
|
|
0 commit comments