pdm-project / setup-pdm

A GitHub Action that installs pdm properly for all Python versions
MIT License
84 stars 16 forks source link

github action cannot install pdm if python-venv is not installed #50

Open jiyoonlim123 opened 7 months ago

jiyoonlim123 commented 7 months ago

I tried setup-python with python3.8 and server without python3.8-venv, It shows following errors.

Steps to reproduce

workflow.yml

- name: Setup PDM
  uses: pdm-project/setup-pdm@v4
  with:
       python-version: 3.8

Actual Behavior

Installing PDM (2.12.3): Creating virtual environment
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python3.8-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/github/home/.local/share/pdm/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

Error: The process '/usr/bin/python3' failed with exit code 1

Expected behavior

A successful PDM setup / installation step in the workflow.

Environment Information

kien-truong commented 3 weeks ago

This can be work-arounded by setting up Python actions/setup-python@v5, then let pdm-project/setup-pdm@v4 re-use.

  steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Setup python
      uses: actions/setup-python@v5
      with:
        python-version: '3.8'

    - name: Setup PDM
      uses: pdm-project/setup-pdm@v4