Skip to content

Commit

Permalink
Fix the CI (#2254)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat authored Dec 28, 2021
1 parent ba3541c commit 878c6e0
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 56 deletions.
97 changes: 66 additions & 31 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,32 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0
- uses: pre-commit/action@v2.0.3

test:
name: test ${{ matrix.py }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
py:
- 3.10.0-rc.1
- 3.9
- 3.8
- 3.7
- 3.6
- 3.5
- pypy-3.6-v7.3.7
- "3.10"
- "3.9"
- "3.8"
- "3.7"
- "3.6"
- "3.5"
- pypy-3.6-v7.3.3
- pypy-3.7-v7.3.7
- pypy-3.8-v7.3.7
- 2.7
- "2.7"
- pypy-2.7
os:
- ubuntu-20.04
- macos-10.15
- windows-2022
include:
- { os: macos-latest, py: brew@py3 }
- { os: macos-10.15, py: brew@py3 }
steps:
- name: Install OS dependencies
run: |
Expand All @@ -61,14 +61,18 @@ jobs:
- name: Setup python for tox
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use local virtualenv for tox
run: python -m pip install .
- name: Install Python 2 for cross test
uses: actions/setup-python@v2
with:
python-version: "2.7"
- name: Setup python for test ${{ matrix.py }}
if: "!( startsWith(matrix.py,'brew@py') || endsWith(matrix.py, '-dev') )"
uses: actions/setup-python@v2
Expand All @@ -78,7 +82,7 @@ jobs:
if: startsWith(matrix.py,'brew@py')
run: |
import subprocess; import codecs; import os
subprocess.check_call(["bash", "-c", f"brew upgrade python@3 || brew install python@3"])
subprocess.check_call(["bash", "-c", "brew upgrade python@3 || brew install python@3"])
with codecs.open(os.environ["GITHUB_PATH"], "a", "utf-8") as file_handler:
file_handler.write("/usr/local/opt/python@3")
shell: python
Expand All @@ -101,14 +105,45 @@ jobs:
CI_RUN: "yes"
DIFF_AGAINST: HEAD
- name: Rename coverage report file
run: |
import os; os.rename('.tox/coverage.{}.xml'.format(os.environ['TOXENV']), '.tox/coverage.xml')
run: import os; import sys; os.rename(".tox/.coverage.{}".format(os.environ['TOXENV']), ".tox/.coverage.{}-{}".format(os.environ['TOXENV'], sys.platform))
shell: python
- uses: codecov/codecov-action@v1
- name: Upload coverage data
uses: actions/upload-artifact@v2
with:
file: ./.tox/coverage.xml
flags: tests
name: ${{ matrix.py }} - ${{ matrix.os }}
name: coverage-data
path: ".tox/.coverage.*"

coverage:
name: Combine coverage
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Setup coverage tool
run: tox -e coverage --notest
- name: Install package builder
run: python -m pip install build
- name: Build package
run: pyproject-build --wheel .
- name: Download coverage data
uses: actions/download-artifact@v2
with:
name: coverage-data
path: .tox
- name: Combine and report coverage
run: tox -e coverage
- name: Upload HTML report
uses: actions/upload-artifact@v2
with:
name: html-report
path: .tox/htmlcov

check:
name: ${{ matrix.tox_env }} - ${{ matrix.os }}
Expand All @@ -117,25 +152,25 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- ubuntu-20.04
- windows-2022
tox_env:
- dev
- docs
- readme
- upgrade
- zipapp
exclude:
- { os: windows-latest, tox_env: readme }
- { os: windows-latest, tox_env: docs }
- { os: windows-2022, tox_env: readme }
- { os: windows-2022, tox_env: docs }
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Python 3.9
- name: Setup Python "3.10"
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run check for ${{ matrix.tox_env }}
Expand All @@ -145,13 +180,13 @@ jobs:

publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [check, test, lint]
runs-on: ubuntu-latest
needs: [check, coverage, lint]
runs-on: ubuntu-20.04
steps:
- name: Setup python to build package
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"
- name: Install https://pypi.org/project/build
run: python -m pip install build
- uses: actions/checkout@v2
Expand Down
8 changes: 4 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
version: 2
build:
image: latest
os: ubuntu-20.04
tools:
python: "3.9"
formats:
- htmlzip
- epub
- pdf
python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- docs
extra_requirements: ["docs"]
sphinx:
builder: html
configuration: docs/conf.py
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
[![PyPI - Downloads](https://img.shields.io/pypi/dm/virtualenv?style=flat-square)](https://pypistats.org/packages/virtualenv)
[![PyPI - License](https://img.shields.io/pypi/l/virtualenv?style=flat-square)](https://opensource.org/licenses/MIT)
[![Build Status](https://github.com/pypa/virtualenv/workflows/check/badge.svg?branch=main&event=push)](https://github.com/pypa/virtualenv/actions?query=workflow%3Acheck)
[![codecov](https://codecov.io/gh/pypa/virtualenv/branch/main/graph/badge.svg)](https://codecov.io/gh/pypa/virtualenv)
[![Code style:
black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)

Expand Down
12 changes: 0 additions & 12 deletions codecov.yml

This file was deleted.

4 changes: 4 additions & 0 deletions tests/integration/test_run_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

import sys

import pytest

from virtualenv import cli_run
from virtualenv.info import IS_PYPY
from virtualenv.util.six import ensure_text
from virtualenv.util.subprocess import run_cmd


@pytest.mark.skipif(IS_PYPY, reason="setuptools distutil1s patching does not work")
def test_app_data_pinning(tmp_path):
version = "19.1.1" if sys.version_info[0:2] == (3, 4) else "19.3.1"
result = cli_run([ensure_text(str(tmp_path)), "--pip", version, "--activators", "", "--seeder", "app-data"])
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/discovery/py_info/test_py_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from virtualenv.discovery import cached_py_info
from virtualenv.discovery.py_info import PythonInfo, VersionInfo
from virtualenv.discovery.py_spec import PythonSpec
from virtualenv.info import fs_supports_symlink
from virtualenv.info import IS_PYPY, fs_supports_symlink
from virtualenv.util.path import Path

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


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

Expand Down
14 changes: 7 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ wheel_build_env = .pkg
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
passenv =
*
basepython = python3.9
basepython = python3.10
skip_install = true
deps =
pre-commit>=2
Expand Down Expand Up @@ -100,7 +100,7 @@ commands =

[testenv:docs]
description = build documentation
basepython = python3.9
basepython = python3.10
extras =
docs
commands =
Expand All @@ -123,11 +123,11 @@ commands =
description = do a release, required posarg of the version number
passenv =
*
basepython = python3.9
basepython = python3.10
deps =
gitpython>=3
packaging>=17.1
towncrier>=19.9.0rc1
gitpython>=3.1.24
packaging>=21.3
towncrier>=21.3
changedir = {toxinidir}/tasks
commands =
python release.py --version {posargs}
Expand All @@ -149,7 +149,7 @@ commands =
description = generate a zipapp
skip_install = true
deps =
packaging>=20
packaging>=21.3
commands =
python tasks/make_zipapp.py

Expand Down

0 comments on commit 878c6e0

Please sign in to comment.