Skip to content

Conversation

Sanjaykumar030
Copy link

This PR improves the micromamba setup script used for Matplotlib development environments.

Changes include:

  • Adds version pinning and platform detection to make installation deterministic and avoid CI failures.
  • Uses session-only shell initialization to prevent permanent shell changes.
  • Creates or updates the environment from environment.yml with a safe --prune fallback.
  • Robust environment name extraction to handle quotes/spaces in YAML, with fallback to 'mpl-dev'.
  • Configures .condarc only if /opt/conda exists to avoid errors in minimal setups.
  • Provides clear instructions for activating the environment after installation.

These improvements make the script safer, more reproducible, and easier for contributors to use across different systems.

@rcomer
Copy link
Member

rcomer commented Sep 6, 2025

Thank you @Sanjaykumar030 for the potential contribution. I believe this script is intended for use with our GitHub Codespace configuration, where we can be confident of which OS we are using and what tools are available. Do you have a different use-case which requires it to be more general?

@Sanjaykumar030
Copy link
Author

Sanjaykumar030 commented Sep 6, 2025

Thanks @rcomer for the feedback! Even though this script is mainly for Codespaces, the changes—version pinning, platform detection, and robust env name handling—make it safer and more deterministic. They prevent potential CI failures if dependencies or environments change, and don’t affect the existing Codespaces setup.

@rcomer
Copy link
Member

rcomer commented Sep 6, 2025

Sorry, I am still not following what this is for. If we are happy that it is OK in the Codespace setup, where is it going to run and [potentially] not be OK?

@Sanjaykumar030
Copy link
Author

Sanjaykumar030 commented Sep 6, 2025

My main goal is to make our Codespaces CI more resilient. Pinning the version prevents a new micromamba release from unexpectedly breaking builds. As a bonus, this makes the script reliable for contributors replicating the environment locally. Without these changes, running the script outside Codespaces—on Linux/macOS/Windows—could fail due to version changes, unsupported platforms, or environment name parsing issues. These enhancements don’t affect Codespaces but make the setup safer and more deterministic.

@rcomer
Copy link
Member

rcomer commented Sep 6, 2025

What do you mean by "Codespaces CI"?

@Sanjaykumar030
Copy link
Author

By "Codespaces CI," I mean the automated setup process in Codespaces that builds and configures dev environments reliably, similar to CI for consistency in contributions.

@jorenham
Copy link

jorenham commented Sep 7, 2025

@rcomer you might want to take some other PR's of this author into consideration here, e.g.: scipy/scipy-stubs#862 (review)

@rcomer
Copy link
Member

rcomer commented Sep 7, 2025

Thanks @jorenham for confirming my suspicions.

Closing as probable AI spam.

@rcomer rcomer closed this Sep 7, 2025
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.

3 participants