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

BUG: fix extraction of conda version #1428

Merged
merged 5 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 7 additions & 2 deletions asv/plugins/conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import contextlib
from pathlib import Path

from packaging.version import Version

from .. import environment, util
from ..console import log

Expand Down Expand Up @@ -147,10 +149,13 @@ def _setup(self):
try:
env_file_name = self._conda_environment_file or env_file.name

conda_version = self._run_conda(['--version'], env=env)
conda_version = re.search(
r'\d+(\.\d+)+',
self._run_conda(['--version'], env=env)
)[0]
log.info(f"conda version: {conda_version}")
# https://conda.io/projects/conda/en/latest/release-notes.html#id8
if conda_version >= "24.3.0":
if Version(conda_version) >= Version("24.3.0"):
self._run_conda(['env', 'create', '-f', env_file_name,
'-p', self._path, "--yes"],
env=env)
Expand Down
1 change: 1 addition & 0 deletions docs/source/credits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ The rest of the contributors are listed in alphabetical order.
- Rok Mihevc
- Sayed Adel
- serge-sans-paille
- Sofía Miñano
- Sourcery AI
- Thomas Pfaff
- Thomas Robitaille
Expand Down
Loading