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

Activated environment with windows and bash #5

Closed
galen1090 opened this issue Dec 23, 2019 · 3 comments
Closed

Activated environment with windows and bash #5

galen1090 opened this issue Dec 23, 2019 · 3 comments
Assignees
Labels
type:bug Something isn't working

Comments

@galen1090
Copy link

I'm doing some experiments with setup-miniconda, but I have a problem with the following code:

steps:
      - name: Checkout Repo
        uses: actions/checkout@master
      - uses: goanpeca/setup-miniconda@master
        with:
          auto-update-conda: false
          python-version: ${{ matrix.python-version }}  
          activate-environment: test-environment
          environment-file: environment.yml
          condarc-file: condarc.yml
          auto-activate-base: false
      - name: Flake8
        shell: bash -l {0}
        run: |
           conda env list
           flake8 src tests

environment.yml and condarc.yml are ok, all dependencies are installed and the environment test-environment is created correctly, but in the next step (Flake8), the activated environment is base and not test-environment if the os is windows and the shell is bash or sh. For example with linux/bash or windows/pwsh all works as expected.
If can be useful, this is .bash_profile on windows:

Run cat $HOME/.bash_profile

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
eval "$('/C/Miniconda/Scripts/conda.exe' 'shell.bash' 'hook')"
# <<< conda initialize <<<

As a quick hack, if I add the following step:

   - name: Activate `test-environment` (Windows)
        if: runner.os == 'Windows'
        run: echo "activate test-environment" >> ~/.bash_profile

the Flake8 step works.
Is that a normal behaviour? Maybe a bug?

Thanks.

@goanpeca
Copy link
Member

Hello @galen104 . Could you share with me the repo or the contents of condarc and env.yaml?

Thanks!

@goanpeca
Copy link
Member

Ok I think it is a bug. Let me make a new release to correct it ;-)

@goanpeca
Copy link
Member

goanpeca commented Dec 24, 2019

This has been fixed on v1.0.2 (Released already and v1 points to that release, so you can keep using v1 as Github docs suggest that)

You can also check the behavior here
https://github.com/goanpeca/setup-miniconda/pull/3/checks?check_run_id=361722111

Thanks for reporting. Working on tests to avoid this regression!

@goanpeca goanpeca self-assigned this Dec 24, 2019
@goanpeca goanpeca added the type:bug Something isn't working label Dec 24, 2019
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

2 participants