Skip to content

Fix xonsh - #4366

Open
Hind-M wants to merge 7 commits into
mamba-org:mainfrom
Hind-M:fix_xonsh
Open

Fix xonsh#4366
Hind-M wants to merge 7 commits into
mamba-org:mainfrom
Hind-M:fix_xonsh

Conversation

@Hind-M

@Hind-M Hind-M commented Jul 29, 2026

Copy link
Copy Markdown
Member

Description

Fix #4235

Type of Change

  • Bugfix
  • Feature / enhancement
  • CI / Documentation
  • Maintenance

Checklist

  • My code follows the general style and conventions of the codebase, ensuring consistency
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run pre-commit run --all locally in the source folder and confirmed that there are no linter errors.
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes

@github-actions github-actions Bot added the release::bug_fixes For PRs fixing bugs label Jul 29, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 55.40%. Comparing base (df10fc2) to head (f815f3a).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
libmamba/src/core/activation.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4366      +/-   ##
==========================================
+ Coverage   55.38%   55.40%   +0.02%     
==========================================
  Files         243      243              
  Lines       30374    30383       +9     
  Branches     3257     3256       -1     
==========================================
+ Hits        16822    16835      +13     
+ Misses      13549    13545       -4     
  Partials        3        3              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Hind-M
Hind-M marked this pull request as ready for review July 31, 2026 13:50

@jjerphan jjerphan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM modulo a few nitpicks.

Comment thread micromamba/tests/test_activation.py Outdated
Comment thread micromamba/tests/test_activation.py Outdated
Comment on lines +981 to +986
# activate → manually delete var → deactivate
s = [
f"{alias} activate test_unset_env",
"del $MAMBA_UNSET_TEST",
f"{alias} deactivate",
]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we also try to use the -p flag to verify the support of this flag after the fix?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmm not sure I get what you mean.
So shell activate was using -p in mamba.xsh while it's supposed to be a positional argument. The fix is to call that command properly in the script, and the test for that is to check there is no warning anymore:
assert "does not contain any filesystem separator" not in stderr


prefix = tmp_root_prefix / "envs" / "test_unset_env"
state_file = prefix / "conda-meta" / "state"
state_file.write_text(helpers.json.dumps({"env_vars": {"MAMBA_UNSET_TEST": "hello"}}))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also do you think that it is possible to test the case where MAMBA_UNSET_TEST:

  • is set initially to some value (e.g. "hi")
  • is reset by the activation of test_unset_env to "hello"
  • is deleted under this environment
  • is reset to the original value ("hi") after the environment is deactivated?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think that would be testing restoring environment variables behavior with activation and deactivation, and therefore is a more general test.
I suggest to rather open an issue to check the existence of such tests and add them if not.

@jjerphan

jjerphan commented Aug 5, 2026

Copy link
Copy Markdown
Member

I propose to first release 2.9.0 before merging this PR and other ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release::bug_fixes For PRs fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Porting xonsh hook fixes from conda to mamba

2 participants