From 348e4e357bd6cc4192ea849d86573dad84d99c76 Mon Sep 17 00:00:00 2001 From: Romain Hugonnet Date: Sun, 24 Sep 2023 10:25:30 -0800 Subject: [PATCH] Add exception in generate pip from conda script when pulling from repo directly --- .github/scripts/generate_pip_deps_from_conda.py | 9 ++++++++- dev-environment.yml | 2 +- environment.yml | 2 +- requirements.txt | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/scripts/generate_pip_deps_from_conda.py b/.github/scripts/generate_pip_deps_from_conda.py index 844b80cd..2f71a0f6 100755 --- a/.github/scripts/generate_pip_deps_from_conda.py +++ b/.github/scripts/generate_pip_deps_from_conda.py @@ -98,7 +98,14 @@ def generate_pip_from_conda(conda_path: pathlib.Path, pip_path: pathlib.Path, co if conda_dep: pip_deps.append(conda_dep) elif isinstance(dep, dict) and len(dep) == 1 and "pip" in dep: - pip_deps.extend(dep["pip"]) + # If pulled directly from GitHub (temporary CI passing), + # such as git+https://github.com/GlacioHack/geoutils.git, + # rename to the package repo name + dep_pips = dep["pip"] + for dep_pip in dep_pips: + if "+" in dep_pip and dep_pip.split("+")[0] == "git": + dep_pip = dep_pip.split("/")[-1].split(".git")[0] + pip_deps.append(dep_pip) else: raise ValueError(f"Unexpected dependency {dep}") diff --git a/dev-environment.yml b/dev-environment.yml index 4088a59b..fe895644 100644 --- a/dev-environment.yml +++ b/dev-environment.yml @@ -52,4 +52,4 @@ dependencies: - noisyopt # To run CI against latest GeoUtils - - git+https://github.com/GlacioHack/GeoUtils.git + - git+https://github.com/GlacioHack/geoutils.git diff --git a/environment.yml b/environment.yml index bb698c03..528ae14f 100644 --- a/environment.yml +++ b/environment.yml @@ -19,4 +19,4 @@ dependencies: - pip - pip: - - git+https://github.com/GlacioHack/GeoUtils.git + - git+https://github.com/GlacioHack/geoutils.git diff --git a/requirements.txt b/requirements.txt index 8a4ae0d2..626d780f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,6 +14,6 @@ tqdm scikit-image scikit-gstat>=1.0 pip -git+https://github.com/GlacioHack/GeoUtils.git +geoutils setuptools>=42 setuptools_scm[toml]>=6.2