From 9c9418151de91b6c0d9c4d83b26f9711a53b0875 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Thu, 15 Oct 2020 12:10:08 -0700 Subject: [PATCH] update-python-libraries: allow for top-level attrs to be updated with github fetcher --- .../update-python-libraries/update-python-libraries.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py index f822cea64da8..9054195ab7e6 100755 --- a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py +++ b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py @@ -193,9 +193,12 @@ def _get_latest_version_github(package, extension, current_version, target): matches = re.findall(r"^([^0-9]*)", string) return next(iter(matches), "") + # when invoked as an updateScript, UPDATE_NIX_ATTR_PATH will be set + # this allows us to work with packages which live outside of python-modules + attr_path = os.environ.get("UPDATE_NIX_ATTR_PATH", f"python3Packages.{package}") try: homepage = subprocess.check_output( - ["nix", "eval", "-f", f"{NIXPGKS_ROOT}/default.nix", "--raw", f"python3Packages.{package}.src.meta.homepage"])\ + ["nix", "eval", "-f", f"{NIXPGKS_ROOT}/default.nix", "--raw", f"{attr_path}.src.meta.homepage"])\ .decode('utf-8') except Exception as e: raise ValueError(f"Unable to determine homepage: {e}")