diff --git a/package/package.toml b/package/package.toml index 4dd348164..d2c208eb1 100644 --- a/package/package.toml +++ b/package/package.toml @@ -6,12 +6,14 @@ pex-extras = [ "management", ] +# This customization gets us a lockable psutil wheel for armv7l. +extra-lock-args = ["--index", "https://www.piwheels.org/simple"] + [scie.platforms.linux-aarch64] [scie.platforms.linux-armv7l] # This customization gets us a lockable psutil wheel. python-version = "3.11.11" -extra-lock-args = ["--index", "https://www.piwheels.org/simple"] # TODO(John Sirois): Remove once the complete platform file is generated. required = false diff --git a/package/scie_config.py b/package/scie_config.py index 71a94dcfd..44df252ce 100644 --- a/package/scie_config.py +++ b/package/scie_config.py @@ -29,14 +29,12 @@ def load( name=name, pbs_release=platform_data.get("pbs-release", default_pbs_release), python_version=platform_data.get("python-version", default_python_version), - extra_lock_args=tuple(platform_data.get("extra-lock-args", ())), required=platform_data.get("required", True), ) name: str pbs_release: str python_version: str - extra_lock_args: tuple[str, ...] = () required: bool = True @@ -58,9 +56,7 @@ def load( scie_config = toml.loads(data.decode())["scie"] default_pbs_release = pbs_release or scie_config["pbs-release"] default_python_version = python_version or scie_config["python-version"] - return cls( - pex_extras=tuple(scie_config["pex-extras"]), platforms=tuple( PlatformConfig.load( name=platform_name, @@ -68,12 +64,15 @@ def load( default_pbs_release=default_pbs_release, default_python_version=default_python_version, ) - for platform_name, platform_data in scie_config.get("platforms", {}).items() + for platform_name, platform_data in scie_config["platforms"].items() ), + pex_extras=tuple(scie_config.get("pex-extras", ())), + extra_lock_args=tuple(scie_config.get("extra-lock-args", ())), ) - pex_extras: tuple[str, ...] platforms: tuple[PlatformConfig, ...] + pex_extras: tuple[str, ...] = () + extra_lock_args: tuple[str, ...] = () def current_platform(self) -> PlatformConfig: system = platform.system().lower() @@ -114,8 +113,6 @@ def encode(self) -> str: data["pbs-release"] = platform_config.pbs_release if platform_config.python_version != default_python_version: data["python-version"] = platform_config.python_version - if platform_config.extra_lock_args: - data["extra-lock-args"] = platform_config.extra_lock_args if not platform_config.required: data["required"] = False platforms[platform_config.name] = data @@ -126,6 +123,7 @@ def encode(self) -> str: "pbs-release": default_pbs_release, "python-version": default_python_version, "pex-extras": self.pex_extras, + "extra-lock-args": self.extra_lock_args, "platforms": platforms, } ).encode() diff --git a/scripts/gen-scie-platform.py b/scripts/gen-scie-platform.py index 093a545db..ddf30363b 100644 --- a/scripts/gen-scie-platform.py +++ b/scripts/gen-scie-platform.py @@ -195,7 +195,8 @@ def create_lock( "2", "--lock", str(lock_file), - ], + ] + + list(scie_config.extra_lock_args), check=True, )