Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f4b66de

Browse filesBrowse files
authored
Merge branch 'actions:main' into main
2 parents 65fe6a8 + 21c0493 commit f4b66de
Copy full SHA for f4b66de
Expand file treeCollapse file tree

29 files changed

+14363
-2343
lines changed

‎.github/workflows/check-dist.yml

Copy file name to clipboardExpand all lines: .github/workflows/check-dist.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v2
2525

26-
- name: Set Node.js 12.x
26+
- name: Set Node.js 16.x
2727
uses: actions/setup-node@v1
2828
with:
29-
node-version: 12.x
29+
node-version: 16.x
3030

3131
- name: Install dependencies
3232
run: npm ci

‎.github/workflows/codeql-analysis.yml

Copy file name to clipboardExpand all lines: .github/workflows/codeql-analysis.yml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: "Code scanning - action"
22

33
on:
44
push:
5+
branches: [ 'main' ]
56
pull_request:
67
schedule:
78
- cron: '25 3 * * 5'

‎.github/workflows/e2e-cache.yml

Copy file name to clipboardExpand all lines: .github/workflows/e2e-cache.yml
+37-11Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
os: [ubuntu-latest, windows-latest, macos-latest]
24-
python-version: ['3.8', '3.9', 'pypy-3.7-v7.x']
24+
python-version: ['3.9', 'pypy-3.7-v7.x']
2525
steps:
26-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v3
2727
- name: Setup Python
2828
uses: ./
2929
with:
@@ -39,9 +39,9 @@ jobs:
3939
fail-fast: false
4040
matrix:
4141
os: [ubuntu-latest, windows-latest, macos-latest]
42-
python-version: ['3.8', '3.9', 'pypy-3.7-v7.x']
42+
python-version: ['3.9', 'pypy-3.7-v7.x']
4343
steps:
44-
- uses: actions/checkout@v2
44+
- uses: actions/checkout@v3
4545
- name: Setup Python
4646
uses: ./
4747
with:
@@ -50,7 +50,31 @@ jobs:
5050
- name: Install pipenv
5151
run: pipx install pipenv
5252
- name: Install dependencies
53-
run: pipenv install numpy
53+
run: |
54+
cd __tests__/data
55+
pipenv install --verbose
56+
57+
python-poetry-dependencies-caching:
58+
name: Test poetry (Python ${{ matrix.python-version}}, ${{ matrix.os }})
59+
runs-on: ${{ matrix.os }}
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
os: [ubuntu-latest, windows-latest, macos-latest]
64+
python-version: ['3.9', 'pypy-3.7-v7.x']
65+
steps:
66+
- uses: actions/checkout@v3
67+
- name: Install poetry
68+
run: pipx install poetry
69+
- name: Setup Python
70+
uses: ./
71+
with:
72+
python-version: ${{ matrix.python-version }}
73+
cache: 'poetry'
74+
- name: Init pyproject.toml
75+
run: poetry init -n
76+
- name: Install dependencies
77+
run: poetry add flake8
5478

5579
python-pip-dependencies-caching-path:
5680
name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }})
@@ -59,9 +83,9 @@ jobs:
5983
fail-fast: false
6084
matrix:
6185
os: [ubuntu-latest, windows-latest, macos-latest]
62-
python-version: ['3.8', '3.9', 'pypy-3.7-v7.x']
86+
python-version: ['3.9', 'pypy-3.7-v7.x']
6387
steps:
64-
- uses: actions/checkout@v2
88+
- uses: actions/checkout@v3
6589
- name: Setup Python
6690
uses: ./
6791
with:
@@ -78,16 +102,18 @@ jobs:
78102
fail-fast: false
79103
matrix:
80104
os: [ubuntu-latest, windows-latest, macos-latest]
81-
python-version: ['3.8', '3.9', 'pypy-3.7-v7.x']
105+
python-version: ['3.9', 'pypy-3.7-v7.x']
82106
steps:
83-
- uses: actions/checkout@v2
107+
- uses: actions/checkout@v3
84108
- name: Setup Python
85109
uses: ./
86110
with:
87111
python-version: ${{ matrix.python-version }}
88112
cache: 'pipenv'
89-
cache-dependency-path: '**/requirements-linux.txt'
113+
cache-dependency-path: '**/pipenv-requirements.txt'
90114
- name: Install pipenv
91115
run: pipx install pipenv
92116
- name: Install dependencies
93-
run: pipenv install numpy
117+
run: |
118+
cd __tests__/data
119+
pipenv install --verbose

‎.github/workflows/licensed.yml

Copy file name to clipboardExpand all lines: .github/workflows/licensed.yml
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
name: Check licenses
1515
steps:
1616
- uses: actions/checkout@v2
17-
- name: Set Node.js 12.x
17+
- name: Set Node.js 16.x
1818
uses: actions/setup-node@v2
1919
with:
20-
node-version: 12.x
20+
node-version: 16.x
2121
- run: npm ci
2222
- name: Install licensed
2323
run: |
2424
cd $RUNNER_TEMP
25-
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.3.1/licensed-3.3.1-linux-x64.tar.gz
25+
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.4.4/licensed-3.4.4-linux-x64.tar.gz
2626
sudo tar -xzf licensed.tar.gz
2727
sudo mv licensed /usr/local/bin/licensed
2828
- run: licensed status

‎.github/workflows/test-python.yml

Copy file name to clipboardExpand all lines: .github/workflows/test-python.yml
-20Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,3 @@ jobs:
9191
- name: Run simple code
9292
run: python -c 'import math; print(math.factorial(5))'
9393

94-
setup-pypy-legacy:
95-
name: Setup PyPy ${{ matrix.os }}
96-
runs-on: ${{ matrix.os }}
97-
strategy:
98-
fail-fast: false
99-
matrix:
100-
os: [macos-10.15, windows-2019, ubuntu-18.04, ubuntu-20.04]
101-
steps:
102-
- name: Checkout
103-
uses: actions/checkout@v2
104-
105-
- name: setup-python pypy3
106-
uses: ./
107-
with:
108-
python-version: 'pypy3'
109-
110-
- name: setup-python pypy2
111-
uses: ./
112-
with:
113-
python-version: 'pypy2'

‎.github/workflows/workflow.yml

Copy file name to clipboardExpand all lines: .github/workflows/workflow.yml
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@v2
2121

22-
- name: Set Node.js 12.x
22+
- name: Set Node.js 16.x
2323
uses: actions/setup-node@v1
2424
with:
25-
node-version: 12.x
25+
node-version: 16.x
2626

27-
- name: npm install
28-
run: npm install
27+
- name: npm ci
28+
run: npm ci
2929

3030
- name: Lint
3131
run: npm run format-check

‎.licenses/npm/@actions/cache.dep.yml

Copy file name to clipboardExpand all lines: .licenses/npm/@actions/cache.dep.yml
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.licenses/npm/@types/node.dep.yml

Copy file name to clipboardExpand all lines: .licenses/npm/@types/node.dep.yml
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎README.md

Copy file name to clipboardExpand all lines: README.md
+43-28Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# setup-python V2
1+
# setup-python V3
22

33
<p align="left">
44
<a href="https://github.com/actions/setup-python"><img alt="GitHub Actions status" src="https://github.com/actions/setup-python/workflows/Main%20workflow/badge.svg"></a>
@@ -9,7 +9,7 @@ This action sets up a Python environment for use in actions by:
99
- optionally installing and adding to PATH a version of Python that is already installed in the tools cache.
1010
- downloading, installing and adding to PATH an available version of Python from GitHub Releases ([actions/python-versions](https://github.com/actions/python-versions/releases)) if a specific version is not available in the tools cache.
1111
- failing if a specific version of Python is not preinstalled or available for download.
12-
- optionally caching dependencies for pip and pipenv.
12+
- optionally caching dependencies for pip, pipenv and poetry.
1313
- registering problem matchers for error output.
1414

1515
# What's new
@@ -19,7 +19,7 @@ This action sets up a Python environment for use in actions by:
1919
- Automatic setup and download of Python packages if using a self-hosted runner.
2020
- Support for pre-release versions of Python.
2121
- Support for installing any version of PyPy on-flight
22-
- Support for built-in caching of pip and pipenv dependencies
22+
- Support for built-in caching of pip, pipenv and poetry dependencies
2323

2424
# Usage
2525

@@ -28,8 +28,8 @@ See [action.yml](action.yml)
2828
Basic:
2929
```yaml
3030
steps:
31-
- uses: actions/checkout@v2
32-
- uses: actions/setup-python@v2
31+
- uses: actions/checkout@v3
32+
- uses: actions/setup-python@v3
3333
with:
3434
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
3535
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
@@ -46,9 +46,9 @@ jobs:
4646
python-version: [ '2.x', '3.x', 'pypy-2.7', 'pypy-3.7', 'pypy-3.8' ]
4747
name: Python ${{ matrix.python-version }} sample
4848
steps:
49-
- uses: actions/checkout@v2
49+
- uses: actions/checkout@v3
5050
- name: Set up Python
51-
uses: actions/setup-python@v2
51+
uses: actions/setup-python@v3
5252
with:
5353
python-version: ${{ matrix.python-version }}
5454
architecture: x64
@@ -70,9 +70,9 @@ jobs:
7070
- os: windows-latest
7171
python-version: '3.6'
7272
steps:
73-
- uses: actions/checkout@v2
73+
- uses: actions/checkout@v3
7474
- name: Set up Python
75-
uses: actions/setup-python@v2
75+
uses: actions/setup-python@v3
7676
with:
7777
python-version: ${{ matrix.python-version }}
7878
- name: Display Python version
@@ -89,8 +89,8 @@ jobs:
8989
# in this example, there is a newer version already installed, 3.7.7, so the older version will be downloaded
9090
python-version: ['3.7.4', '3.8', '3.9', '3.10']
9191
steps:
92-
- uses: actions/checkout@v2
93-
- uses: actions/setup-python@v2
92+
- uses: actions/checkout@v3
93+
- uses: actions/setup-python@v3
9494
with:
9595
python-version: ${{ matrix.python-version }}
9696
- run: python my_script.py
@@ -99,8 +99,8 @@ jobs:
9999
Download and set up an accurate pre-release version of Python:
100100
```yaml
101101
steps:
102-
- uses: actions/checkout@v2
103-
- uses: actions/setup-python@v2
102+
- uses: actions/checkout@v3
103+
- uses: actions/setup-python@v3
104104
with:
105105
python-version: '3.11.0-alpha.1'
106106
- run: python my_script.py
@@ -109,8 +109,8 @@ steps:
109109
Download and set up the latest available version of Python (includes both pre-release and stable versions):
110110
```yaml
111111
steps:
112-
- uses: actions/checkout@v2
113-
- uses: actions/setup-python@v2
112+
- uses: actions/checkout@v3
113+
- uses: actions/setup-python@v3
114114
with:
115115
python-version: '3.11.0-alpha - 3.11.0' # SemVer's version range syntax
116116
- run: python my_script.py
@@ -129,8 +129,8 @@ jobs:
129129
- 'pypy-3.7-v7.3.3' # Python 3.7 and PyPy 7.3.3
130130
- 'pypy-3.8' # the latest available version of PyPy that supports Python 3.8
131131
steps:
132-
- uses: actions/checkout@v2
133-
- uses: actions/setup-python@v2
132+
- uses: actions/checkout@v3
133+
- uses: actions/setup-python@v3
134134
with:
135135
python-version: ${{ matrix.python-version }}
136136
- run: python my_script.py
@@ -209,23 +209,24 @@ pypy-3.7-nightly # Python 3.7 and nightly PyPy
209209
210210
# Caching packages dependencies
211211
212-
The action has built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching dependencies but requires less configuration settings. Supported package managers are `pip` and `pipenv`. The `cache` input is optional, and caching is turned off by default.
212+
The action has built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching dependencies but requires less configuration settings. Supported package managers are `pip`, `pipenv` and `poetry`. The `cache` input is optional, and caching is turned off by default.
213213
214-
The action defaults to searching for a dependency file (`requirements.txt` for pip or `Pipfile.lock` for pipenv) in the repository, and uses its hash as a part of the cache key. Use `cache-dependency-path` for cases where multiple dependency files are used, they are located in different subdirectories or different files for the hash want to be used.
214+
The action defaults to searching for a dependency file (`requirements.txt` for pip, `Pipfile.lock` for pipenv or `poetry.lock` for poetry) in the repository, and uses its hash as a part of the cache key. Use `cache-dependency-path` for cases where multiple dependency files are used, they are located in different subdirectories or different files for the hash want to be used.
215215
216216
- For pip, the action will cache global cache directory
217217
- For pipenv, the action will cache virtualenv directory
218+
- For poetry, the action will cache virtualenv directory
218219
219220
**Please Note:** Restored cache will not be used if the requirements.txt file is not updated for a long time and a newer version of the dependency is available that can lead to an increase in total build time.
220221
221222
The requirements file format allows to specify dependency versions using logical operators (for example chardet>=3.0.4) or specify dependencies without any versions. In this case the pip install -r requirements.txt command will always try to install the latest available package version. To be sure that the cache will be used, please stick to a specific dependency version and update it manually if necessary.
222223
223-
**Caching pip dependencies:**
224+
**Caching pip dependencies:**
224225
225226
```yaml
226227
steps:
227-
- uses: actions/checkout@v2
228-
- uses: actions/setup-python@v2
228+
- uses: actions/checkout@v3
229+
- uses: actions/setup-python@v3
229230
with:
230231
python-version: '3.9'
231232
cache: 'pip'
@@ -235,21 +236,35 @@ steps:
235236
**Caching pipenv dependencies:**
236237
```yaml
237238
steps:
238-
- uses: actions/checkout@v2
239+
- uses: actions/checkout@v3
239240
- name: Install pipenv
240241
run: pipx install pipenv
241-
- uses: actions/setup-python@v2
242+
- uses: actions/setup-python@v3
242243
with:
243244
python-version: '3.9'
244245
cache: 'pipenv'
245246
- run: pipenv install
246247
```
247248
249+
**Caching poetry dependencies:**
250+
```yaml
251+
steps:
252+
- uses: actions/checkout@v3
253+
- name: Install poetry
254+
run: pipx install poetry
255+
- uses: actions/setup-python@v3
256+
with:
257+
python-version: '3.9'
258+
cache: 'poetry'
259+
- run: poetry install
260+
- run: poetry run pytest
261+
```
262+
248263
**Using wildcard patterns to cache dependencies**
249264
```yaml
250265
steps:
251-
- uses: actions/checkout@v2
252-
- uses: actions/setup-python@v2
266+
- uses: actions/checkout@v3
267+
- uses: actions/setup-python@v3
253268
with:
254269
python-version: '3.9'
255270
cache: 'pip'
@@ -260,10 +275,10 @@ steps:
260275
**Using a list of file paths to cache dependencies**
261276
```yaml
262277
steps:
263-
- uses: actions/checkout@v2
278+
- uses: actions/checkout@v3
264279
- name: Install pipenv
265280
run: pipx install pipenv
266-
- uses: actions/setup-python@v2
281+
- uses: actions/setup-python@v3
267282
with:
268283
python-version: '3.9'
269284
cache: 'pipenv'

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.