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

Conversation

sfmig
Copy link
Contributor

@sfmig sfmig commented Aug 17, 2024

When creating a conda environment, the conda version is checked to determine the syntax of the command.

However, the version is currently extracted incorrectly. The command conda --version returns conda xx.xx.xx rather than the version string xx.xx.xx as the code assumes.

As a result, for conda version 23.3.1, we have conda_version = "conda 23.3.1" and conda_version >= "24.3.0" is evaluated as True, when it should be False.

This PR:

  • adds a regexp to extract the conda version from the output of the conda --version command, and
  • uses packaging.version.Version for a safer comparison of version strings.

It also pins setuptools following the recommendation given in PR #1426 to ensure CI passes.

Question:
Should we test that environments are created correctly for different conda versions?

@sfmig sfmig force-pushed the sfmig/fix-conda-version branch from dd1525b to d8c398a Compare August 17, 2024 22:20
@sfmig sfmig marked this pull request as ready for review August 17, 2024 23:26
Copy link
Member

@HaoZeke HaoZeke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks, could you add yourself to the author list as well? That'd be in docs/source/credits.rst

@HaoZeke
Copy link
Member

HaoZeke commented Aug 26, 2024

Also, my apologies, I didn't see the question earlier, a test would be nice, but I think it can be added in later in a follow up (since I'm cutting a bugfix release now).

@HaoZeke HaoZeke merged commit b0ae9d4 into airspeed-velocity:main Aug 26, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants