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

Not working out of the box with cmd #39

Open
tdegeus opened this issue Feb 24, 2022 · 6 comments
Open

Not working out of the box with cmd #39

tdegeus opened this issue Feb 24, 2022 · 6 comments

Comments

@tdegeus
Copy link
Contributor

tdegeus commented Feb 24, 2022

Currently I need to activate the conda environment by hand on the cmd shell. Here are my instructions

    strategy:
      fail-fast: false
      matrix:
        runs-on: [windows-latest]

    name: ${{ matrix.runs-on }} • x64 ${{ matrix.args }} • py
    runs-on: ${{ matrix.runs-on }}

    steps:

    - name: Basic GitHub action setup
      uses: actions/checkout@v2

    - name: Set conda environment
      uses: mamba-org/provision-with-micromamba@main
      with:
        environment-file: environment.yaml
        environment-name: myenv

    - name: Build and install Python module
      shell: cmd /C CALL {0}
      run: |
        call micromamba activate myenv
        python -m pip install . -vv
@tdegeus
Copy link
Contributor Author

tdegeus commented Mar 4, 2022

I'm really not an expert on this, but I did create a reproducer that, when merged, should check for this in the future:

#43

@jonashaag
Copy link
Collaborator

Why does this GHA step fail and abort the rest of the run: code, but the job still continues and eventually succeeds? https://github.com/mamba-org/provision-with-micromamba/runs/6408495202?check_suite_focus=true

- name: run python in cmd.exe

@xhochy
Copy link

xhochy commented Feb 7, 2023

I'm also hitting this issue in blue-yonder/turbodbc#380. From peeking at the source code of setup-miniconda, I can see that they append auto-activation to conda_hook.bat: https://github.com/conda-incubator/setup-miniconda/blob/7e642bb2e4ca56ff706818a0febf72bb226d348d/src/conda.ts#L259

Thus the fix should be that we add a similar statement to C:\Users\runneradmin\micromamba-root\condabin\mamba_hook.bat as part of the action.

@jonashaag
Copy link
Collaborator

jonashaag commented Feb 7, 2023

Btw, I tend to not use activation anymore (in CI and on my local machines) because it simply causes too much trouble. I use micromamba run and micromamba shell (which we broke in 1.3.0 :-()

@xhochy
Copy link

xhochy commented Feb 7, 2023

I have a serious of commands which all need to run with CMD activation. There activation (and not mm run) is much more convenient to write.

@jdblischak
Copy link

Conveniently migrating to the newer mamba-org/setup-micromamba allowed me to drop the hacky workaround (call micromamba activate <env>) to manually activate the conda env in each step

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 a pull request may close this issue.

4 participants