Skip to content
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

Refactor for libmamba v2 #457

Merged
merged 168 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
f027cab
Commit progress so far
jaimergp Mar 26, 2024
65c6ae1
Better DX :)
jaimergp Mar 28, 2024
01430b9
Try alpha4
jaimergp Mar 28, 2024
3882971
Bare minimum to make 'conda create -dnx python' work
jaimergp Mar 28, 2024
228578c
Basic install and remove too
jaimergp Mar 28, 2024
d07514c
migrate conflict reporting
jaimergp Mar 28, 2024
ccf16e3
enable tests
jaimergp Mar 28, 2024
0285923
Merge branch 'main' into try-libmamba-2a3
jaimergp Mar 28, 2024
de2b1b0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 28, 2024
39ef557
pre-commit
jaimergp Mar 28, 2024
a9c4506
fix import
jaimergp Mar 28, 2024
f47040a
from solver2
jaimergp Mar 29, 2024
b817de1
no reruns
jaimergp Mar 29, 2024
0a11633
index._channels is now index.channels
jaimergp Mar 29, 2024
0d6fbb5
set flags explicitly
jaimergp Mar 29, 2024
f825677
force bool
jaimergp Mar 29, 2024
13d47ea
These are part of conda/conda, no need to run them here
jaimergp Mar 29, 2024
00f27ef
just use the regular module paths
jaimergp Mar 29, 2024
a749ef4
update ignores
jaimergp Mar 29, 2024
42b7b23
force list
jaimergp Mar 29, 2024
8e74d12
provide more default values
jaimergp Mar 29, 2024
46dec1b
set logger
jaimergp Mar 29, 2024
33af056
Fix SOLV loading
jaimergp Mar 29, 2024
505be03
Fix performance test collection
jaimergp Mar 29, 2024
0b224b3
Parse PackageNotFoundErrors from explained problems, add custom_chann…
jaimergp Apr 1, 2024
ef95ef8
fix typo
jaimergp Apr 1, 2024
07a06c0
fix typeerror
jaimergp Apr 1, 2024
f0e4a93
raise on bad pins
jaimergp Apr 1, 2024
3f5cc5e
fix problem parsing and matchspec roundtrips
jaimergp Apr 1, 2024
a66bc7f
this is part of "Collecting metadata"
jaimergp Apr 1, 2024
af2b49b
channels -> _channels
jaimergp Apr 1, 2024
893348c
require beta
jaimergp Apr 8, 2024
1066bea
do not load tar.bz2 if conda available; enable logging
jaimergp Apr 8, 2024
c9d3868
do not enable debug logging during testing for performance
jaimergp Apr 8, 2024
052f0e8
re-enable this assertion
jaimergp Apr 8, 2024
31fbefe
pre-commit
jaimergp Apr 8, 2024
cc1565b
set more logging
jaimergp Apr 8, 2024
80fc7f8
readd pytest workaround
jaimergp Apr 8, 2024
38c7f70
Allow repodata loading errors in offline mode
jaimergp Apr 8, 2024
e2a3fb6
ensure we pass back the url with credentials
jaimergp Apr 8, 2024
3febd99
clarify why test_python_downgrade_with_pins_removes_truststore curren…
jaimergp Apr 8, 2024
a71a98f
pass subdirs
jaimergp Apr 8, 2024
2089b8b
do not really set libsolv loggers for now
jaimergp Apr 8, 2024
64f71fd
global allow_uninstall = True
jaimergp Apr 8, 2024
d92ee47
more types
jaimergp Apr 8, 2024
9070026
keep updates
jaimergp Apr 9, 2024
a845aa8
point to PR with upstream changes
jaimergp Apr 9, 2024
6dd3666
warn about pins in conflicts
jaimergp Apr 9, 2024
dcac75b
fix tests/core/test_solve.py::test_freeze_deps_1
jaimergp Apr 9, 2024
d3308b0
fix tests/test_create.py::test_neutering_of_historic_specs
jaimergp Apr 9, 2024
8e6cb62
fix tests/models/test_prefix_graph.py::test_sort_without_prep[libmamba]
jaimergp Apr 10, 2024
9773ffb
implement reload_channel()
jaimergp Apr 10, 2024
428aa29
bring _fix_version_field_for_conda_build
jaimergp Apr 10, 2024
e1f2326
pre-commit
jaimergp Apr 10, 2024
736db03
unfreeze dataclass
jaimergp Apr 10, 2024
b201f0e
oops :)
jaimergp Apr 10, 2024
ccf73a5
do not inject pip in installed
jaimergp Apr 10, 2024
c921bc5
adjust subdirs for conda-build
jaimergp Apr 10, 2024
b46adc0
pre-commit
jaimergp Apr 10, 2024
bb83f33
test channel reload
jaimergp Apr 10, 2024
940809c
add Index.n_packages() helper
jaimergp Apr 10, 2024
ed709a0
Merge branch 'main' into try-libmamba-2a3
jaimergp Apr 10, 2024
70b403c
commit v2 changes markdown
jaimergp Apr 10, 2024
828273c
use default traceback in pytest
jaimergp Apr 10, 2024
f1228bb
Merge branch 'try-libmamba-2a3' of github.com:conda/conda-libmamba-so…
jaimergp Apr 10, 2024
ae6071e
use smaller packages
jaimergp Apr 10, 2024
f57ef62
no defaults needed here
jaimergp Apr 10, 2024
c903007
use_default_signal_handler = False
jaimergp Apr 12, 2024
649a718
Merge branch 'main' into try-libmamba-2a3
jaimergp Apr 22, 2024
8c0812c
explicitly choose macos-13
jaimergp Apr 24, 2024
8b21a73
Merge branch 'try-libmamba-2a3' of github.com:conda/conda-libmamba-so…
jaimergp Apr 24, 2024
0809915
Merge branch 'main' of github.com:conda/conda-libmamba-solver into tr…
jaimergp May 7, 2024
15a488f
bump to beta1
jaimergp May 7, 2024
bbf659c
fix problems formatting
jaimergp May 7, 2024
bea1a8a
adopt FORCE_COLOR, NO_COLOR
jaimergp May 7, 2024
d4ffb51
adjust pin detection in problems
jaimergp May 7, 2024
c73c8a9
Merge branch 'main' of github.com:conda/conda-libmamba-solver into tr…
jaimergp Jun 17, 2024
55e5b0f
require beta3
jaimergp Jun 17, 2024
90f55a9
initialize libmamba context
jaimergp Jun 17, 2024
bc748a5
Reorganize mamba context initialization and output handling
jaimergp Jun 17, 2024
7d56289
revert to debug
jaimergp Jun 17, 2024
fa89314
make it a singleton
jaimergp Jun 17, 2024
ce07d4a
update test
jaimergp Jun 17, 2024
a36fd87
Fix windows test
jaimergp Jun 17, 2024
b1f742f
fix error parser in edge case
jaimergp Jun 17, 2024
7283def
pre-commit
jaimergp Jun 17, 2024
5f0c974
adjust test for now
jaimergp Jun 18, 2024
cb19c83
Merge branch 'main' into try-libmamba-2a3
jaimergp Jul 5, 2024
f69fc93
Require rc0
jaimergp Jul 8, 2024
2a899bd
Cleanup
jaimergp Jul 8, 2024
fa9403b
update docs
jaimergp Jul 8, 2024
a8e1923
add news
jaimergp Jul 8, 2024
44c7666
Merge branch 'try-libmamba-2a3' of github.com:conda/conda-libmamba-so…
jaimergp Jul 8, 2024
6d375a3
Merge branch 'main' of github.com:conda/conda-libmamba-solver into tr…
jaimergp Jul 8, 2024
a990454
pre-commit
jaimergp Jul 8, 2024
20686c4
disable signal_handling
jaimergp Jul 8, 2024
bb3bfef
Double the allowed timeout
jaimergp Jul 8, 2024
51ac56d
do assert the interrupt on Windows
jaimergp Jul 8, 2024
5c37d6a
correct verbosity
jaimergp Jul 8, 2024
cbf1139
Disable SOLV cache on Windows (JSON is faster)
jaimergp Jul 8, 2024
df7f0fa
add comment
jaimergp Jul 8, 2024
69eeb7e
move Database logging logic to mamba_utils
jaimergp Jul 8, 2024
9abbc1b
types, pre-commit
jaimergp Jul 8, 2024
77c881c
small optimization
jaimergp Jul 8, 2024
65cd93f
fix typing
jaimergp Jul 8, 2024
c58aec6
Do not load channels from installed
jaimergp Jul 8, 2024
b572107
Set priorities directly on the object (better performance?)
jaimergp Jul 8, 2024
c6f3755
revert (it breaks some tests)
jaimergp Jul 8, 2024
784084b
pre-commit
jaimergp Jul 8, 2024
d710f3e
add a comment
jaimergp Jul 8, 2024
827e449
Allow virtual packages in specs
jaimergp Jul 10, 2024
95703a4
remove explicit sqlite
jaimergp Jul 11, 2024
b24fc69
Merge branch 'main' of github.com:conda/conda-libmamba-solver into tr…
jaimergp Jul 12, 2024
205fbcc
Merge branch 'main' of github.com:conda/conda-libmamba-solver into tr…
jaimergp Jul 12, 2024
0f578ad
Merge branch 'main' into try-libmamba-2a3
jaimergp Jul 17, 2024
307d16d
Hack channel priority with special build from jaimergp/label/conda-li…
jaimergp Jul 17, 2024
44bf01f
Merge branch 'try-libmamba-2a3' of github.com:conda/conda-libmamba-so…
jaimergp Jul 17, 2024
c40db9e
Put it in requirements.txt better
jaimergp Jul 17, 2024
1fadead
Merge branch 'main' into try-libmamba-2a3
jaimergp Jul 17, 2024
1f30bba
Review metadata
jaimergp Jul 17, 2024
cf09cd5
fix how we parse some problems
jaimergp Jul 17, 2024
f8c84f6
Add comments about forcing AMD64 in devcontainer
jaimergp Jul 17, 2024
932c3fa
Merge branch 'try-libmamba-2a3' of github.com:conda/conda-libmamba-so…
jaimergp Jul 17, 2024
4071c0e
Update recipe
jaimergp Jul 19, 2024
a3d9a3d
Merge branch 'main' into try-libmamba-2a3
jaimergp Jul 19, 2024
6104e2a
Merge branch 'main' into try-libmamba-2a3
jaimergp Jul 22, 2024
7e40b30
Use rc1
jaimergp Jul 29, 2024
d83e4bb
skip this one in osx-arm64
jaimergp Jul 31, 2024
98aaa83
Merge branch 'main' into try-libmamba-2a3
jaimergp Aug 2, 2024
418e024
Merge branch 'main' into try-libmamba-2a3
jaimergp Aug 12, 2024
e94e529
Merge branch 'main' into try-libmamba-2a3
jaimergp Aug 13, 2024
a4828d4
require rc2
jaimergp Aug 20, 2024
c0f3ea7
clean up a bit
jaimergp Aug 27, 2024
811b756
require 2.0.0rc3
jaimergp Aug 27, 2024
d87307e
Merge branch 'main' into try-libmamba-2a3
jaimergp Aug 27, 2024
7807dfe
Merge branch 'main' into try-libmamba-2a3
jaimergp Aug 29, 2024
cde317b
Try rc4
jaimergp Aug 29, 2024
f3c0c20
simplify Database.set_logger callback
jaimergp Aug 29, 2024
9397d7a
Bump CI matrix, drop Python 3.8, require Python 3.9+
jaimergp Aug 30, 2024
d31dad5
Merge branch 'main' into try-libmamba-2a3
jaimergp Sep 3, 2024
8dda5c5
Require rc6
jaimergp Sep 21, 2024
000cbf4
Merge branch 'try-libmamba-2a3' of github.com:conda/conda-libmamba-so…
jaimergp Sep 21, 2024
d899373
set libmamba_context.output_params.verbosity too
jaimergp Sep 21, 2024
039e165
pre-commit
jaimergp Sep 21, 2024
cc4bdf2
Port #525 (explicit channels, subdir and target prefix for libmamba c…
jaimergp Sep 21, 2024
5ae8db4
Merge branch 'main' into try-libmamba-2a3
jaimergp Sep 23, 2024
f8a23b6
fix function name typo
jaimergp Sep 23, 2024
a4a5d2c
argument must be hashable
jaimergp Sep 23, 2024
b6a04ee
Merge branch 'try-libmamba-2a3' of github.com:conda/conda-libmamba-so…
jaimergp Sep 23, 2024
19ce404
fix lru_cache with a global instead
jaimergp Sep 23, 2024
f15ca13
Merge branch 'main' of github.com:conda/conda-libmamba-solver into tr…
jaimergp Sep 25, 2024
eddd998
add IndexHelper.from_platform_aware_channel classmethod + fix test
jaimergp Sep 25, 2024
1b6d7b3
add region
jaimergp Sep 27, 2024
67d7ff0
use canonical name for channel id, preferentially
jaimergp Sep 27, 2024
0e0c4c5
Use channel.name in multichannels
jaimergp Sep 27, 2024
08bf945
use 2.0 final
jaimergp Sep 27, 2024
6cf86c0
retrigger for https://github.com/conda/conda/pull/13784/commits/235be…
jaimergp Sep 27, 2024
c1a2a66
Increase timeout?
jaimergp Sep 27, 2024
2b4e98d
Merge branch 'main' of github.com:conda/conda-libmamba-solver into tr…
jaimergp Oct 14, 2024
5c7ac3f
send CtrlC twice
jaimergp Oct 14, 2024
6fdb2e1
debug windows
jaimergp Oct 14, 2024
29044a9
revert
jaimergp Oct 14, 2024
46df752
reduce timeouts
jaimergp Oct 14, 2024
6724193
fix hooks
jaimergp Oct 14, 2024
1c19780
exclude tests
jaimergp Oct 14, 2024
8c64d25
Apply suggestions from code review
jaimergp Oct 15, 2024
3bc5cf9
Merge branch 'main' into try-libmamba-2a3
jaimergp Oct 15, 2024
8c717a7
back to conda/conda@main
jaimergp Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .devcontainer/conda-forge/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"name": "Miniforge (default-channel=conda-forge)",
"image": "condaforge/miniforge3:latest",

// Uncomment to force x64 instead of native (slower!)
// "runArgs": ["--platform=linux/amd64"],

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

Expand Down Expand Up @@ -31,7 +34,8 @@
"extensions": [
"charliermarsh.ruff",
"eamodio.gitlens",
"ms-toolsai.jupyter"
"ms-toolsai.jupyter",
"be5invis.toml"
]
}
}
Expand Down
6 changes: 5 additions & 1 deletion .devcontainer/defaults/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"name": "Miniconda (default-channel=defaults)",
"image": "continuumio/miniconda3:latest",

// Uncomment to force x64 instead of native (slower!)
// "runArgs": ["--platform=linux/amd64"],

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

Expand Down Expand Up @@ -31,7 +34,8 @@
"extensions": [
"charliermarsh.ruff",
"eamodio.gitlens",
"ms-toolsai.jupyter"
"ms-toolsai.jupyter",
"be5invis.toml"
]
}
}
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/post_create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ echo "Installing dev & test dependencies..."
--file="$SRC_CONDA/tests/requirements-Linux.txt" \
--file="$SRC_CONDA/tests/requirements-s3.txt" \
--file="$SRC_CONDA_LIBMAMBA_SOLVER/dev/requirements.txt" \
--file="$SRC_CONDA_LIBMAMBA_SOLVER/tests/requirements.txt"
--file="$SRC_CONDA_LIBMAMBA_SOLVER/tests/requirements.txt"\
pre-commit
31 changes: 23 additions & 8 deletions .devcontainer/post_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,30 @@ function develop-mamba() (
echo "Miniconda not compatible with develop-mamba"
exit 1
fi
if [ ! -f "$SRC_MAMBA/mamba/setup.py" ]; then
echo "Mamba 1.x not found at $SRC_MAMBA"
if [ ! -f "$SRC_MAMBA/libmamba/CMakeLists.txt" ]; then
echo "Could not find mamba-org/mamba at $SRC_MAMBA"
exit 1
fi
if [ -f "$SRC_MAMBA/mamba/setup.py" ]; then
echo "Mamba 1.x found at $SRC_MAMBA"
mamba_version=1
environment_yaml="$SRC_MAMBA/mamba/environment-dev.yml"
else
echo "Mamba 2.x found at $SRC_MAMBA"
environment_yaml="$SRC_MAMBA/dev/environment-dev.yml"
mamba_version=2
fi
# Install mamba dev dependencies only once:
if [ ! -f ~/.mamba-develop-installed ]; then
# remove "sel(win)" in environment yaml hack since conda does not understand
# libmamba specific specs
echo "Installing mamba 1.x in dev mode..."
sed '/sel(.*)/d' "$SRC_MAMBA/mamba/environment-dev.yml" > /tmp/mamba-environment-dev.yml
CONDA_QUIET=1 "$BASE_CONDA/condabin/conda" env update -p "$BASE_CONDA" \
--file /tmp/mamba-environment-dev.yml
"$BASE_CONDA/condabin/conda" install make -yq # missing in mamba's dev env
sed '/sel(.*)/d' "\$environment_yaml" > /tmp/mamba-environment-dev.yml
# Environment.yml is missing make
echo " - make" >> /tmp/mamba-environment-dev.yml
"$BASE_CONDA/condabin/conda" env update \
--quiet \
--prefix "$BASE_CONDA" \
--file /tmp/mamba-environment-dev.yml
# Clean build directory to avoid issues with stale build files
test -f "$SRC_MAMBA/build/CMakeCache.txt" && rm -rf "$SRC_MAMBA/build"
fi
Expand All @@ -54,7 +65,11 @@ function develop-mamba() (
make install -C build/
cd -
"$BASE_CONDA/bin/pip" install -e "$SRC_MAMBA/libmambapy/" --no-deps
test -f "$BASE_CONDA/conda-meta/mamba-"*".json" && "$BASE_CONDA/bin/pip" install -e "$SRC_MAMBA/mamba/" --no-deps
if [ "\$mamba_version" == "1" ]; then
test -f "$BASE_CONDA/conda-meta/mamba-"*".json" && "$BASE_CONDA/bin/pip" install -e "$SRC_MAMBA/mamba/" --no-deps
else
echo "Mamba binary installation not supported yet"
fi
touch ~/.mamba-develop-installed || true
)
EOF
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/builds-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
subdir: ${{ matrix.subdir }}
anaconda-org-channel: conda-canary
anaconda-org-label: '${{ github.event.repository.name }}-pr-${{ github.event.number }}'
anaconda-org-token: ${{ secrets.CONDA_CANARY_ANACONDA_ORG_TOKEN }}
anaconda-org-token: ${{ secrets.ANACONDA_ORG_CONDA_CANARY_TOKEN }}
jaimergp marked this conversation as resolved.
Show resolved Hide resolved
comment-headline: 'Review build status'
comment-token: ${{ secrets.CANARY_ACTION_TOKEN }}
conda-build-arguments: '--override-channels -c conda-forge -c defaults'
conda-build-arguments: '--override-channels -c conda-forge/label/mamba_dev -c conda-forge'
20 changes: 10 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ jobs:
fail-fast: false
matrix:
# test lower version (w/ defaults) and upper version (w/ defaults and conda-forge)
python-version: ['3.8', '3.11', '3.12'] # CONDA-LIBMAMBA-SOLVER CHANGE
python-version: ['3.9', '3.11', '3.12'] # CONDA-LIBMAMBA-SOLVER CHANGE
default-channel: [defaults, conda-forge]
test-type: [conda-libmamba-solver, unit, integration] # CONDA-LIBMAMBA-SOLVER CHANGE
test-group: [1, 2, 3]
exclude:
- default-channel: conda-forge
python-version: '3.8'
python-version: '3.9'
- default-channel: defaults # CONDA-LIBMAMBA-SOLVER CHANGE
python-version: '3.11' # CONDA-LIBMAMBA-SOLVER CHANGE
- default-channel: conda-forge # CONDA-LIBMAMBA-SOLVER CHANGE
Expand Down Expand Up @@ -223,13 +223,11 @@ jobs:
fail-fast: false
matrix:
# test all lower versions (w/ defaults) and upper version (w/ defaults and conda-forge)
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
default-channel: [defaults, conda-forge]
test-type: [conda-libmamba-solver, unit, integration] # CONDA-LIBMAMBA-SOLVER CHANGE
test-group: [1, 2, 3]
exclude:
- python-version: '3.8'
default-channel: conda-forge
- python-version: '3.9'
default-channel: conda-forge
- python-version: '3.10'
Expand Down Expand Up @@ -283,7 +281,8 @@ jobs:

- name: Conda Install
working-directory: conda
run: conda install
run: >
conda install
--yes
--file tests/requirements.txt
--file tests/requirements-${{ runner.os }}.txt
Expand Down Expand Up @@ -496,19 +495,19 @@ jobs:
matrix:
# test lower version (w/ osx-64 & defaults & unit tests) and upper version (w/ osx-arm64 & conda-forge & integration tests)
arch: [osx-64, osx-arm64]
python-version: ['3.8', '3.11']
python-version: ['3.9', '3.12']
default-channel: [defaults, conda-forge]
test-type: [conda-libmamba-solver, unit, integration] # CONDA-LIBMAMBA-SOLVER CHANGE
test-group: [1, 2, 3]
exclude:
- arch: osx-64
python-version: '3.11'
python-version: '3.12'
- arch: osx-64
default-channel: conda-forge
- arch: osx-64
test-type: integration
- arch: osx-arm64
python-version: '3.8'
python-version: '3.9'
- arch: osx-arm64
default-channel: defaults
- arch: osx-arm64
Expand Down Expand Up @@ -565,7 +564,8 @@ jobs:
- name: Conda Install
working-directory: conda # CONDA-LIBMAMBA-SOLVER CHANGE
# CONDA-LIBMAMBA-SOLVER CHANGE: add conda-libmamba-solver requirements.txt
run: conda install
run: >
conda install
--yes
--file tests/requirements.txt
--file tests/requirements-ci.txt
Expand Down
56 changes: 28 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ ci:
# generally speaking we ignore all vendored code as well as tests data
exclude: |
(?x)^(
tests/data/ |
tests/data/.* |
conda_libmamba_solver/mamba_utils\.py
)/
)$
repos:
# generic verification and formatting
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand All @@ -18,46 +19,45 @@ repos:
# ensure syntaxes are valid
- id: check-toml
- id: check-yaml
exclude: ^(recipe/meta.yaml|tests/data/)
exclude: |
(?x)^(
(conda\.)?recipe/meta.yaml
)
# catch git merge/rebase problems
- id: check-merge-conflict
- repo: https://github.com/asottile/pyupgrade
rev: v3.18.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]
exclude: ^conda/exports.py
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
exclude: tests/_reposerver\.py
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
exclude: tests/_reposerver\.py
- repo: https://github.com/asottile/blacken-docs
rev: 1.19.0
hooks:
# auto format Python codes within docstrings
- id: blacken-docs
jaimergp marked this conversation as resolved.
Show resolved Hide resolved
additional_dependencies: [black]
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
hooks:
- id: flake8
- repo: https://github.com/PyCQA/pylint
rev: v3.3.1
# lint & attempt to correct failures (e.g. pyupgrade)
- id: ruff
args: [--fix]
# compatible replacement for black
- id: ruff-format
- repo: meta
# see https://pre-commit.com/#meta-hooks
hooks:
- id: pylint
args: [--exit-zero]
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/PyCQA/bandit
rev: 1.7.10
hooks:
- id: bandit
args: [--exit-zero]
# ignore all tests, not just tests data
exclude: ^tests/
exclude: ^(tests/)
jaimergp marked this conversation as resolved.
Show resolved Hide resolved
- repo: local
hooks:
- id: git-diff
name: git diff
entry: git diff --exit-code
language: system
pass_filenames: false
always_run: true
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
Expand Down
16 changes: 3 additions & 13 deletions conda_libmamba_solver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,10 @@
except ImportError:
__version__ = "0.0.0.unknown"

from warnings import warn as _warn

from .solver import LibMambaSolver


def get_solver_class(key="libmamba"):
def get_solver_class(key: str = "libmamba"):
if key == "libmamba":
return LibMambaSolver
if key == "libmamba-draft":
_warn(
"The 'libmamba-draft' solver has been deprecated. "
"The 'libmamba' solver will be used instead. "
"Please consider updating your code to remove this warning. "
"Using 'libmamba-draft' will result in an error in a future release.",
)
from .solver import LibMambaSolver

return LibMambaSolver
raise ValueError("Key must be 'libmamba'")
1 change: 1 addition & 0 deletions conda_libmamba_solver/conda_build_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
conda_build is not a dependency, but we only import this when conda-build is calling the
solver, so it's fine to import it here.
"""

from conda_build.exceptions import DependencyNeedsBuildingError


Expand Down
4 changes: 4 additions & 0 deletions conda_libmamba_solver/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Copyright (C) 2022 Anaconda, Inc
# Copyright (C) 2023 conda
# SPDX-License-Identifier: BSD-3-Clause
"""
Exceptions used in conda-libmamba-solver
"""

from conda.exceptions import UnsatisfiableError


Expand Down
Loading
Loading