Skip to content

Commit 878c6e0

Browse files
authored
Fix the CI (#2254)
1 parent ba3541c commit 878c6e0

File tree

7 files changed

+83
-56
lines changed

7 files changed

+83
-56
lines changed

.github/workflows/check.yml

Lines changed: 66 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,32 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v2
1717
- uses: actions/setup-python@v2
18-
- uses: pre-commit/action@v2.0.0
18+
- uses: pre-commit/action@v2.0.3
1919

2020
test:
2121
name: test ${{ matrix.py }} - ${{ matrix.os }}
2222
runs-on: ${{ matrix.os }}
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
os:
27-
- ubuntu-latest
28-
- windows-latest
29-
- macos-latest
3026
py:
31-
- 3.10.0-rc.1
32-
- 3.9
33-
- 3.8
34-
- 3.7
35-
- 3.6
36-
- 3.5
37-
- pypy-3.6-v7.3.7
27+
- "3.10"
28+
- "3.9"
29+
- "3.8"
30+
- "3.7"
31+
- "3.6"
32+
- "3.5"
33+
- pypy-3.6-v7.3.3
3834
- pypy-3.7-v7.3.7
3935
- pypy-3.8-v7.3.7
40-
- 2.7
36+
- "2.7"
4137
- pypy-2.7
38+
os:
39+
- ubuntu-20.04
40+
- macos-10.15
41+
- windows-2022
4242
include:
43-
- { os: macos-latest, py: brew@py3 }
43+
- { os: macos-10.15, py: brew@py3 }
4444
steps:
4545
- name: Install OS dependencies
4646
run: |
@@ -61,14 +61,18 @@ jobs:
6161
- name: Setup python for tox
6262
uses: actions/setup-python@v2
6363
with:
64-
python-version: 3.9
64+
python-version: "3.10"
6565
- name: Install tox
6666
run: python -m pip install tox
6767
- uses: actions/checkout@v2
6868
with:
6969
fetch-depth: 0
7070
- name: Use local virtualenv for tox
7171
run: python -m pip install .
72+
- name: Install Python 2 for cross test
73+
uses: actions/setup-python@v2
74+
with:
75+
python-version: "2.7"
7276
- name: Setup python for test ${{ matrix.py }}
7377
if: "!( startsWith(matrix.py,'brew@py') || endsWith(matrix.py, '-dev') )"
7478
uses: actions/setup-python@v2
@@ -78,7 +82,7 @@ jobs:
7882
if: startsWith(matrix.py,'brew@py')
7983
run: |
8084
import subprocess; import codecs; import os
81-
subprocess.check_call(["bash", "-c", f"brew upgrade python@3 || brew install python@3"])
85+
subprocess.check_call(["bash", "-c", "brew upgrade python@3 || brew install python@3"])
8286
with codecs.open(os.environ["GITHUB_PATH"], "a", "utf-8") as file_handler:
8387
file_handler.write("/usr/local/opt/python@3")
8488
shell: python
@@ -101,14 +105,45 @@ jobs:
101105
CI_RUN: "yes"
102106
DIFF_AGAINST: HEAD
103107
- name: Rename coverage report file
104-
run: |
105-
import os; os.rename('.tox/coverage.{}.xml'.format(os.environ['TOXENV']), '.tox/coverage.xml')
108+
run: import os; import sys; os.rename(".tox/.coverage.{}".format(os.environ['TOXENV']), ".tox/.coverage.{}-{}".format(os.environ['TOXENV'], sys.platform))
106109
shell: python
107-
- uses: codecov/codecov-action@v1
110+
- name: Upload coverage data
111+
uses: actions/upload-artifact@v2
108112
with:
109-
file: ./.tox/coverage.xml
110-
flags: tests
111-
name: ${{ matrix.py }} - ${{ matrix.os }}
113+
name: coverage-data
114+
path: ".tox/.coverage.*"
115+
116+
coverage:
117+
name: Combine coverage
118+
runs-on: ubuntu-latest
119+
needs: test
120+
steps:
121+
- uses: actions/checkout@v2
122+
with:
123+
fetch-depth: 0
124+
- uses: actions/setup-python@v2
125+
with:
126+
python-version: "3.10"
127+
- name: Install tox
128+
run: python -m pip install tox
129+
- name: Setup coverage tool
130+
run: tox -e coverage --notest
131+
- name: Install package builder
132+
run: python -m pip install build
133+
- name: Build package
134+
run: pyproject-build --wheel .
135+
- name: Download coverage data
136+
uses: actions/download-artifact@v2
137+
with:
138+
name: coverage-data
139+
path: .tox
140+
- name: Combine and report coverage
141+
run: tox -e coverage
142+
- name: Upload HTML report
143+
uses: actions/upload-artifact@v2
144+
with:
145+
name: html-report
146+
path: .tox/htmlcov
112147

113148
check:
114149
name: ${{ matrix.tox_env }} - ${{ matrix.os }}
@@ -117,25 +152,25 @@ jobs:
117152
fail-fast: false
118153
matrix:
119154
os:
120-
- ubuntu-latest
121-
- windows-latest
155+
- ubuntu-20.04
156+
- windows-2022
122157
tox_env:
123158
- dev
124159
- docs
125160
- readme
126161
- upgrade
127162
- zipapp
128163
exclude:
129-
- { os: windows-latest, tox_env: readme }
130-
- { os: windows-latest, tox_env: docs }
164+
- { os: windows-2022, tox_env: readme }
165+
- { os: windows-2022, tox_env: docs }
131166
steps:
132167
- uses: actions/checkout@v2
133168
with:
134169
fetch-depth: 0
135-
- name: Setup Python 3.9
170+
- name: Setup Python "3.10"
136171
uses: actions/setup-python@v2
137172
with:
138-
python-version: 3.9
173+
python-version: "3.10"
139174
- name: Install tox
140175
run: python -m pip install tox
141176
- name: Run check for ${{ matrix.tox_env }}
@@ -145,13 +180,13 @@ jobs:
145180

146181
publish:
147182
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
148-
needs: [check, test, lint]
149-
runs-on: ubuntu-latest
183+
needs: [check, coverage, lint]
184+
runs-on: ubuntu-20.04
150185
steps:
151186
- name: Setup python to build package
152187
uses: actions/setup-python@v2
153188
with:
154-
python-version: 3.9
189+
python-version: "3.10"
155190
- name: Install https://pypi.org/project/build
156191
run: python -m pip install build
157192
- uses: actions/checkout@v2

.readthedocs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
version: 2
22
build:
3-
image: latest
3+
os: ubuntu-20.04
4+
tools:
5+
python: "3.9"
46
formats:
57
- htmlzip
68
- epub
79
- pdf
810
python:
9-
version: 3.7
1011
install:
1112
- method: pip
1213
path: .
13-
extra_requirements:
14-
- docs
14+
extra_requirements: ["docs"]
1515
sphinx:
1616
builder: html
1717
configuration: docs/conf.py

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
[![PyPI - Downloads](https://img.shields.io/pypi/dm/virtualenv?style=flat-square)](https://pypistats.org/packages/virtualenv)
99
[![PyPI - License](https://img.shields.io/pypi/l/virtualenv?style=flat-square)](https://opensource.org/licenses/MIT)
1010
[![Build Status](https://github.com/pypa/virtualenv/workflows/check/badge.svg?branch=main&event=push)](https://github.com/pypa/virtualenv/actions?query=workflow%3Acheck)
11-
[![codecov](https://codecov.io/gh/pypa/virtualenv/branch/main/graph/badge.svg)](https://codecov.io/gh/pypa/virtualenv)
1211
[![Code style:
1312
black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
1413

codecov.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/integration/test_run_int.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
import sys
44

5+
import pytest
6+
57
from virtualenv import cli_run
8+
from virtualenv.info import IS_PYPY
69
from virtualenv.util.six import ensure_text
710
from virtualenv.util.subprocess import run_cmd
811

912

13+
@pytest.mark.skipif(IS_PYPY, reason="setuptools distutil1s patching does not work")
1014
def test_app_data_pinning(tmp_path):
1115
version = "19.1.1" if sys.version_info[0:2] == (3, 4) else "19.3.1"
1216
result = cli_run([ensure_text(str(tmp_path)), "--pip", version, "--activators", "", "--seeder", "app-data"])

tests/unit/discovery/py_info/test_py_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from virtualenv.discovery import cached_py_info
1616
from virtualenv.discovery.py_info import PythonInfo, VersionInfo
1717
from virtualenv.discovery.py_spec import PythonSpec
18-
from virtualenv.info import fs_supports_symlink
18+
from virtualenv.info import IS_PYPY, fs_supports_symlink
1919
from virtualenv.util.path import Path
2020

2121
CURRENT = PythonInfo.current_system()
@@ -296,6 +296,7 @@ def test_discover_exe_on_path_non_spec_name_not_match(mocker):
296296
assert CURRENT.satisfies(spec, impl_must_match=True) is False
297297

298298

299+
@pytest.mark.skipif(IS_PYPY, reason="setuptools distutil1s patching does not work")
299300
def test_py_info_setuptools():
300301
from setuptools.dist import Distribution
301302

tox.ini

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ wheel_build_env = .pkg
5050
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
5151
passenv =
5252
*
53-
basepython = python3.9
53+
basepython = python3.10
5454
skip_install = true
5555
deps =
5656
pre-commit>=2
@@ -100,7 +100,7 @@ commands =
100100

101101
[testenv:docs]
102102
description = build documentation
103-
basepython = python3.9
103+
basepython = python3.10
104104
extras =
105105
docs
106106
commands =
@@ -123,11 +123,11 @@ commands =
123123
description = do a release, required posarg of the version number
124124
passenv =
125125
*
126-
basepython = python3.9
126+
basepython = python3.10
127127
deps =
128-
gitpython>=3
129-
packaging>=17.1
130-
towncrier>=19.9.0rc1
128+
gitpython>=3.1.24
129+
packaging>=21.3
130+
towncrier>=21.3
131131
changedir = {toxinidir}/tasks
132132
commands =
133133
python release.py --version {posargs}
@@ -149,7 +149,7 @@ commands =
149149
description = generate a zipapp
150150
skip_install = true
151151
deps =
152-
packaging>=20
152+
packaging>=21.3
153153
commands =
154154
python tasks/make_zipapp.py
155155

0 commit comments

Comments
 (0)