Skip to content

Commit

Permalink
Drop Python 3.6, add Python 3.10, run tests on GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Jan 5, 2022
1 parent 924933d commit 6cd4e4b
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 21 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CI

on:
push:
# branches:
# - main
pull_request:

jobs:
tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04

strategy:
matrix:
python-version:
- 2.7
- 3.7
- 3.8
- 3.9
- '3.10'

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox
- name: Run tox targets for ${{ matrix.python-version }}
run: |
ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}")
TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') tox
- name: Upload coverage data
uses: actions/upload-artifact@v2
with:
name: coverage-data
path: '.coverage.*'

coverage:
name: Coverage
runs-on: ubuntu-20.04
needs: tests
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install dependencies
run: python -m pip install --upgrade coverage[toml]

- name: Download data
uses: actions/download-artifact@v2
with:
name: coverage-data

- name: Combine coverage and fail if it's <100%
run: |
python -m coverage combine
python -m coverage html --skip-covered --skip-empty
python -m coverage report --fail-under=55
- name: Upload HTML report
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: html-report
path: htmlcov
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def read_file(file_name):
author='Eugene Kalinin',
author_email='e.v.kalinin@gmail.com',
install_requires=['setuptools'],
python_requires=(
">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*"
),
description="Node.js virtual environment builder",
long_description=ldesc,
py_modules=['nodeenv'],
Expand All @@ -49,8 +52,10 @@ def read_file(file_name):
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules'
Expand Down
11 changes: 2 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
# These should match the travis env list
envlist = py27,py36,py37,pypy
# These should match the GitHub Actions env list
envlist = py27,py37,py38,py39,py310

[testenv]
install_command = pip install {opts} {packages}
Expand All @@ -19,13 +19,6 @@ commands =
envdir = venv-nodeenv
commands =

[testenv:docs]
deps =
{[testenv]deps}
sphinx
changedir = docs
commands = sphinx-build -b html -d build/doctrees source build/html

[pytest]
markers =
integration: tests that take a little bit longer

0 comments on commit 6cd4e4b

Please sign in to comment.