Skip to content

Commit

Permalink
Merge pull request #1428 from sfmig/sfmig/fix-conda-version
Browse files Browse the repository at this point in the history
BUG: fix extraction of conda version
  • Loading branch information
HaoZeke authored Aug 26, 2024
2 parents 95ce375 + bfaad98 commit b0ae9d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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

0 comments on commit b0ae9d4

Please sign in to comment.