|
32 | 32 | _ProjectBuilder, |
33 | 33 | ) |
34 | 34 |
|
35 | | -AVOIDED_REQUIREMENTS = [ |
36 | | - # mesonpy installs patchelf in linux platform but we don't want it. |
37 | | - "patchelf", |
38 | | - "oldest-supported-numpy", |
39 | | -] |
40 | | - |
41 | | -AVOIDED_REQUIREMENTS: list[str] = [ |
42 | | - "patchelf", |
43 | | - "oldest-supported-numpy", |
44 | | -] + get_host_build_flag("AVOIDED_BUILD_REQUIREMENTS").split() |
45 | | - |
46 | 35 | # corresponding env variables for symlinks |
47 | 36 | SYMLINK_ENV_VARS = { |
48 | 37 | "cc": "CC", |
@@ -103,6 +92,8 @@ def _runner(cmd, cwd=None, extra_environ=None): |
103 | 92 |
|
104 | 93 |
|
105 | 94 | def symlink_unisolated_packages(env: DefaultIsolatedEnv) -> None: |
| 95 | + from pyodide_build.build_env import get_build_flag, get_unisolated_packages |
| 96 | + |
106 | 97 | pyversion = get_pyversion() |
107 | 98 | site_packages_path = f"lib/{pyversion}/site-packages" |
108 | 99 | env_site_packages = Path(env.path) / site_packages_path |
@@ -137,14 +128,17 @@ def remove_avoided_requirements( |
137 | 128 | def install_reqs( |
138 | 129 | build_env: Mapping[str, str], env: DefaultIsolatedEnv, reqs: set[str] |
139 | 130 | ) -> None: |
| 131 | + IGNORED_BUILD_REQUIREMENTS = get_host_build_flag( |
| 132 | + "IGNORED_BUILD_REQUIREMENTS" |
| 133 | + ).split() |
140 | 134 | # propagate PIP config from build_env to current environment |
141 | 135 | with common.replace_env( |
142 | 136 | os.environ | {k: v for k, v in build_env.items() if k.startswith("PIP")} |
143 | 137 | ): |
144 | 138 | env.install( |
145 | 139 | remove_avoided_requirements( |
146 | 140 | reqs, |
147 | | - get_unisolated_packages() + AVOIDED_REQUIREMENTS, |
| 141 | + get_unisolated_packages() + IGNORED_BUILD_REQUIREMENTS, |
148 | 142 | ) |
149 | 143 | ) |
150 | 144 |
|
@@ -262,7 +256,6 @@ def make_command_wrapper_symlinks(symlink_dir: Path) -> dict[str, str]: |
262 | 256 | ------- |
263 | 257 | The dictionary of compiler environment variables that points to the symlinks. |
264 | 258 | """ |
265 | | - |
266 | 259 | # For maintainers: |
267 | 260 | # - you can set "_f2c_fixes_wrapper" variable in pyproject.toml |
268 | 261 | # in order to change the script to use when cross-compiling |
@@ -321,6 +314,7 @@ def get_build_env( |
321 | 314 | Returns a dict of environment variables that should be used when building |
322 | 315 | a package with pypa/build. |
323 | 316 | """ |
| 317 | + from pyodide_build.build_env import get_build_flag |
324 | 318 |
|
325 | 319 | kwargs = { |
326 | 320 | "pkgname": pkgname, |
|
0 commit comments