Skip to content

Commit 9109741

Browse files
authored
Add config variable for setting index url for build requirements (#64)
This adds a new configuration variable, `build_dependency_index_url,` which will be used (TODO) to install build requirements when building packages. I'm splitting PRs to make the changes smaller. related: #43
1 parent 4a82b7f commit 9109741

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

pyodide_build/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def to_env(self) -> dict[str, str]:
175175
"path": "PATH",
176176
"zip_compression_level": "PYODIDE_ZIP_COMPRESSION_LEVEL",
177177
"skip_emscripten_version_check": "SKIP_EMSCRIPTEN_VERSION_CHECK",
178+
"build_dependency_index_url": "BUILD_DEPENDENCY_INDEX_URL",
178179
# maintainer only
179180
"_f2c_fixes_wrapper": "_F2C_FIXES_WRAPPER",
180181
}
@@ -190,6 +191,7 @@ def to_env(self) -> dict[str, str]:
190191
"rust_toolchain",
191192
"meson_cross_file",
192193
"skip_emscripten_version_check",
194+
"build_dependency_index_url",
193195
# maintainer only
194196
"_f2c_fixes_wrapper",
195197
}
@@ -208,6 +210,7 @@ def to_env(self) -> dict[str, str]:
208210
# Other configuration
209211
"pyodide_jobs": "1",
210212
"skip_emscripten_version_check": "0",
213+
"build_dependency_index_url": "https://pypi.anaconda.org/pyodide/simple",
211214
# maintainer only
212215
"_f2c_fixes_wrapper": "",
213216
}

pyodide_build/tests/test_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def test_load_config_from_file(
8989
ldflags = "-L/path/to/lib"
9090
rust_toolchain = "nightly"
9191
meson_cross_file = "$(MESON_CROSS_FILE)"
92+
build_dependency_index_url = "https://example.com/simple"
9293
""")
9394

9495
xbuildenv_manager = CrossBuildEnvManager(
@@ -103,6 +104,7 @@ def test_load_config_from_file(
103104
assert config["ldflags"] == "-L/path/to/lib"
104105
assert config["rust_toolchain"] == "nightly"
105106
assert config["meson_cross_file"] == "/path/to/crossfile"
107+
assert config["build_dependency_index_url"] == "https://example.com/simple"
106108

107109
def test_config_all(self, dummy_xbuildenv, reset_env_vars, reset_cache):
108110
xbuildenv_manager = CrossBuildEnvManager(

0 commit comments

Comments
 (0)