Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .ci/micromamba/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ if [[ "$VERBOSE" -ge 2 ]]; then
micromamba info
fi

# Clean up previous environment
info "Cleaning up previous environment [$ENV_NAME]..."
chmod -R +w $THIS_DIR/micromamba/envs/dev
rm -rf $THIS_DIR/micromamba/envs/dev
micromamba deactivate
# Create environment
info "Creating environment [$ENV_NAME]..."
micromamba deactivate
micromamba create --file $THIS_DIR/$ENV_NAME.yaml --name $ENV_NAME --yes $MAMBA_VERBOSITY
# micromamba config set env_prompt "[{name}] "
micromamba activate $ENV_NAME
Expand Down
13 changes: 12 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,15 @@ test/test.sh | Functional and unit test runner
Submitting a patch and testing
-------

Before submitting any changes please make sure all tests and checks are passed, pylint doesn't show warnings on new code, and fill out the Pull Request template. If you are a new contributor, and the template is confusing, feel free to submit the PR and we will help you iron it out! On how to run or add a new test, please see [test/README.md](test/README.md).
Before submitting any changes please make sure all tests and checks are passed.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm sure, before running anything we must crealy describe how to initialize the environment.
See Development Environment above


You must run the following tests locally:
* `pylint .`
* `bazel test //...`
* `pytest test`


On how to run or add a new test, please see [test/README.md](test/README.md).


Finally, fill out the Pull Request template. If you are a new contributor, and the template is confusing, feel free to submit the PR and we will help you iron it out!
13 changes: 13 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
echo "Initialize micromamba environment..."
source ./.ci/micromamba/init.sh
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I had previous micromamba dev env in .ci/micromamba/micromamba
so init immediately failed with:

critical libmamba Non-conda folder exists at prefix - aborting.

I had to remove it completely to unlock.
So... we should work on how to make it robust

Copy link
Copy Markdown
Contributor Author

@furtib furtib May 15, 2026

Choose a reason for hiding this comment

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

So just to be sure:
You had a previous micromamba environment, which you used without the script, then when running the script the first time you got this error.

This issue did not return when using the script multiple times, right?

In that case, I believe this error was the exact reason for adding the cleanup trap in the script.
I know that this solution is not ideal, in that sense, micromamba used outside the script (exited without running bazel clean) will cause this error to emerge, but I'm not sure how I could force users to run bazel clean before running micromamba deactivate (or killing their terminal).

I'm open to any idea on how to make it even just a bit more robust.

Copy link
Copy Markdown
Contributor Author

@furtib furtib May 15, 2026

Choose a reason for hiding this comment

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

I spent a lot of time seeing how I could make it even just a bit better, and came to the conclusion that deleting the environment is the best way to ensure it will work.

Maybe this cleanup is better placed in the init.sh file, so users are able to use the micromamba environment manually too.

This does not force micromamba to redownload all packages, those are cached under micromamba/pkgs.


echo "Running pylint..."
pylint .
echo "Running bazel test //..."
bazel test //...
echo "Running pytest ..."
pytest test

echo "Exiting micromamba..."
micromamba deactivate
Loading