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

docs: Document that mamba 2 only supports trailing globs in version strings #3783

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jdblischak
Copy link
Contributor

Mamba 1 supported leading and internal globs in version strings (eg *.0.0 and 0.*.0 respectively). Mamba 2 only supports trailing globs. This PR documents this breaking change.

xref: #3601 (comment)

Here is a demonstration using libmambapy 2.0.5:

import libmambapy

libmambapy.version.version_info
## ('2', '0', '5')

import libmambapy.specs as specs

specs.VersionSpec.parse("0.0.*")
specs.VersionSpec.parse("0.*.0")
specs.VersionSpec.parse("*.0.0")
## Traceback (most recent call last):
##   File "<stdin>", line 1, in <module>
## libmambapy.bindings.specs.ParseError: Found invalid version predicate in "*.0.0"

# Trailing glob works as expected
specs.VersionSpec.parse("0.0.*").contains(specs.Version.parse("0.0.1"))
## True
specs.VersionSpec.parse("0.0.*").contains(specs.Version.parse("1.0.0"))
## False

# Internal glob accepted but does not work
specs.VersionSpec.parse("0.*.0").contains(specs.Version.parse("0.1.0"))
## False
specs.VersionSpec.parse("0.*.0").contains(specs.Version.parse("1.0.0"))
## False

Here is a comparison of micromamba 2.0.5 versus 1.5.12:

docker run --rm -it ubuntu:24.10 bash
apt-get update
apt-get install --yes curl
"${SHELL}" <(curl -L micro.mamba.pm/install.sh)
## Micromamba binary folder? [~/.local/bin]
## Init shell (bash)? [Y/n] Y
## Configure conda-forge? [Y/n] Y
## Prefix location? [~/micromamba]
source ~/.bashrc
micromamba --version
## 2.0.5

micromamba --dry-run create -p test python=3.10.*
## + python               3.10.16  he725a3c_1_cpython  conda-forge      25MB
micromamba --dry-run create -p test python=3.*.16
## error    libmamba Could not solve for environment specs
##     The following package could not be installed
##     └─ python =3.0*.16 * does not exist (perhaps a typo or a missing channel).
## critical libmamba Could not solve for environment specs
micromamba --dry-run create -p test python=*.10.16
## error    libmamba Could not solve for environment specs
##     The following package could not be installed
##     └─ python =0*.10.16 * does not exist (perhaps a typo or a missing channel).
## critical libmamba Could not solve for environment specs

micromamba self-update --version 1.5
## Installing micromamba version: 1.5.12 (currently installed 2.0.5)
micromamba --version
## 1.5.12

micromamba --dry-run create -p test python=3.10.*
## + python               3.10.16  he725a3c_1_cpython  conda-forge      25MB
micromamba --dry-run create -p test python=3.*.16
## + python               3.10.16  he725a3c_1_cpython  conda-forge      25MB
micromamba --dry-run create -p test python=*.10.16
## + python               3.10.16  he725a3c_1_cpython  conda-forge      25MB

@jdblischak jdblischak changed the title Document that mamba 2 only supports trailing globs in version strings docs: document that mamba 2 only supports trailing globs in version strings Jan 29, 2025
@jdblischak jdblischak changed the title docs: document that mamba 2 only supports trailing globs in version strings docs: Document that mamba 2 only supports trailing globs in version strings Jan 30, 2025
Copy link
Member

@Hind-M Hind-M left a comment

Choose a reason for hiding this comment

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

Thank you @jdblischak for opening this!

@@ -40,6 +40,9 @@ Breaking changes include:
- A new config ``order_solver_request`` (default true) can be used to order the dependencies passed
to the solver, getting order independent solutions.
- Support for complex match specs such as ``pkg[md5=0000000000000]`` and ``pkg[build='^\d*$']``.
- Dropped support for leading and internal globs in version strings (via
redesigned ``VersionSpec``, which no longer handles version strings as a
regex). Only trailing globs continue to be supported.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure we should advertise that leading and internal globs are definitely dropped as they may be supported later on...
An opinion @JohanMabille?

Copy link
Member

@JohanMabille JohanMabille Feb 3, 2025

Choose a reason for hiding this comment

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

Indeed, this is more a regression that we want to fix shortly than a voluntary drop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I appreciate that the plan is to fix this regression (and I would love that!), but mamba 2 was released about 4 months ago. Thus I think we need to better document this regression since this change in behavior was unexpected (eg #3601). Some ideas:

  • What if we created a new Issue (something like "bug: fix leading and internal globs in version strings") and then pin that to the top of the Issues page?
  • I could update the language in this PR to clarify that this breaking change is a temporary regression. Would that work? While it is only temporary, I feel like it deserves to be documented somewhere in the list of breaking changes.

Copy link
Member

Choose a reason for hiding this comment

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

@jdblischak Yes the comments were only meant to say that we shouldn't document that this is dropped, only that it's a regression that we are aiming to fix. But it's definitely worth documenting!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hind-M @JohanMabille I have updated the language to reflect the fact that this breaking change was unintentional and only temporary. I'm happy to update it further based on your preferred phrasing.

@Hind-M Hind-M added the release::ci_docs For PRs related to CI or documentation label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release::ci_docs For PRs related to CI or documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants