Skip to content

Releases: actions/setup-python

v4.1.0

11 Jul 14:03
c4e89fa
Compare
Choose a tag to compare

In scope of this pull request we updated actions/cache package as the new version contains fixes for caching error handling. Moreover, we added a new input update-environment. This option allows to specify if the action shall update environment variables (default) or not.

Update-environment input

    - name: setup-python 3.9
      uses: actions/setup-python@v4
      with:
        python-version: 3.9
        update-environment: false

Besides, we added such changes as:

  • Allow python-version-file to be a relative path: #431
  • Added new environment variables for Cmake: #440
  • Updated error message for resolveVersion: #450
  • Assign default value of AGENT_TOOLSDIRECTORY if not set: #394

v4.0.0

08 Jun 14:24
d09bd5e
Compare
Choose a tag to compare

What's Changed

  • Support for python-version-file input: #336

Example of usage:

- uses: actions/setup-python@v4
  with:
    python-version-file: '.python-version' # Read python version from a file
- run: python my_script.py

There is no default python version for this setup-python major version, the action requires to specify either python-version input or python-version-file input. If the python-version input is not specified the action will try to read required version from file from python-version-file input.

  • Use pypyX.Y for PyPy python-version input: #349

Example of usage:

- uses: actions/setup-python@v4
  with:
    python-version: 'pypy3.9' # pypy-X.Y kept for backward compatibility
- run: python my_script.py
  • RUNNER_TOOL_CACHE environment variable is equal AGENT_TOOLSDIRECTORY: #338

  • Bugfix: create missing pypyX.Y symlinks: #347

  • PKG_CONFIG_PATH environment variable: #400

  • Added python-path output: #405
    python-path output contains Python executable path.

  • Updated zeit/ncc to vercel/ncc package: #393

  • Bugfix: fixed output for prerelease version of poetry: #409

  • Made pythonLocation environment variable consistent for Python and PyPy: #418

  • Bugfix for 3.x-dev syntax: #417

  • Other improvements: #318 #396 #384 #387 #388

Update actions/cache version to 2.0.2

11 Apr 14:01
98f2ad0
Compare
Choose a tag to compare

In scope of this release we updated actions/cache package as the new version contains fixes related to GHES 3.5 (#382)

Add "cache-hit" output and fix "python-version" output for PyPy

07 Apr 08:32
21c0493
Compare
Choose a tag to compare

This release introduces new output cache-hit (#373) and fix python-version output for PyPy (#365)

The cache-hit output contains boolean value indicating that an exact match was found for the key. It shows that the action uses already existing cache or not. The output is available only if cache is enabled.

The python-version contains version of Python or PyPy.

Support caching poetry dependencies and caching on GHES 3.5

01 Apr 11:24
9c644ca
Compare
Choose a tag to compare
steps:
- uses: actions/checkout@v3
- name: Install poetry
  run: pipx install poetry
- uses: actions/setup-python@v3
  with:
    python-version: '3.9'
    cache: 'poetry'
- run: poetry install
- run: poetry run pytest

v3.0.0

28 Feb 10:30
0ebf233
Compare
Choose a tag to compare

What's Changed

  • Update default runtime to node16 (#340)
  • Update package-lock.json file version to 2, @types/node to 16.11.25 and typescript to 4.2.3 (#341)
  • Remove legacy pypy2 and pypy3 keywords (#342)

Breaking Changes

With the update to Node 16, all scripts will now be run with Node 16 rather than Node 12.

This new major release removes support of legacy pypy2 and pypy3 keywords. Please use more specific and flexible syntax to specify a PyPy version:

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version:
        - 'pypy-2.7' # the latest available version of PyPy that supports Python 2.7
        - 'pypy-3.8' # the latest available version of PyPy that supports Python 3.8
        - 'pypy-3.8-v7.3.8' # Python 3.8 and PyPy 7.3.8
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-python@v3
      with:
        python-version: ${{ matrix.python-version }}

See more usage examples in the documentation

Update primary and restore keys for pip

04 Feb 11:10
7f80679
Compare
Choose a tag to compare

In scope of this release we include a version of python in restore and primary cache keys for pip. Besides, we add temporary fix for Windows caching issue, that the pip cache dir command returns non zero exit code or writes to stderr. Moreover we updated node-fetch dependency.

Update actions/cache version to 1.0.8

29 Nov 12:10
f382193
Compare
Choose a tag to compare

We have updated actions/cache dependency version to 1.0.8 to support 10GB cache upload

Support caching dependencies

17 Nov 12:53
0066b88
Compare
Choose a tag to compare

This release introduces dependency caching support (#266)

Caching dependencies.

The action has a built-in functionality for caching and restoring pip/pipenv dependencies. The cache input is optional, and caching is turned off by default.

Besides, this release introduces dependency caching support for mono repos and repositories with complex structure.

By default, the action searches for the dependency file (requirements.txt for pip or Pipfile.lock for pipenv) in the whole repository. Use the cache-dependency-path input for cases when you want to override current behaviour and use different file for hash generation (for example requirements-dev.txt). This input supports wildcards or a list of file names for caching multiple dependencies.

Caching pip dependencies:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
  with:
    python-version: '3.9'
    cache: 'pip'
- run: pip install -r requirements.txt
- run: pip test

Caching pipenv dependencies:

steps:
- uses: actions/checkout@v2
- name: Install pipenv
  run: pipx install pipenv
- uses: actions/setup-python@v2
  with:
    python-version: '3.9'
    cache: 'pipenv'
- run: pipenv install
- run: pipenv test

Change dependency file:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
  with:
    python-version: '3.9'
    cache: 'pip'
    cache-dependency-path: '**/requirements-dev.txt'
- run: pip install -r subdirectory/requirements-dev.txt
- run: pip test

v2.2.2

12 Apr 19:02
dc73133
Compare
Choose a tag to compare

Address PyPy installation issues on Windows: #196