From d3154d568f6e91e586f4ce90045b576523486cd8 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Nov 2020 17:03:02 +0100 Subject: [PATCH 1/5] Configuring for pure-python --- .coveragerc | 8 ----- .editorconfig | 39 +++++++++++++++++++++++++ .github/workflows/tests.yml | 57 ++++++++++++++++++++++++++++++++++++ .gitignore | 15 ++++++++-- .meta.cfg | 10 +++++++ .travis.yml | 35 ---------------------- MANIFEST.in | 15 +++++++--- setup.cfg | 16 +++++++--- tox.ini | 58 +++++++++++++++++++++++-------------- 9 files changed, 178 insertions(+), 75 deletions(-) delete mode 100644 .coveragerc create mode 100644 .editorconfig create mode 100644 .github/workflows/tests.yml create mode 100644 .meta.cfg delete mode 100644 .travis.yml diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 8f0d530..0000000 --- a/.coveragerc +++ /dev/null @@ -1,8 +0,0 @@ -[run] -source = zope.dublincore - -[report] -exclude_lines = - pragma: no cover - if __name__ == '__main__': - raise NotImplementedError diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f3e46f5 --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..1079b83 --- /dev/null +++ b/.github/workflows/tests.yml @@ -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 }} diff --git a/.gitignore b/.gitignore index 59023f6..7bd5e56 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.meta.cfg b/.meta.cfg new file mode 100644 index 0000000..c7ab030 --- /dev/null +++ b/.meta.cfg @@ -0,0 +1,10 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/pure-python +[meta] +template = pure-python +commit-id = 58dbe25a3fc4a427989a0f0d1a64f41d56722a77 +with-pypy = True +with-docs = True +with-sphinx_doctests = True +fail-under = 0 + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7be8500..0000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: python -python: - - 2.7 - - 3.6 - - 3.7 - - 3.8 - - 3.9 - - pypy - - pypy3 - -matrix: - include: - - name: "lint" - python: 3.6 - install: - - pip install -U tox - script: - - tox -e lint - after_success: - -install: - - pip install -U pip setuptools - - pip install -U coverage coveralls - - pip install -U -e .[test,docs] - -script: - - coverage run -m zope.testrunner --test-path=src - - coverage run -a -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctest -after_success: - - coveralls -notifications: - email: false -cache: pip -before_cache: - - rm -f $HOME/.cache/pip/log/debug.log diff --git a/MANIFEST.in b/MANIFEST.in index c71c1ec..8bbe95c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 diff --git a/setup.cfg b/setup.cfg index 7c06b42..92fc4d8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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/* diff --git a/tox.ini b/tox.ini index 9de271f..e18384a 100644 --- a/tox.ini +++ b/tox.ini @@ -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 @@ -17,10 +20,7 @@ deps = zope.testrunner commands = zope-testrunner --test-path=src [] - sphinx-build -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest -extras = - test - docs +extras = test [testenv:lint] basepython = python3 @@ -34,25 +34,39 @@ commands = check-manifest check-python-versions -[flake8] -doctests = 1 +[testenv:docs] +basepython = python3 +extras = docs +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=0 +[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 From 9fc50551fd1054f005b4539df06831b3f2625e71 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Nov 2020 17:03:50 +0100 Subject: [PATCH 2/5] Add back support for Python 3.5. --- CHANGES.rst | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index b1a9660..6dda8f8 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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) diff --git a/setup.py b/setup.py index e82074a..5ec3039 100644 --- a/setup.py +++ b/setup.py @@ -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', From f3104eea8b3cf3faecc79aad2bc6ff2a55655e00 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Nov 2020 17:08:03 +0100 Subject: [PATCH 3/5] Configuring for pure-python --- .meta.cfg | 4 ++-- tox.ini | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.meta.cfg b/.meta.cfg index c7ab030..0ffe29b 100644 --- a/.meta.cfg +++ b/.meta.cfg @@ -5,6 +5,6 @@ template = pure-python commit-id = 58dbe25a3fc4a427989a0f0d1a64f41d56722a77 with-pypy = True with-docs = True -with-sphinx_doctests = True -fail-under = 0 +with-sphinx-doctests = True +fail-under = 87 diff --git a/tox.ini b/tox.ini index e18384a..6219179 100644 --- a/tox.ini +++ b/tox.ini @@ -36,7 +36,9 @@ commands = [testenv:docs] basepython = python3 -extras = docs +extras = + docs + test 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 @@ -50,7 +52,7 @@ deps = commands = coverage run -m zope.testrunner --test-path=src [] coverage html - coverage report -m --fail-under=0 + coverage report -m --fail-under=87 [coverage:run] branch = True From bec22c13f3e587054ce2d6c27cbb33890827dd62 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Nov 2020 17:20:43 +0100 Subject: [PATCH 4/5] Configuring for pure-python --- .meta.cfg | 2 +- tox.ini | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.meta.cfg b/.meta.cfg index 0ffe29b..9602216 100644 --- a/.meta.cfg +++ b/.meta.cfg @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/pure-python [meta] template = pure-python -commit-id = 58dbe25a3fc4a427989a0f0d1a64f41d56722a77 +commit-id = 7139a1ecd82333471a42824a6e11b160bc1d6594 with-pypy = True with-docs = True with-sphinx-doctests = True diff --git a/tox.ini b/tox.ini index 6219179..8c4bfc4 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,10 @@ deps = zope.testrunner commands = zope-testrunner --test-path=src [] -extras = test + sphinx-build -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest +extras = + test + docs [testenv:lint] basepython = python3 @@ -37,8 +40,8 @@ commands = [testenv:docs] basepython = python3 extras = - docs test + docs 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 From 9a129005220c83f2c618a32826a5b33f32ebb5af Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Nov 2020 17:23:28 +0100 Subject: [PATCH 5/5] Configuring for pure-python --- tox.ini | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 8c4bfc4..0a0a2fa 100644 --- a/tox.ini +++ b/tox.ini @@ -39,9 +39,6 @@ commands = [testenv:docs] basepython = python3 -extras = - test - docs 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 @@ -54,6 +51,7 @@ deps = 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 html coverage report -m --fail-under=87