VaultVulp / action-pipenv

Use pipenv commands in your GitHub Actions Workflow
MIT License
33 stars 9 forks source link

Support actions/setup-python #2

Open gennaro-tedesco opened 2 years ago

gennaro-tedesco commented 2 years ago

I am using action-pipenv in conjunction with actions/setup-python, but it seems that the correct python version is not detected. In particular consider the following excerpt of an action workflow file (only responsible parts are indicated):

...
...
    steps:
      - name: Setup python version
        uses: actions/setup-python@v2
        with:
          python-version: '3.7'

    - name: Install dependencies
          uses: VaultVulp/action-pipenv@v2.0.1
          with:
            command: install -d

using a Pipfile of the form

[requires]
python_version = "3.7"

This generates the error

Run VaultVulp/action-pipenv@v2.0.1
  with:
    command: install --dev --deploy
  env:
    pythonLocation: /__w/_tool/Python/3.7.12/x64
    LD_LIBRARY_PATH: /__w/_tool/Python/3.7.12/x64/lib
...
...
Warning: Python 3.7 was not found on your system...
Neither 'pyenv' nor 'asdf' could be found to install Python.
You can specify specific versions of Python with:
$ pipenv --python path/to/python

However, if instead I manually install pipenv without making use of action-pipenv, the correct python version is indeed detected.

Could this be because the actions install pipenv by making use of a generic python image (and if so, why not installing pipenv making use of the available python versions already installed on the instances)?

Amrhub commented 1 year ago

@gennaro-tedesco I could see this issue was opened a year ago but I ran into the same issue. Could you please share with me how you overcame it?

gennaro-tedesco commented 1 year ago

Could you please share with me how you overcame it?

I didn't overcome it: I switched to another package manager.

Amrhub commented 1 year ago

Thanks for your response. @gennaro-tedesco Which package manager did you use, is it easy to integrate? I have been looking for hours and hours for a solution, I don't mind alternative

gennaro-tedesco commented 1 year ago

About the action workflow I ended up using installations in docker containers; about the more general question about package managers another alternative is poetry: whether or not it is easier to integrate with GitHub actions, I don't know.