Skip to content

Commit

Permalink
chore: migrate to GH Actions, drop pythons < 3.5 (#12)
Browse files Browse the repository at this point in the history
* chore: migrate to GH Actions, drop pythons < 3.5

* chore: clean up Python 3.5 CI setup
  • Loading branch information
vytas7 committed Mar 21, 2021
1 parent 61f4e63 commit b233ccf
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 47 deletions.
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[run]
branch = True
source = token_bucket

parallel = True

[report]
show_missing = True
87 changes: 87 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: tests

on:
# Trigger the tests workflow on push or pull requests.
push:
branches:
- "*"
pull_request:
branches:
- master

jobs:
run_tox:
name: tox -e ${{ matrix.toxenv }} (${{matrix.python-version}} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
os:
- "ubuntu-20.04"
toxenv:
- "pep8"
include:
- python-version: 3.5
os: ubuntu-16.04
toxenv: py35
- python-version: 3.6
os: ubuntu-20.04
toxenv: py36
- python-version: 3.7
os: ubuntu-20.04
toxenv: py37
- python-version: 3.8
os: ubuntu-20.04
toxenv: py38
- python-version: 3.9
os: ubuntu-20.04
toxenv: py39
- python-version: pypy3
os: ubuntu-20.04
toxenv: pypy3

# Steps to run in each job.
# Some are GitHub actions, others run shell commands.
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
if: ${{ matrix.toxenv != 'py35' }}
with:
python-version: ${{ matrix.python-version }}

- name: Set up Python 3.8
uses: actions/setup-python@v2.1.4
if: ${{ matrix.toxenv == 'py35' }}
with:
python-version: 3.8

- name: Set up Python 3.5
if: ${{ matrix.toxenv == 'py35' }}
run: |
sudo apt-get update
sudo apt-get install -y build-essential curl python3.5 python3.5-dev
python3.5 --version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coverage tox
python --version
pip --version
tox --version
coverage --version
- name: Run tests
run: tox -e ${{ matrix.toxenv }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
if: ${{ matrix.toxenv == 'py38' }}
with:
env_vars: PYTHON
fail_ci_if_error: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pip-delete-this-directory.txt
htmlcov/
.tox/
.coverage
.coveragerc
.coverage_html
.coverage.*
.cache
Expand Down
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,18 @@
'Programming Language :: Python',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
keywords='web http https cloud rate limiting token bucket throttling',
author='kgriffs',
url='https://github.com/falconry/token-bucket',
license='Apache 2.0',
packages=find_packages(exclude=['tests']),
python_requires='>=3.5',
install_requires=[],
setup_requires=['pytest-runner'],
tests_require=['pytest'],
Expand Down
15 changes: 4 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
[tox]
envlist = py27,
py34,
py35,
pypy,
pep8,
envlist = pep8,
py38,
coverage-report

[testenv]
deps = -r{toxinidir}/requirements/tests
commands = coverage run --parallel -m pytest {posargs:tests}
commands = coverage run -m pytest {posargs:tests}

# --------------------------------------------------------------------
# Style
Expand All @@ -23,14 +20,10 @@ application-import-names = token_bucket
exclude = .tox,.venv,dist,docs,*.egg,.git,_build,build

[testenv:pep8]
skip_install = true
deps = flake8
flake8-quotes
flake8-import-order

# NOTE(kgriffs): Run with py27 in case any code branches assume the
# unicode type is defined, which will cause pep8 complains in those
# running under py3.
basepython = python2.7
commands = flake8 {posargs:.}

# --------------------------------------------------------------------
Expand Down

0 comments on commit b233ccf

Please sign in to comment.