Skip to content

Commit

Permalink
Add config variable for setting index url for build requirements (#64)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ryanking13 authored Nov 28, 2024
1 parent 4a82b7f commit 9109741
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyodide_build/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def to_env(self) -> dict[str, str]:
"path": "PATH",
"zip_compression_level": "PYODIDE_ZIP_COMPRESSION_LEVEL",
"skip_emscripten_version_check": "SKIP_EMSCRIPTEN_VERSION_CHECK",
"build_dependency_index_url": "BUILD_DEPENDENCY_INDEX_URL",
# maintainer only
"_f2c_fixes_wrapper": "_F2C_FIXES_WRAPPER",
}
Expand All @@ -190,6 +191,7 @@ def to_env(self) -> dict[str, str]:
"rust_toolchain",
"meson_cross_file",
"skip_emscripten_version_check",
"build_dependency_index_url",
# maintainer only
"_f2c_fixes_wrapper",
}
Expand All @@ -208,6 +210,7 @@ def to_env(self) -> dict[str, str]:
# Other configuration
"pyodide_jobs": "1",
"skip_emscripten_version_check": "0",
"build_dependency_index_url": "https://pypi.anaconda.org/pyodide/simple",
# maintainer only
"_f2c_fixes_wrapper": "",
}
Expand Down
2 changes: 2 additions & 0 deletions pyodide_build/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def test_load_config_from_file(
ldflags = "-L/path/to/lib"
rust_toolchain = "nightly"
meson_cross_file = "$(MESON_CROSS_FILE)"
build_dependency_index_url = "https://example.com/simple"
""")

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

def test_config_all(self, dummy_xbuildenv, reset_env_vars, reset_cache):
xbuildenv_manager = CrossBuildEnvManager(
Expand Down

0 comments on commit 9109741

Please sign in to comment.