From 4fe31e08f02036129ba160758e25a2a4b74d82e7 Mon Sep 17 00:00:00 2001 From: davfsa Date: Sun, 29 Aug 2021 20:01:06 +0200 Subject: [PATCH 1/5] Switch pipeline to Github Actions --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++ .travis.yml | 53 ---------------------------------------- 2 files changed, 43 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..dcbc69840 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: Build the documentation + +on: + pull_request: + +permissions: + contents: read + +jobs: + tests: + name: Run tests + + strategy: + fail-fast: false + matrix: + python-version: [3.10-dev, 3.9, 3.8, 3.7, 3.6, 3.5, 3.4.10, 2.7] + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r test-requirements.txt + + - name: Run tests + env: + PYTHON_VERSION: ${matrix.python-version} + run: | + export PYTHONPATH=`python -c "import sys; print('python2' if sys.version.startswith('2') else 'src')"`; + if [[ $PYTHON_VERSION < '3.7' ]]; then py.test $PYTHONPATH; fi + if [[ $PYTHON_VERSION < '3.5' ]]; then pip install -U .; fi + export PYTHONPATH=`python -c "import sys; print('typing_extensions/src_py2' if sys.version.startswith('2') else 'typing_extensions/src_py3')"`; + py.test $PYTHONPATH; + if [[ $PYTHON_VERSION == '3.8' ]]; then flake8; fi + if [[ $PYTHON_VERSION == '3.8' ]]; then flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py; fi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3e6391950..000000000 --- a/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -language: python - -jobs: - include: - - name: "3.9" - dist: xenial - python: 3.9.0 - - name: "3.8" - dist: xenial - python: 3.8.0 - - name: "3.7.3" - dist: xenial - python: 3.7.3 - - name: "3.7.2" - dist: xenial - python: 3.7.2 - - name: "3.7.1" - dist: xenial - python: 3.7.1 - - name: "3.7.0" - dist: xenial - python: 3.7.0 - - name: "3.6.2" - python: 3.6.2 - - name: "3.6.1" - python: 3.6.1 - - name: "3.6" - python: 3.6 - - name: "3.5.3" - python: 3.5.3 - - name: "3.5.2" - python: 3.5.2 -## - name: "3.5.1" -## dist: trusty -## python: 3.5.1 - - name: "3.5" - python: 3.5 - - name: "3.4" - python: 3.4 - - name: "2.7" - python: 2.7 - -install: -- pip install -r test-requirements.txt - -script: - - export PYTHONPATH=`python -c "import sys; print('python2' if sys.version.startswith('2') else 'src')"`; - if [[ $TRAVIS_PYTHON_VERSION < '3.7' ]]; then py.test $PYTHONPATH; fi - - if [[ $TRAVIS_PYTHON_VERSION < '3.5' ]]; then pip install -U .; fi - - export PYTHONPATH=`python -c "import sys; print('typing_extensions/src_py2' if sys.version.startswith('2') else 'typing_extensions/src_py3')"`; - py.test $PYTHONPATH; - - if [[ $TRAVIS_PYTHON_VERSION == '3.8' ]]; then flake8; fi - - if [[ $TRAVIS_PYTHON_VERSION == '3.8' ]]; then flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py; fi From 90e966ace72533ba11fe340a22a8c2187ebc468c Mon Sep 17 00:00:00 2001 From: davfsa Date: Sun, 29 Aug 2021 20:16:55 +0200 Subject: [PATCH 2/5] PR feedback - Changes requested - Split jobs into tests and linting --- .github/workflows/ci.yml | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcbc69840..508a188e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,7 @@ -name: Build the documentation +name: Run tests and linting on: + push: pull_request: permissions: @@ -32,12 +33,34 @@ jobs: - name: Run tests env: - PYTHON_VERSION: ${matrix.python-version} + PYTHON_VERSION: ${{ matrix.python-version }} run: | - export PYTHONPATH=`python -c "import sys; print('python2' if sys.version.startswith('2') else 'src')"`; + export PYTHONPATH=`python -c "import sys; print('python2' if sys.version.startswith('2') else 'src')"` if [[ $PYTHON_VERSION < '3.7' ]]; then py.test $PYTHONPATH; fi + if [[ $PYTHON_VERSION < '3.5' ]]; then pip install -U .; fi - export PYTHONPATH=`python -c "import sys; print('typing_extensions/src_py2' if sys.version.startswith('2') else 'typing_extensions/src_py3')"`; - py.test $PYTHONPATH; - if [[ $PYTHON_VERSION == '3.8' ]]; then flake8; fi - if [[ $PYTHON_VERSION == '3.8' ]]; then flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py; fi + export PYTHONPATH=`python -c "import sys; print('typing_extensions/src_py2' if sys.version.startswith('2') else 'typing_extensions/src_py3')"` + py.test $PYTHONPATH + + linting: + name: Run linting + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r test-requirements.txt + + - name: Run linting + run: | + flake8 + flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py From d1be850b8ed760840ce6a30fb271620b6fb54c0c Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 30 Aug 2021 14:40:23 +0200 Subject: [PATCH 3/5] Disable Python 3.4 in CI for now --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 508a188e6..5919b04e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.10-dev, 3.9, 3.8, 3.7, 3.6, 3.5, 3.4.10, 2.7] + # Python 3.4 disabled, due to problems with GitHub Actions. + python-version: [3.10-dev, 3.9, 3.8, 3.7, 3.6, 3.5, 2.7] runs-on: ubuntu-latest From 7a04d153bc24b4fc45646a45fd92d929b5077fb5 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 30 Aug 2021 14:45:55 +0200 Subject: [PATCH 4/5] Pin pytest to a version supporting Python 2 Run "pytest", not "py.test" --- .github/workflows/ci.yml | 4 ++-- test-requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5919b04e0..aad1fcf0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,11 +37,11 @@ jobs: PYTHON_VERSION: ${{ matrix.python-version }} run: | export PYTHONPATH=`python -c "import sys; print('python2' if sys.version.startswith('2') else 'src')"` - if [[ $PYTHON_VERSION < '3.7' ]]; then py.test $PYTHONPATH; fi + if [[ $PYTHON_VERSION < '3.7' ]]; then pytest $PYTHONPATH; fi if [[ $PYTHON_VERSION < '3.5' ]]; then pip install -U .; fi export PYTHONPATH=`python -c "import sys; print('typing_extensions/src_py2' if sys.version.startswith('2') else 'typing_extensions/src_py3')"` - py.test $PYTHONPATH + pytest $PYTHONPATH linting: name: Run linting diff --git a/test-requirements.txt b/test-requirements.txt index 1a033f49d..1e44ed02b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ flake8; python_version >= '3.6' flake8-bugbear; python_version >= '3.6' flake8-pyi; python_version >= '3.6' -pytest>=4.4.1; python_version >= '3.4' +pytest==4.6.11 pytest-xdist>=1.18; python_version >= '3.4' pytest-cov>=2.4.0; python_version >= '3.4' From 57a06602b73afe4ab7e0058f042ad2b829cd79c0 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 30 Aug 2021 15:08:03 +0200 Subject: [PATCH 5/5] Shorten name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aad1fcf0e..0e368d104 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Run tests and linting +name: Test and lint on: push: