-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run tests on all platforms #208
base: 1.x
Are you sure you want to change the base?
Changes from all commits
1ebc195
9a2c4ee
0bcbf8e
0fe305a
057d64a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
From 5bdf918c02aa774d8fa9d17a2e3deb3771e18ac7 Mon Sep 17 00:00:00 2001 | ||
From: Marcel Bargull <[email protected]> | ||
Date: Fri, 2 Feb 2024 12:32:36 +0100 | ||
Subject: [PATCH 1/2] 1.x: Fix repoquery subcommand for Python 3.11/3.12 | ||
|
||
Signed-off-by: Marcel Bargull <[email protected]> | ||
--- | ||
mamba/mamba/mamba.py | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/mamba/mamba/mamba.py b/mamba/mamba/mamba.py | ||
index 87e44d4100..0ff25387ea 100644 | ||
--- a/mamba/mamba/mamba.py | ||
+++ b/mamba/mamba/mamba.py | ||
@@ -769,7 +769,7 @@ def format_param(nm, val): | ||
exit_code = update(args, parser) | ||
elif relative_mod == ".main_init": | ||
exit_code = shell_init(args) | ||
- elif relative_mod in (".main_repoquery", "repoquery"): | ||
+ elif relative_mod in (".main_repoquery", ".repoquery"): | ||
exit_code = repoquery(args, parser) | ||
else: | ||
print( | ||
|
||
From f6021f31f1308c62d6114ab1fb2aae3602e0d07c Mon Sep 17 00:00:00 2001 | ||
From: Marcel Bargull <[email protected]> | ||
Date: Fri, 2 Feb 2024 12:33:21 +0100 | ||
Subject: [PATCH 2/2] 1.x: Return exit code 1 for non-supported commands | ||
|
||
Signed-off-by: Marcel Bargull <[email protected]> | ||
--- | ||
mamba/mamba/mamba.py | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/mamba/mamba/mamba.py b/mamba/mamba/mamba.py | ||
index 0ff25387ea..c1ec492b03 100644 | ||
--- a/mamba/mamba/mamba.py | ||
+++ b/mamba/mamba/mamba.py | ||
@@ -778,7 +778,7 @@ def format_param(nm, val): | ||
" deactivate are supported through mamba." | ||
) | ||
|
||
- return 0 | ||
+ return 1 | ||
return exit_code | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ package: | |
source: | ||
url: https://github.com/mamba-org/mamba/archive/refs/tags/{{ release }}.tar.gz | ||
sha256: 868bb00385029ae45b35e136174164017868edec6f3710bc1644c670db4c0cdb | ||
patches: | ||
- 0001-1.x-Fix-repoquery-subcommand-for-Python-3.11-3.12.patch | ||
|
||
build: | ||
number: 0 | ||
|
@@ -111,7 +113,7 @@ outputs: | |
- python -c "import libmambapy._version; assert libmambapy._version.__version__ == '{{ libmambapy_version }}'" | ||
|
||
- name: mamba | ||
version: {{ mamba_version }} | ||
version: {{ mamba_version }}.post1 | ||
script: build_mamba.sh # [unix] | ||
script: build_mamba.bat # [win] | ||
build: | ||
|
@@ -129,7 +131,7 @@ outputs: | |
- {{ pin_subpackage('libmambapy', exact=True) }} | ||
run: | ||
- python | ||
- conda >=23.11,<23.12 | ||
- conda >=23.11,<24.2 | ||
- {{ pin_subpackage('libmambapy', exact=True) }} | ||
|
||
test: | ||
|
@@ -138,18 +140,25 @@ outputs: | |
requires: | ||
- pip | ||
commands: | ||
- mamba --help | ||
- if exist %PREFIX%\condabin\mamba.bat (exit 0) else (exit 1) # [win] | ||
- test -f ${PREFIX}/etc/profile.d/mamba.sh # [linux] | ||
# these tests work when run on win, but for some reason not during conda build | ||
- mamba create -n test_py2 python=2.7 --dry-run # [unix] | ||
- mamba clean --all --dry-run # [unix] | ||
- mamba repoquery whoneeds conda # [unix] | ||
- mamba install xtensor xsimd -c conda-forge --dry-run # [linux and x86_64] | ||
- test -f ${PREFIX}/condabin/mamba # [unix] | ||
- test -f ${PREFIX}/etc/profile.d/mamba.sh # [unix] | ||
- if not exist %PREFIX%\condabin\mamba.bat exit 1 # [win] | ||
|
||
# Ensure we run the executable from the prefix and not from the base installation. | ||
- test "$(command -v mamba)" = "${PREFIX}/bin/mamba" # [unix] | ||
- cmd /q /c "for /f "delims=" %%f in ('C:\Windows\System32\where mamba.bat') do if "%%~dpf"=="%LIBRARY_BIN%\" (exit 0) else (exit 1)" # [win] | ||
- cmd /q /c "for /f "delims=" %%f in ('C:\Windows\System32\where mamba.exe') do if "%%~dpf"=="%SCRIPTS%\" (exit 0) else (exit 1)" # [win] | ||
|
||
# We need to run with "call" on Windows since "mamba" runs the batch file; make "call" a passthrough function on Unixes. | ||
- call() { "${@}" ; } # [unix] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Defining this pass-through function here allows us to have the test below uniform on all platform so we can avoid duplication and overall maintenance burden. |
||
- call mamba --help | ||
- call mamba create -n test_py37 python=3.7 --dry-run | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
- call mamba clean --all --dry-run | ||
- call mamba repoquery whoneeds conda | ||
- call mamba install xtensor xsimd -c conda-forge --dry-run | ||
# for some reason tqdm doesn't have a proper colorama dependency so pip check fails | ||
# but that's completely unrelated to mamba | ||
- python -c "import mamba._version; assert mamba._version.__version__ == '{{ mamba_version }}'" | ||
- test -f ${PREFIX}/condabin/mamba # [unix] | ||
|
||
about: | ||
home: https://github.com/mamba-org/mamba | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cryptic Batch nonsense should be equivalent to the POSIX shell test above it and checks that the first entry on
PATH
with the executable is the one we want to test.It's wrapped in a
cmd /c
call since we have anexit 0
in there (to only check the first entry) which would exit the whole test script if it wasn't wrapped in a subprocess.I tried to use
findstr "/C:%PREFIX%"
in there, but it turns out that the search strings forfindstr
are length-limited far below thePREFIX
' lengths we use.