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

PIP_NO_PYTHON_VERSION_WARNING not honored #575

Closed
4 of 5 tasks
andy-maier opened this issue Dec 25, 2022 · 4 comments
Closed
4 of 5 tasks

PIP_NO_PYTHON_VERSION_WARNING not honored #575

andy-maier opened this issue Dec 25, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@andy-maier
Copy link

andy-maier commented Dec 25, 2022

Description:

The setup-python action invokes pip. On Python 2.7 and 3.5, the pip invocation displays a Python deprecation message:

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as
Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. 
More details about Python 2support in pip, can be found at
https://pip.pypa.io/en/latest/development/release-process/#python-2-support

That warning shows up in the actions summary and clutters up the summary. We do know that Python 2.7 is deprecated and still need to support it, so we are interested in real information in the summary. The same happens on Python 3.5.

When running pip locally, it is possible to disable that warning by setting the environment variable:

PIP_NO_PYTHON_VERSION_WARNING=1

However, setting that environment variable in the workflow step that invokes the setup-python action lists the variable, but the warning is still shown.

Here is the workflow step with the variable:

    - name: Set up Python ${{ matrix.python-version }}
      env:
        PIP_DISABLE_PIP_VERSION_CHECK: 1
        PIP_NO_PYTHON_VERSION_WARNING: 1
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}

By the way, the env var PIP_DISABLE_PIP_VERSION_CHECK=1 works as expected with the setup-python action.

Action version:
v4

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

Python 2.7

Repro steps:

  • Use the setup-python action in a workflow with Python 2.7 to see the deprecation warning.
  • Set the env var PIP_NO_PYTHON_VERSION_WARNING=1 for that workflow step, and the deprecation warning is still there.
  • Run pip locally on Python 2.7 with that env var, end the deprecation warning is gone.

Expected behavior:

The env var PIP_NO_PYTHON_VERSION_WARNING=1 should be honored.

Actual behavior:
See above

@MaksimZhukov
Copy link
Contributor

Hello @andy-maier ! Thank you for reporting this!
We will investigate the issue and get back to you as soon as we have updates.

@dsame dsame self-assigned this Dec 28, 2022
@dsame
Copy link
Contributor

dsame commented Jan 4, 2023

Hello @andy-maier ,

The warning is produced by the command python -m ensurepip used during the setting up python. For some reason it ignores the environment variables:

https://github.com/akv-demo/setup-python-test/actions/runs/3841397258/jobs/6541566545#step:3:28

          echo $PIP_DISABLE_PIP_VERSION_CHECK
          echo $PIP_NO_PYTHON_VERSION_WARNING
          ${pythonLocation}/python -m ensurepip

@dsame
Copy link
Contributor

dsame commented Jan 16, 2023

Hello @andy-maier , i am going to close this issue because it does not relate to the action, but feel free to reopen the issue or create a new one in case if the problem exists.

@dsame dsame closed this as completed Jan 16, 2023
@andy-maier
Copy link
Author

andy-maier commented Mar 5, 2023

The env vars were introduced in pip 20.0 (I think), and I assume it happens because before the upgrade of pip, it is below that version. After the upgrade (e.g. in the rest of my workflow), the env vars are honored and the warning is not shown.

I agree with closing the issue. Thanks for investigating!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants