Skip to content

Commit

Permalink
add conda recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Jan 24, 2024
1 parent 79a1d25 commit 4ee7407
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
8 changes: 4 additions & 4 deletions conda_pip/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
44 changes: 44 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4ee7407

Please sign in to comment.