From 4ee7407369dbfddf8dd1083fa7e4bbb7d84bf3ff Mon Sep 17 00:00:00 2001 From: jaimergp Date: Wed, 24 Jan 2024 13:23:08 +0100 Subject: [PATCH] add conda recipe --- conda_pip/main.py | 8 ++++---- recipe/meta.yaml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 recipe/meta.yaml diff --git a/conda_pip/main.py b/conda_pip/main.py index 5354058..6a75629 100644 --- a/conda_pip/main.py +++ b/conda_pip/main.py @@ -43,10 +43,10 @@ def validate_target_env(path: Path, packages: Iterable[str]) -> Iterable[str]: context.validate_configuration() pd = PrefixData(path, pip_interop_enabled=True) - if not list(pd.query("python")): - raise CondaError(f"Target environment at {path} does not have Python installed") - if not list(pd.query("pip")): - raise CondaError(f"Target environment at {path} does not have pip installed") + if not list(pd.query("python>=3.2")): + raise CondaError(f"Target environment at {path} requires python>=3.2") + if not list(pd.query("pip>=23.0.1")): + raise CondaError(f"Target environment at {path} requires pip>=23.0.1") packages_to_process = [] for pkg in packages: diff --git a/recipe/meta.yaml b/recipe/meta.yaml new file mode 100644 index 0000000..8551ada --- /dev/null +++ b/recipe/meta.yaml @@ -0,0 +1,44 @@ +package: + name: conda-pip + {% if GIT_DESCRIBE_TAG is defined and GIT_BUILD_STR is defined %} + version: {{ GIT_DESCRIBE_TAG }}+{{ GIT_BUILD_STR }} + {% else %} + version: 0.0.0dev0 + {% endif %} + +source: + # git_url only captures committed code + git_url: ../ + +build: + number: 0 + noarch: python + script: + - {{ PYTHON }} -m pip install . --no-deps --no-build-isolation -vv + - cp conda_pip/data/EXTERNALLY-MANAGED "$("{{ PYTHON }}" -c "import sysconfig; print(sysconfig.get_paths()['stdlib'])")" + +requirements: + host: + - python >=3.8 + - pip + - hatchling >=1.12.2 + - hatch-vcs >=0.2.0 + run: + - python >=3.8 + - conda >=23.7.3 + - pip >=23.0.1 + - grayskull + +test: + imports: + - conda_pip + - conda_pip.main + commands: + - conda pip --help + +about: + home: https://github.com/jaimergp/conda-pip + license: MIT + license_file: LICENSE + summary: A safer pip for conda environments + dev_url: https://github.com/jaimergp/conda-pip