Skip to content

Commit

Permalink
Revert "Remove hard coded mamba (mamba-org#3069)"
Browse files Browse the repository at this point in the history
This reverts commit 212d1e9.
  • Loading branch information
jchorl committed Dec 26, 2023
1 parent 6bd785d commit b5717e6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/static_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,14 @@ jobs:
# Running a fork until we can merge the changes in micromamba-feedstock
# https://github.com/conda-forge/micromamba-feedstock/pull/154
repository: AntoinePrv/micromamba-feedstock
ref: tmp-mamba-ci
path: micromamba-feedstock
- name: Clear micromamba-feedstock git directory
run: rm -rf "micromamba-feedstock/.git"
- name: Checkout mamba branch
uses: actions/checkout@v3
with:
path: mamba
- name: Clear mamba git directory and link source
# `source` subfolder is the special location looked-up by our feedstock.
# Due to Docker, we can only put it as a subfolder of `micromamba-feedstock`,
run: |
rm -rf "mamba/.git"
mv mamba/ micromamba-feedstock/source
# Prevent irrelevant file permission error
git -C micromamba-feedstock/ config --local --add safe.directory '*'
path: micromamba-feedstock/source
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: mambabuild
Expand Down Expand Up @@ -82,8 +77,6 @@ jobs:
apt-get install -y python3 docker.io
run: |
cd micromamba-feedstock/
# Prevent irrelevant file permission error
chown -R $(whoami) .
# Special values for running the feedstock with a local source
export FEEDSTOCK_ROOT="${PWD}"
export CI="local"
Expand Down
17 changes: 8 additions & 9 deletions Taskfile.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ vars:
CMAKE_PRESET: 'mamba-unix-shared-debug-dev'
CACHE_DIR: '{{.BUILD_DIR}}/pkgs'
DOCS_DIR: '{{.BUILD_DIR}}/docs'
MAMBA_NAME: 'mamba' # Depend on preset...
TEST_MAMBA_EXE:
sh: 'realpath {{.CMAKE_BUILD_DIR}}/micromamba/{{.MAMBA_NAME}}'
CPU_PERCENTAGE: 75
CPU_TOTAL:
sh: >-
Expand Down Expand Up @@ -150,9 +147,9 @@ tasks:
An example run could look like:
task micromamba -- create -n env -c conda-forge python=3.11
deps: [{task: '_build', vars: {target: '{{.MAMBA_NAME}}'}}]
deps: [{task: '_build', vars: {target: 'micromamba'}}]
cmds:
- '"{{.TEST_MAMBA_EXE}}" {{.CLI_ARGS}}'
- '"{{.CMAKE_BUILD_DIR}}/micromamba/micromamba" {{.CLI_ARGS}}'

_test-libmamba:
internal: true
Expand All @@ -172,9 +169,10 @@ tasks:

_test-micromamba:
internal: true
deps: [{task: '_build', vars: {target: '{{.MAMBA_NAME}}'}}]
deps: [{task: '_build', vars: {target: 'micromamba'}}]
env:
TEST_MAMBA_EXE: '{{.TEST_MAMBA_EXE}}'
TEST_MAMBA_EXE:
sh: 'realpath {{.CMAKE_BUILD_DIR}}/micromamba/micromamba'
cmds:
- >-
{{.DEV_RUN}} python -m pytest micromamba/tests/
Expand All @@ -199,9 +197,10 @@ tasks:

_test-reposerver:
internal: true
deps: [{task: '_build', vars: {target: '{{.MAMBA_NAME'}}]
deps: [{task: '_build', vars: {target: 'micromamba'}}]
env:
TEST_MAMBA_EXE: '{{.TEST_MAMBA_EXE}}'
TEST_MAMBA_EXE:
sh: 'realpath {{.CMAKE_BUILD_DIR}}/micromamba/micromamba'
# Explicitly using this as var since env does not override shell environment
vars:
GNUPGHOME: '{{.BUILD_DIR}}/gnupg'
Expand Down
2 changes: 1 addition & 1 deletion micromamba/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def get_umamba(cwd=os.getcwd()):
umamba_bin = "micromamba"
umamba = os.path.join(cwd, "build", "micromamba", umamba_bin)
if not Path(umamba).exists():
raise RuntimeError("Micromamba not found! Set TEST_MAMBA_EXE env variable")
print("MICROMAMBA NOT FOUND!")
return umamba


Expand Down
5 changes: 2 additions & 3 deletions micromamba/tests/test_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,8 @@ def test_init(tmp_home, tmp_root_prefix, shell_type, prefix_selector, multiple_t

def test_dash(tmp_home, tmp_root_prefix):
skip_if_shell_incompat("dash")
umamba = helpers.get_umamba()
subprocess.check_call(["dash", "-c", f"eval $({umamba} shell hook -s dash)"])
subprocess.check_call(["dash", "-c", f"eval $({umamba} shell hook -s posix)"])
subprocess.check_call(["dash", "-c", "eval $(micromamba shell hook -s dash)"])
subprocess.check_call(["dash", "-c", "eval $(micromamba shell hook -s posix)"])


def test_implicitly_created_environment(tmp_home, tmp_root_prefix):
Expand Down

0 comments on commit b5717e6

Please sign in to comment.