Skip to content

Commit

Permalink
Use GitHub actions instead of Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Jan 20, 2022
1 parent 4b363a8 commit 5d78b47
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 76 deletions.
13 changes: 10 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ source = src
[report]
exclude_lines =
pragma: no cover
except ImportError:
\# Python <
raise NotImplementedError
raise TypeError\(f?"Unexpected
assert False,
\s+next\($
if MYPY:
if TYPE_CHECKING:
^\s+\.\.\.$
^\s+pass$
ignore_errors = True
omit =
docs/*
tests/*
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
ignore = E203,W503,E704
ignore = E203,W503
exclude = .git,.mypy_cache,.pytest_cache,.tox,.venv,__pycache__,build,dist,docs
max-line-length = 88
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Code quality

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run code quality tests with tox
run: tox
env:
TOXENV: black,flake8,mypy,manifest
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Build wheel and source tarball
run: |
pip install wheel
python setup.py sdist bdist_wheel
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Tests

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy3']

steps:
- uses: actions/checkout@v2

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Run unit tests with tox
run: tox
File renamed without changes.
1 change: 1 addition & 0 deletions .pyup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
branch: main
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ include .bumpversion.cfg
include .coveragerc
include .editorconfig
include .flake8
include .mypy.ini

include codecov.yml
include mypy.ini
include tox.ini

include poetry.lock
Expand Down
10 changes: 0 additions & 10 deletions codecov.yml

This file was deleted.

4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ packages = [
{ include = '.coveragerc', format = "sdist" },
{ include = '.editorconfig', format = "sdist" },
{ include = '.flake8', format = "sdist" },
{ include = 'mypy.ini', format = "sdist" },
{ include = 'codecov.yml', format = "sdist" },
{ include = '.mypy.ini', format = "sdist" },
{ include = 'poetry.lock', format = "sdist" },
{ include = 'tox.ini', format = "sdist" },
{ include = 'setup.cfg', format = "sdist" },
Expand All @@ -60,7 +59,6 @@ black = [
]
flake8 = "^4.0"
mypy = "0.931"
codecov = "^2.1"
check-manifest = ">=0.47,<1"
bump2version = ">=1.0,<2"
tox = "^3.24"
Expand Down
10 changes: 9 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ python-tag = py3
[aliases]
test = pytest

[check-manifest]
ignore =
.pyup.yml

[tool:pytest]
filterwarnings = ignore::pytest.PytestConfigWarning
# Deactivate default name pattern for test classes (we use pytest_describe).
python_classes = PyTest*
# Handle all async fixtures and tests automatically by asyncio
asyncio_mode = auto
# Ignore config options not (yet) available in older Python versions.
filterwarnings = ignore::pytest.PytestConfigWarning
13 changes: 10 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
[tox]
envlist = py3{6,7,8,9,10}, black, flake8, mypy, manifest
isolated_build = true

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[testenv:black]
basepython = python3.9
Expand Down Expand Up @@ -28,13 +37,11 @@ commands =
check-manifest -v

[testenv]
setenv =
PYTHONPATH = {toxinidir}
deps =
pytest>=6.2,<7
pytest-asyncio>=0.16,<1
pytest-cov>=3,<4
pytest-describe>=2,<3
py36,py37: typing-extensions>=4,<5
commands =
pytest tests {posargs}
pytest tests {posargs: --cov-report=term-missing --cov=graphql_relay --cov=tests --cov-fail-under=98}

0 comments on commit 5d78b47

Please sign in to comment.