Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Adhere to $VIRTUAL_ENV #156

Closed
Bengt opened this issue Jun 4, 2021 · 3 comments
Closed

Adhere to $VIRTUAL_ENV #156

Bengt opened this issue Jun 4, 2021 · 3 comments

Comments

@Bengt
Copy link

Bengt commented Jun 4, 2021

Hi!

I have all my virtual environments under venv, not .venv. So, I would like to configure this action to adhere to my convention.

Since restore-virtualenv already sets the $VIRTUAL_ENV environment variable, why not adhere to it, too? I could configure it like so:

      - name: Set VIRTUAL_ENV (Ubuntu | macOS)
        if: startsWith( matrix.os, 'ubuntu-' ) ||
            startsWith( matrix.os, 'macos-' )
        run: export VIRTUAL_ENV=venv

      - name: Set VIRTUAL_ENV (Windows)
        if: startsWith( matrix.os, 'windows-' )
        run: setx VIRTUAL_ENV venv

Alternatively, one could also introduce a with parameter to the action like so:

      - uses: syphar/restore-virtualenv@v1
        id: cache-virtualenv
        with:
          virtual_env: venv
@syphar
Copy link
Owner

syphar commented Jun 5, 2021

@Bengt while in my projects I just used the default and was fine with it, I can totally see that this can be useful.

Both respecting the environment, and having the with parameter could make sense.

I'm happy to review a PR for this topic, and provide help if you need it.

@damian-t
Copy link
Contributor

damian-t commented Aug 9, 2021

Opened a PR. No JS expert here, so happy for any kind of feedback.

@syphar
Copy link
Owner

syphar commented Jan 31, 2022

closing since #219 is merged

@syphar syphar closed this as completed Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants