Skip to content

Commit 49bf3a3

Browse files
authored
Merge branch 'main' into clean-garbage-tmpdirs-with-tempfile-temporary-directory
2 parents ceea364 + bacc849 commit 49bf3a3

File tree

318 files changed

+19637
-10338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

318 files changed

+19637
-10338
lines changed

.github/ISSUE_TEMPLATE/2_feature_request.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,23 @@ name: 🚀 Feature Request
33
about: Ideas for new features and improvements
44

55
---
6+
7+
<!--
8+
Thanks for suggesting a feature!
9+
10+
Quick check-list while suggesting features:
11+
-->
12+
13+
#### What's the problem this feature will solve?
14+
<!-- What are you trying to do, that you are unable to achieve with pytest as it currently stands? -->
15+
16+
#### Describe the solution you'd like
17+
<!-- A clear and concise description of what you want to happen. -->
18+
19+
<!-- Provide examples of real-world use cases that this would enable and how it solves the problem described above. -->
20+
21+
#### Alternative Solutions
22+
<!-- Have you tried to workaround the problem using a pytest plugin or other tools? Or a different approach to solving this issue? Please elaborate here. -->
23+
24+
#### Additional context
25+
<!-- Add any other context, links, etc. about the feature here. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If this change fixes an issue, please:
1313
1414
Unless your change is trivial or a small documentation fix (e.g., a typo or reword of a small section) please:
1515
16-
- [ ] Create a new changelog file in the `changelog` folder, with a name like `<ISSUE NUMBER>.<TYPE>.rst`. See [changelog/README.rst](https://github.com/pytest-dev/pytest/blob/master/changelog/README.rst) for details.
16+
- [ ] Create a new changelog file in the `changelog` folder, with a name like `<ISSUE NUMBER>.<TYPE>.rst`. See [changelog/README.rst](https://github.com/pytest-dev/pytest/blob/main/changelog/README.rst) for details.
1717
1818
Write sentences in the **past or present tense**, examples:
1919

.github/workflows/main.yml

Lines changed: 63 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,29 @@ name: main
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
- "[0-9]+.[0-9]+.x"
88
tags:
9-
- "*"
9+
- "[0-9]+.[0-9]+.[0-9]+"
10+
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
1011

1112
pull_request:
1213
branches:
13-
- master
14+
- main
1415
- "[0-9]+.[0-9]+.x"
1516

17+
env:
18+
PYTEST_ADDOPTS: "--color=yes"
19+
20+
# Set permissions at the job level.
21+
permissions: {}
22+
1623
jobs:
1724
build:
1825
runs-on: ${{ matrix.os }}
1926
timeout-minutes: 30
27+
permissions:
28+
contents: read
2029

2130
strategy:
2231
fail-fast: false
@@ -26,13 +35,16 @@ jobs:
2635
"windows-py37",
2736
"windows-py37-pluggy",
2837
"windows-py38",
38+
"windows-py39",
39+
"windows-py310",
2940

3041
"ubuntu-py36",
3142
"ubuntu-py37",
3243
"ubuntu-py37-pluggy",
3344
"ubuntu-py37-freeze",
3445
"ubuntu-py38",
3546
"ubuntu-py39",
47+
"ubuntu-py310",
3648
"ubuntu-pypy3",
3749

3850
"macos-py37",
@@ -55,12 +67,20 @@ jobs:
5567
- name: "windows-py37-pluggy"
5668
python: "3.7"
5769
os: windows-latest
58-
tox_env: "py37-pluggymaster-xdist"
70+
tox_env: "py37-pluggymain-xdist"
5971
- name: "windows-py38"
6072
python: "3.8"
6173
os: windows-latest
6274
tox_env: "py38-unittestextras"
6375
use_coverage: true
76+
- name: "windows-py39"
77+
python: "3.9"
78+
os: windows-latest
79+
tox_env: "py39-xdist"
80+
- name: "windows-py310"
81+
python: "3.10-dev"
82+
os: windows-latest
83+
tox_env: "py310-xdist"
6484

6585
- name: "ubuntu-py36"
6686
python: "3.6"
@@ -74,7 +94,7 @@ jobs:
7494
- name: "ubuntu-py37-pluggy"
7595
python: "3.7"
7696
os: ubuntu-latest
77-
tox_env: "py37-pluggymaster-xdist"
97+
tox_env: "py37-pluggymain-xdist"
7898
- name: "ubuntu-py37-freeze"
7999
python: "3.7"
80100
os: ubuntu-latest
@@ -84,11 +104,15 @@ jobs:
84104
os: ubuntu-latest
85105
tox_env: "py38-xdist"
86106
- name: "ubuntu-py39"
87-
python: "3.9-dev"
107+
python: "3.9"
88108
os: ubuntu-latest
89109
tox_env: "py39-xdist"
110+
- name: "ubuntu-py310"
111+
python: "3.10-dev"
112+
os: ubuntu-latest
113+
tox_env: "py310-xdist"
90114
- name: "ubuntu-pypy3"
91-
python: "pypy3"
115+
python: "pypy-3.7"
92116
os: ubuntu-latest
93117
tox_env: "pypy3-xdist"
94118

@@ -121,16 +145,13 @@ jobs:
121145
- uses: actions/checkout@v2
122146
with:
123147
fetch-depth: 0
148+
persist-credentials: false
149+
124150
- name: Set up Python ${{ matrix.python }}
125151
uses: actions/setup-python@v2
126-
if: matrix.python != '3.9-dev'
127-
with:
128-
python-version: ${{ matrix.python }}
129-
- name: Set up Python ${{ matrix.python }} (deadsnakes)
130-
uses: deadsnakes/[email protected]
131-
if: matrix.python == '3.9-dev'
132152
with:
133153
python-version: ${{ matrix.python }}
154+
134155
- name: Install dependencies
135156
run: |
136157
python -m pip install --upgrade pip
@@ -142,68 +163,80 @@ jobs:
142163

143164
- name: Test with coverage
144165
if: "matrix.use_coverage"
145-
env:
146-
_PYTEST_TOX_COVERAGE_RUN: "coverage run -m"
147-
COVERAGE_PROCESS_START: ".coveragerc"
148-
_PYTEST_TOX_EXTRA_DEP: "coverage-enable-subprocess"
149-
run: "tox -e ${{ matrix.tox_env }}"
166+
run: "tox -e ${{ matrix.tox_env }}-coverage"
150167

151-
- name: Prepare coverage token
152-
if: (matrix.use_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' ))
153-
run: |
154-
python scripts/append_codecov_token.py
155-
156-
- name: Report coverage
157-
if: (matrix.use_coverage)
168+
- name: Upload coverage
169+
if: matrix.use_coverage && github.repository == 'pytest-dev/pytest'
158170
env:
159171
CODECOV_NAME: ${{ matrix.name }}
160-
run: bash scripts/report-coverage.sh -F GHA,${{ runner.os }}
172+
run: bash scripts/upload-coverage.sh -F GHA,${{ runner.os }}
161173

162174
linting:
163175
runs-on: ubuntu-latest
176+
permissions:
177+
contents: read
178+
164179
steps:
165180
- uses: actions/checkout@v2
181+
with:
182+
persist-credentials: false
183+
166184
- uses: actions/setup-python@v2
185+
167186
- name: set PY
168-
run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
169-
- uses: actions/cache@v1
187+
run: echo "name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
188+
189+
- uses: actions/cache@v2
170190
with:
171191
path: ~/.cache/pre-commit
172192
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
173-
- run: pip install tox
193+
194+
- name: Install dependencies
195+
run: |
196+
python -m pip install --upgrade pip
197+
pip install tox
198+
174199
- run: tox -e linting
175200

176201
deploy:
177202
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest'
178203

179204
runs-on: ubuntu-latest
180205
timeout-minutes: 30
206+
permissions:
207+
contents: write
181208

182209
needs: [build]
183210

184211
steps:
185212
- uses: actions/checkout@v2
186213
with:
187214
fetch-depth: 0
215+
persist-credentials: false
216+
188217
- name: Set up Python
189218
uses: actions/setup-python@v2
190219
with:
191220
python-version: "3.7"
221+
192222
- name: Install dependencies
193223
run: |
194224
python -m pip install --upgrade pip
195225
pip install --upgrade wheel setuptools tox
226+
196227
- name: Build package
197228
run: |
198229
python setup.py sdist bdist_wheel
230+
199231
- name: Publish package to PyPI
200232
uses: pypa/gh-action-pypi-publish@master
201233
with:
202234
user: __token__
203235
password: ${{ secrets.pypi_token }}
236+
204237
- name: Publish GitHub release notes
205238
env:
206-
GH_RELEASE_NOTES_TOKEN: ${{ secrets.release_notes }}
239+
GH_RELEASE_NOTES_TOKEN: ${{ github.token }}
207240
run: |
208241
sudo apt-get install pandoc
209242
tox -e publish-gh-release-notes
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: prepare release pr
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'Branch to base the release from'
8+
required: true
9+
default: ''
10+
major:
11+
description: 'Major release? (yes/no)'
12+
required: true
13+
default: 'no'
14+
prerelease:
15+
description: 'Prerelease (ex: rc1). Leave empty if not a pre-release.'
16+
required: true
17+
default: ''
18+
19+
# Set permissions at the job level.
20+
permissions: {}
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: write
27+
pull-requests: write
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Set up Python
35+
uses: actions/setup-python@v2
36+
with:
37+
python-version: "3.8"
38+
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install --upgrade setuptools tox
43+
44+
- name: Prepare release PR (minor/patch release)
45+
if: github.event.inputs.major == 'no'
46+
run: |
47+
tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --prerelease '${{ github.event.inputs.prerelease }}'
48+
49+
- name: Prepare release PR (major release)
50+
if: github.event.inputs.major == 'yes'
51+
run: |
52+
tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --major --prerelease '${{ github.event.inputs.prerelease }}'

.github/workflows/release-on-comment.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Update Plugin List
2+
3+
on:
4+
schedule:
5+
# At 00:00 on Sunday.
6+
# https://crontab.guru
7+
- cron: '0 0 * * 0'
8+
workflow_dispatch:
9+
10+
# Set permissions at the job level.
11+
permissions: {}
12+
13+
jobs:
14+
createPullRequest:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Setup Python
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: 3.8
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install packaging requests tabulate[widechars]
35+
36+
- name: Update Plugin List
37+
run: python scripts/update-plugin-list.py
38+
39+
- name: Create Pull Request
40+
uses: peter-evans/create-pull-request@2455e1596942c2902952003bbb574afbbe2ab2e6
41+
with:
42+
commit-message: '[automated] Update plugin list'
43+
author: 'pytest bot <[email protected]>'
44+
branch: update-plugin-list/patch
45+
delete-branch: true
46+
branch-suffix: short-commit-hash
47+
title: '[automated] Update plugin list'
48+
body: '[automated] Update plugin list'

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ issue/
3434
env/
3535
.env/
3636
.venv/
37+
/pythonenv*/
3738
3rdparty/
3839
.tox
3940
.cache
@@ -52,3 +53,6 @@ coverage.xml
5253

5354
# generated by pip
5455
pip-wheel-metadata/
56+
57+
# pytest debug logs generated via --debug
58+
pytestdebug.log

0 commit comments

Comments
 (0)