Skip to content

Commit a92accb

Browse files
authored
use GitHub Actions for CI
1 parent eed9150 commit a92accb

8 files changed

Lines changed: 97 additions & 46 deletions

File tree

.github/workflows/main.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on push or pull request events
6+
push:
7+
pull_request:
8+
schedule:
9+
- cron: '0 12 * * 0' # run once a week on Sunday
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
tests:
17+
name: "Python ${{ matrix.python-version }}"
18+
runs-on: "ubuntu-latest"
19+
20+
strategy:
21+
matrix:
22+
python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"]
23+
24+
# Steps represent a sequence of tasks that will be executed as part of the job
25+
steps:
26+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27+
- uses: "actions/checkout@v2"
28+
- uses: "actions/setup-python@v2"
29+
with:
30+
python-version: "${{ matrix.python-version }}"
31+
- name: "Install dependencies"
32+
run: |
33+
set -xe
34+
python -VV
35+
python -m site
36+
python -m pip install --upgrade pip setuptools wheel
37+
python -m pip install --upgrade virtualenv tox tox-gh-actions
38+
- name: "Run tox targets for ${{ matrix.python-version }}"
39+
run: "python -m tox"
40+
41+
- name: "Report to coveralls"
42+
# coverage is only created in the py39 environment
43+
# --service=github is a workaround for bug
44+
# https://github.com/coveralls-clients/coveralls-python/issues/251
45+
if: "matrix.python-version == '3.9'"
46+
run: |
47+
pip install coveralls
48+
coveralls --service=github
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: stable
3+
rev: 20.8b1
44
hooks:
55
- id: black
6-
language_version: python3.7
6+
args: [--line-length=80]
7+
- repo: https://gitlab.com/pycqa/flake8
8+
rev: "3.8.4"
9+
hooks:
10+
- id: flake8
11+
- repo: https://github.com/asottile/pyupgrade
12+
rev: v2.7.4
13+
hooks:
14+
- id: pyupgrade
15+
args: [--py36-plus]

.travis.yml

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

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ CHANGES
88

99
- Fix Flake8 errors.
1010

11+
- Use GitHub Actions for CI.
12+
13+
- Add support for Python 3.9.
14+
1115

1216
0.2 (2020-01-29)
1317
----------------

README.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
.. image:: https://github.com/morepath/importscan/workflows/CI/badge.svg?branch=master
2+
:target: https://github.com/morepath/importscan/actions?workflow=CI
3+
:alt: CI Status
4+
5+
.. image:: https://coveralls.io/repos/github/morepath/importscan/badge.svg?branch=master
6+
:target: https://coveralls.io/github/morepath/importscan?branch=master
7+
8+
.. image:: https://img.shields.io/pypi/v/importscan.svg
9+
:target: https://pypi.org/project/importscan/
10+
11+
.. image:: https://img.shields.io/pypi/pyversions/importscan.svg
12+
:target: https://pypi.org/project/importscan/
13+
14+
115
importscan: recursively import Python packages
216
==============================================
317

pyproject.toml

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

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"Programming Language :: Python :: 3.6",
1919
"Programming Language :: Python :: 3.7",
2020
"Programming Language :: Python :: 3.8",
21+
"Programming Language :: Python :: 3.9",
2122
"Programming Language :: Python :: Implementation :: CPython",
2223
"Programming Language :: Python :: Implementation :: PyPy",
2324
],
@@ -33,6 +34,5 @@
3334
extras_require=dict(
3435
test=["pytest >= 2.9.0", "pytest-remove-stale-bytecode"],
3536
coverage=["pytest-cov"],
36-
pep8=["flake8", "black"],
3737
),
3838
)

tox.ini

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[tox]
2-
envlist = py36, py37, py38, pypy3, coverage, pep8
3-
skipsdist = True
2+
envlist = py36, py37, py38, py39, pypy3, coverage, pre-commit
43
skip_missing_interpreters = True
54

65
[testenv]
@@ -10,15 +9,25 @@ extras = test
109
commands = pytest {posargs}
1110

1211
[testenv:coverage]
13-
basepython = python3.7
12+
basepython = python3
1413
extras = test
1514
coverage
1615

1716
commands = pytest --cov {posargs}
1817

19-
[testenv:pep8]
20-
basepython = python3.7
21-
extras = pep8
18+
[testenv:pre-commit]
19+
deps = pre-commit
20+
commands = pre-commit run --all-files
2221

23-
commands = flake8 importscan
24-
black --check .
22+
[gh-actions]
23+
python =
24+
3.6: py36
25+
3.7: py37
26+
3.8: py38
27+
3.9: py39, pre-commit, mypy, coverage
28+
29+
[flake8]
30+
max-line-length = 88
31+
ignore =
32+
E231 # clashes with black
33+
W503

0 commit comments

Comments
 (0)