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

mamba env export --no-build --from-history changed format in v2 for packages with specified versions #3646

Open
3 tasks done
mathbunnyru opened this issue Dec 2, 2024 · 4 comments
Assignees
Labels
type::bug Something isn't working

Comments

@mathbunnyru
Copy link
Contributor

Troubleshooting docs

  • My problem is not solved in the Troubleshooting docs

Anaconda default channels

  • I do NOT use the Anaconda default channels (pkgs/* etc.)

How did you install Mamba?

Micromamba

Search tried in issue tracker

export

Latest version of Mamba

  • My problem is not solved with the latest version

Tried in Conda?

I do not have this problem with Conda, just with Mamba

Describe your issue

I installed notebook using: mamba install notebook>=7.2.2
Then exported the environment.

v2:

(base) jovyan@27933482a351:~$ mamba env export --no-build --json --from-history
{
  "channels": [
    "conda-forge"
  ],
  "dependencies": [
    "conda",
    "jupyter_core",
    "jupyterhub-singleuser",
    "jupyterlab",
    "mamba",
    "nbclassic",
    "notebook>=7.2.2",
    "python=3.12"
  ],
  "name": "base",
  "prefix": "/opt/conda"
}

v1:

(base) jovyan@c5da4bba1d79:~$ mamba env export --no-build --json --from-history
{
  "channels": [
    "conda-forge"
  ],
  "dependencies": [
    "jupyter_core",
    "mamba[version='<2.0.0']",
    "python=3.12",
    "jupyterhub-singleuser",
    "jupyterlab",
    "nbclassic",
    "notebook[version='>=7.2.2']",
    "ca-certificates",
    "certifi",
    "openssl"
  ],
  "name": "base",
  "prefix": "/opt/conda"

Note the line with notebook.

v2's output is not compatible with conda's output when some lib was installed specifying the version range

mamba info / micromamba info

No response

Logs

No response

environment.yml

No response

~/.condarc

No response

@mathbunnyru
Copy link
Contributor Author

mathbunnyru commented Dec 2, 2024

There might be tricky cases, I had to change this:
mamba v1: conda-forge::blas[build=openblas]
mamba v2: conda-forge::blas=*

@jjerphan
Copy link
Member

jjerphan commented Dec 4, 2024

Actually, while the current behavior is more consistent (since the --from-history is actually reusing the MatchSpec which have been typed), I think we can consider the change of behavior.

@jjerphan
Copy link
Member

jjerphan commented Dec 10, 2024

@mathbunnyru: I think this is an easy fix you can work on if you are interested.

A priori, one needs to modify this line to parse a string corresponding to the MatchSpec:

pkg_specs.push_back(std::move(match_spec));

@JohanMabille JohanMabille added the type::bug Something isn't working label Dec 11, 2024
@jjerphan
Copy link
Member

jjerphan commented Dec 12, 2024

Honestly, I think the current behavior is more consistent.

Note that:

MatchSpec::parse("notebook[version='>=7.2.2']").value().str() == "notebook>=7.2.2"

I do not think this needs to be addressed.

What is your perspective, @mathbunnyru?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants