Skip to content

Commit

Permalink
Setup GHA. (#13)
Browse files Browse the repository at this point in the history
* Add back support for Python 3.5.
  • Loading branch information
Michael Howitz committed Nov 23, 2020
1 parent e53dac3 commit d606625
Show file tree
Hide file tree
Showing 11 changed files with 178 additions and 71 deletions.
8 changes: 0 additions & 8 deletions .coveragerc

This file was deleted.

39 changes: 39 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
#
# EditorConfig Configuration file, for more details see:
# http://EditorConfig.org
# EditorConfig is a convention description, that could be interpreted
# by multiple editors to enforce common coding conventions for specific
# file types

# top-most EditorConfig file:
# Will ignore other EditorConfig files in Home directory or upper tree level.
root = true


[*] # For All Files
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Set default charset
charset = utf-8
# Indent style default
indent_style = space
# Max Line Length - a hard line wrap, should be disabled
max_line_length = off

[*.{py,cfg,ini}]
# 4 space indentation
indent_size = 4

[*.{yml,zpt,pt,dtml}]
# 2 space indentation
indent_size = 2

[{Makefile,.gitmodules}]
# Tab indentation (no size specified, but view as 4 spaces)
indent_style = tab
indent_size = unset
tab_width = unset
57 changes: 57 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
name: tests

on:
push:
branches: [ master ]
pull_request:
schedule:
- cron: '0 12 * * 0' # run once a week on Sunday

jobs:
build:
strategy:
matrix:
config:
# [Python version, tox env]
- ["3.8", "lint"]
- ["2.7", "py27"]
- ["3.5", "py35"]
- ["3.6", "py36"]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["pypy2", "pypy"]
- ["pypy3", "pypy3"]
- ["3.8", "docs"]
- ["3.8", "coverage"]

runs-on: ubuntu-latest
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test
run: tox -e ${{ matrix.config[1] }}
- name: Coverage
if: matrix.config[1] == 'coverage'
run: |
pip install coveralls coverage-python-version
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 13 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
*.egg-info/
*.profraw
*.pyc
*.pyo
.coverage
.coverage.*
.installed.cfg
.mr.developer.cfg
.tox/
__pycache__/
bin/
build/
coverage.xml
develop-eggs/
docs/_build/
dist/
docs/_build
eggs/
htmlcov/
lib/
nosetests.xml
lib64
parts/
pyvenv.cfg
10 changes: 10 additions & 0 deletions .meta.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[meta]
template = pure-python
commit-id = 7139a1ecd82333471a42824a6e11b160bc1d6594
with-pypy = True
with-docs = True
with-sphinx-doctests = True
fail-under = 92

35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changes
4.3.1 (unreleased)
------------------

- Nothing changed yet.
- Add back support for Python 3.5.


4.3.0 (2020-10-14)
Expand Down
15 changes: 11 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
include *.rst
include *.txt
include buildout.cfg
include tox.ini
include .travis.yml
include .coveragerc

recursive-include src *.pt
recursive-include src *.zcml

recursive-include docs *.bat
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs *.txt
recursive-include docs Makefile

recursive-include src *.gif
recursive-include src *.pt
recursive-include src *.py
recursive-include src *.rst
recursive-include src *.txt
recursive-include src *.xml
recursive-include src *.zcml
16 changes: 12 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
[aliases]
dev = develop easy_install zope.dublincore[testing]
docs = easy_install zope.dublincore[docs]

# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[bdist_wheel]
universal = 1

[flake8]
doctests = 1

[check-manifest]
ignore =
.editorconfig
.meta.cfg
docs/_build/html/_sources/*
docs/_build/doctest/*
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def read(*path):
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
Expand Down
51 changes: 34 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[tox]
envlist =
lint,
py27,
pypy,
py35,
py36,
py37,
py38,
py39,
pypy,
pypy3,
coverage,
docs
docs,
coverage

[testenv]
usedevelop = true
Expand All @@ -34,25 +37,39 @@ commands =
check-manifest
check-python-versions

[flake8]
doctests = 1
[testenv:docs]
basepython = python3
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest

[testenv:coverage]
usedevelop = true
basepython =
python2.7
basepython = python3
deps =
coverage
coverage-python-version
zope.testrunner
commands =
coverage run -m zope.testrunner --test-path=src []
coverage run -a -m sphinx -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest
coverage report
coverage html
deps =
coverage
coverage report -m --fail-under=92

[coverage:run]
branch = True
plugins = coverage_python_version
source = src

[testenv:docs]
basepython =
python2.7
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
[coverage:report]
precision = 2
exclude_lines =
pragma: no cover
pragma: nocover
except ImportError:
raise NotImplementedError
if __name__ == '__main__':
self.fail
raise AssertionError

[coverage:html]
directory = htmlcov

0 comments on commit d606625

Please sign in to comment.