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 1 commit 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?

@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.

2 participants