From 4f0db2e856c746ab0a48839837005f06f0c8cf3c Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Mon, 27 Jun 2022 11:28:06 +0200 Subject: [PATCH] - switch to GHA, add support for Python 3.9 and 3.10 --- .editorconfig | 39 ++++ .github/workflows/tests.yml | 63 ++++++ .gitignore | 31 ++- .meta.toml | 27 +++ .travis.yml | 38 ---- CHANGES.rst | 4 + MANIFEST.in | 21 +- README.rst | 4 +- bootstrap.py | 210 ------------------ buildout.cfg | 9 +- buildout4.cfg | 4 + setup.cfg | 48 ++-- setup.py | 11 +- {dataflake => src/dataflake}/__init__.py | 0 {dataflake => src/dataflake}/wsgi/__init__.py | 0 .../dataflake}/wsgi/werkzeug/__init__.py | 0 .../dataflake}/wsgi/werkzeug/configurator.py | 0 .../dataflake}/wsgi/werkzeug/loghandlers.py | 0 .../wsgi/werkzeug/skel/etc/site.zcml | 0 .../wsgi/werkzeug/skel/etc/wsgi.conf.in | 0 .../wsgi/werkzeug/skel/etc/zope.ini.in | 0 .../wsgi/werkzeug/skel/var/README.txt | 0 .../wsgi/werkzeug/skel/var/cache/README.txt | 0 .../wsgi/werkzeug/skel/var/log/README.txt | 0 .../wsgi/werkzeug/tests/__init__.py | 0 .../wsgi/werkzeug/tests/test_configbuilder.py | 0 .../werkzeug/tests/test_initialization.py | 0 .../wsgi/werkzeug/tests/test_loghandlers.py | 0 tox.ini | 135 ++++++----- 29 files changed, 282 insertions(+), 362 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/tests.yml create mode 100644 .meta.toml delete mode 100644 .travis.yml delete mode 100644 bootstrap.py create mode 100644 buildout4.cfg rename {dataflake => src/dataflake}/__init__.py (100%) rename {dataflake => src/dataflake}/wsgi/__init__.py (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/__init__.py (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/configurator.py (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/loghandlers.py (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/skel/etc/site.zcml (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/skel/etc/wsgi.conf.in (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/skel/etc/zope.ini.in (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/skel/var/README.txt (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/skel/var/cache/README.txt (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/skel/var/log/README.txt (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/tests/__init__.py (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/tests/test_configbuilder.py (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/tests/test_initialization.py (100%) rename {dataflake => src/dataflake}/wsgi/werkzeug/tests/test_loghandlers.py (100%) diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..824b9c3 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,39 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/zope-product +# +# 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,zcml}] +# 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..72359d3 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,63 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/zope-product +name: tests + +on: + push: + pull_request: + schedule: + - cron: '0 12 * * 0' # run once a week on Sunday + # Allow to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + strategy: + # We want to see all failures: + fail-fast: false + matrix: + os: + - ubuntu + config: + # [Python version, tox env] + - ["3.9", "lint"] + - ["2.7", "py27"] + - ["3.5", "py35"] + - ["3.6", "py36"] + - ["3.7", "py37"] + - ["3.8", "py38"] + - ["3.9", "py39"] + - ["3.10", "py310"] + - ["3.9", "docs"] + - ["3.9", "coverage"] + + runs-on: ${{ matrix.os }}-latest + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + 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-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip-${{ matrix.config[0] }}- + ${{ 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 --service=github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 3b8d9ea..ce7f677 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,32 @@ -*.egg-info +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/zope-product +*.dll +*.egg-info/ +*.profraw *.pyc *.pyo -*$py.class *.so -__pycache__ -.coverage* +.coverage +.coverage.* +.eggs/ .installed.cfg .mr.developer.cfg .tox/ -coverage.xml -inituser +.vscode/ +__pycache__/ bin/ build/ -eggs/ -/etc +coverage.xml develop-eggs/ +develop/ dist/ -docs/_build/ +docs/_build +eggs/ +etc/ +lib/ +lib64 +log/ parts/ -/var +pyvenv.cfg +testing.log +var/ diff --git a/.meta.toml b/.meta.toml new file mode 100644 index 0000000..11f43ca --- /dev/null +++ b/.meta.toml @@ -0,0 +1,27 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/zope-product +[meta] +template = "zope-product" +commit-id = "1f787260c4188a0db7e5194765e9684ac716b914" + +[python] +with-windows = false +with-pypy = false +with-future-python = false +with-legacy-python = true +with-docs = true +with-sphinx-doctests = false + +[tox] +use-flake8 = true + +[coverage] +fail-under = 95 + +[manifest] +additional-rules = [ + "include buildout4.cfg", + "recursive-include src *.in", + "recursive-include src *.txt", + "recursive-include src *.zcml", + ] diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2e61121..0000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -language: python - -matrix: - include: - - python: "3.6" - env: TOXENV=lint - - python: "3.6" - env: TOXENV=coverage - after_success: - - coverage combine - - coveralls - - python: "2.7" - env: TOXENV=py27 - - python: "3.5" - env: TOXENV=py35 - - python: "3.6" - env: TOXENV=py36 - - python: "3.7" - env: TOXENV=py37 - dist: xenial - - python: "3.8-dev" - env: TOXENV=py38 - dist: xenial - -install: - - travis_retry pip install -U pip setuptools - - travis_retry pip install -U tox coveralls coverage - -script: - - travis_retry tox - -notifications: - email: false - -cache: - pip: true - directories: - - eggs/ diff --git a/CHANGES.rst b/CHANGES.rst index 8e076c8..1c1df55 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,6 +3,10 @@ Changelog 1.1 (unreleased) ---------------- +- Added support for Python 3.9 and 3.10 + +- Switched to GitHub Actions for CI + (`#1 `_) 1.0 (2019-04-24) diff --git a/MANIFEST.in b/MANIFEST.in index daca45b..c53243f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,11 +1,16 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/zope-product include *.rst -include *.cfg -exclude .*.cfg - -recursive-include dataflake * +include buildout.cfg +include tox.ini -global-exclude *.pyc -global-exclude *.pyo +recursive-include docs *.py +recursive-include docs *.rst +recursive-include docs *.txt +recursive-include docs Makefile -include *.py -include tox.ini +recursive-include src *.py +include buildout4.cfg +recursive-include src *.in +recursive-include src *.txt +recursive-include src *.zcml diff --git a/README.rst b/README.rst index d67d7b6..d295156 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ -.. image:: https://travis-ci.com/dataflake/dataflake.wsgi.werkzeug.svg?branch=master - :target: https://travis-ci.com/dataflake/dataflake.wsgi.werkzeug +.. image:: https://github.com/dataflake/dataflake.wsgi.werkzeug/actions/workflows/tests.yml/badge.svg + :target: https://github.com/dataflake/dataflake.wsgi.werkzeug/actions/workflows/tests.yml .. image:: https://coveralls.io/repos/github/dataflake/dataflake.wsgi.werkzeug/badge.svg?branch=master :target: https://coveralls.io/github/dataflake/dataflake.wsgi.werkzeug?branch=master diff --git a/bootstrap.py b/bootstrap.py deleted file mode 100644 index a459921..0000000 --- a/bootstrap.py +++ /dev/null @@ -1,210 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation and Contributors. -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE. -# -############################################################################## -"""Bootstrap a buildout-based project - -Simply run this script in a directory containing a buildout.cfg. -The script accepts buildout command-line options, so you can -use the -c option to specify an alternate configuration file. -""" - -import os -import shutil -import sys -import tempfile - -from optparse import OptionParser - -__version__ = '2015-07-01' -# See zc.buildout's changelog if this version is up to date. - -tmpeggs = tempfile.mkdtemp(prefix='bootstrap-') - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --find-links to point to local resources, you can keep -this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("--version", - action="store_true", default=False, - help=("Return bootstrap.py version.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", "--config-file", - help=("Specify the path to the buildout configuration " - "file to be used.")) -parser.add_option("-f", "--find-links", - help=("Specify a URL to search for buildout releases")) -parser.add_option("--allow-site-packages", - action="store_true", default=False, - help=("Let bootstrap.py use existing site packages")) -parser.add_option("--buildout-version", - help="Use a specific zc.buildout version") -parser.add_option("--setuptools-version", - help="Use a specific setuptools version") -parser.add_option("--setuptools-to-dir", - help=("Allow for re-use of existing directory of " - "setuptools versions")) - -options, args = parser.parse_args() -if options.version: - print("bootstrap.py version %s" % __version__) - sys.exit(0) - - -###################################################################### -# load/install setuptools - -try: - from urllib.request import urlopen -except ImportError: - from urllib2 import urlopen - -ez = {} -if os.path.exists('ez_setup.py'): - exec(open('ez_setup.py').read(), ez) -else: - exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), ez) - -if not options.allow_site_packages: - # ez_setup imports site, which adds site packages - # this will remove them from the path to ensure that incompatible versions - # of setuptools are not in the path - import site - # inside a virtualenv, there is no 'getsitepackages'. - # We can't remove these reliably - if hasattr(site, 'getsitepackages'): - for sitepackage_path in site.getsitepackages(): - # Strip all site-packages directories from sys.path that - # are not sys.prefix; this is because on Windows - # sys.prefix is a site-package directory. - if sitepackage_path != sys.prefix: - sys.path[:] = [x for x in sys.path - if sitepackage_path not in x] - -setup_args = dict(to_dir=tmpeggs, download_delay=0) - -if options.setuptools_version is not None: - setup_args['version'] = options.setuptools_version -if options.setuptools_to_dir is not None: - setup_args['to_dir'] = options.setuptools_to_dir - -ez['use_setuptools'](**setup_args) -import setuptools -import pkg_resources - -# This does not (always?) update the default working set. We will -# do it. -for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -###################################################################### -# Install buildout - -ws = pkg_resources.working_set - -setuptools_path = ws.find( - pkg_resources.Requirement.parse('setuptools')).location - -# Fix sys.path here as easy_install.pth added before PYTHONPATH -cmd = [sys.executable, '-c', - 'import sys; sys.path[0:0] = [%r]; ' % setuptools_path + - 'from setuptools.command.easy_install import main; main()', - '-mZqNxd', tmpeggs] - -find_links = os.environ.get( - 'bootstrap-testing-find-links', - options.find_links or - ('http://downloads.buildout.org/' - if options.accept_buildout_test_releases else None) - ) -if find_links: - cmd.extend(['-f', find_links]) - -requirement = 'zc.buildout' -version = options.buildout_version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - - def _final_version(parsed_version): - try: - return not parsed_version.is_prerelease - except AttributeError: - # Older setuptools - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - - index = setuptools.package_index.PackageIndex( - search_path=[setuptools_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -import subprocess -if subprocess.call(cmd) != 0: - raise Exception( - "Failed to execute command:\n%s" % repr(cmd)[1:-1]) - -###################################################################### -# Import and run buildout - -ws.add_entry(tmpeggs) -ws.require(requirement) -import zc.buildout.buildout - -if not [a for a in args if '=' not in a]: - args.append('bootstrap') - -# if -c was provided, we push it back into args for buildout' main function -if options.config_file is not None: - args[0:0] = ['-c', options.config_file] - -zc.buildout.buildout.main(args) -shutil.rmtree(tmpeggs) diff --git a/buildout.cfg b/buildout.cfg index 21b7316..d6234d8 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -1,5 +1,6 @@ [buildout] -extends = https://raw.githubusercontent.com/zopefoundation/Zope/master/versions-prod.cfg +extends = + https://zopefoundation.github.io/Zope/releases/master/versions.cfg develop = . parts = test @@ -16,18 +17,14 @@ eggs = [scripts] recipe = zc.recipe.egg eggs = - tox - twine dataflake.wsgi.werkzeug scripts = mkwerkzeuginstance - tox - twine [docs] recipe = zc.recipe.egg eggs = dataflake.wsgi.werkzeug[docs] -dependent-scripts = true + Sphinx scripts = sphinx-build diff --git a/buildout4.cfg b/buildout4.cfg new file mode 100644 index 0000000..4fac8a7 --- /dev/null +++ b/buildout4.cfg @@ -0,0 +1,4 @@ +[buildout] +extends = + buildout.cfg + https://zopefoundation.github.io/Zope/releases/4.x/versions.cfg diff --git a/setup.cfg b/setup.cfg index 680853e..9fa0851 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,42 +1,26 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/zope-product +[bdist_wheel] +universal = 1 + +[flake8] +doctests = 1 +no-accept-encodings = True +htmldir = parts/flake8 + [check-manifest] ignore = - *.cfg - bootstrap.py + .editorconfig + .meta.toml + docs/_build/html/_sources/* [isort] force_single_line = True combine_as_imports = True sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER +known_third_party = six, docutils, pkg_resources +known_zope = +known_first_party = default_section = ZOPE line_length = 79 lines_after_imports = 2 -not_skip = - __init__.py - -[flake8] -no-accept-encodings = True -doctests = True -exclude = - bootstrap.py -htmldir = parts/lint - -[coverage:run] -branch = True -source = dataflake -omit = - -[coverage:report] -fail_under = 60.00 -ignore_errors = True -precision = 2 -show_missing = False -sort = Name - -[coverage:html] -directory = parts/coverage - -[bdist_wheel] -universal = 1 - -[zest.releaser] -create-wheel = yes diff --git a/setup.py b/setup.py index fdcc01b..526307c 100644 --- a/setup.py +++ b/setup.py @@ -41,16 +41,19 @@ def read(*rnames): author='Jens Vagelpohl and Contributors', author_email='jens@netz.ooo', long_description=(read('README.rst') + '\n\n' + read('CHANGES.rst')), - packages=find_packages(), + packages=find_packages('src'), + package_dir={'': 'src'}, namespace_packages=['dataflake', 'dataflake.wsgi'], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Zope', 'Framework :: Zope :: 4', + 'Framework :: Zope :: 5', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: Zope Public License', 'Operating System :: OS Independent', + 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', @@ -58,13 +61,17 @@ def read(*rnames): 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: CPython', 'Topic :: Internet :: WWW/HTTP :: WSGI', ], python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*', install_requires=[ 'setuptools', - 'werkzeug', + 'werkzeug < 2; python_version <= "3.5"', + 'werkzeug < 2.1; python_version == "3.6"', + 'werkzeug; python_version > "3.6"', 'Zope', # To avoid reinventing the skeleton creation 'ipaddress ; python_version=="2.7"', ], diff --git a/dataflake/__init__.py b/src/dataflake/__init__.py similarity index 100% rename from dataflake/__init__.py rename to src/dataflake/__init__.py diff --git a/dataflake/wsgi/__init__.py b/src/dataflake/wsgi/__init__.py similarity index 100% rename from dataflake/wsgi/__init__.py rename to src/dataflake/wsgi/__init__.py diff --git a/dataflake/wsgi/werkzeug/__init__.py b/src/dataflake/wsgi/werkzeug/__init__.py similarity index 100% rename from dataflake/wsgi/werkzeug/__init__.py rename to src/dataflake/wsgi/werkzeug/__init__.py diff --git a/dataflake/wsgi/werkzeug/configurator.py b/src/dataflake/wsgi/werkzeug/configurator.py similarity index 100% rename from dataflake/wsgi/werkzeug/configurator.py rename to src/dataflake/wsgi/werkzeug/configurator.py diff --git a/dataflake/wsgi/werkzeug/loghandlers.py b/src/dataflake/wsgi/werkzeug/loghandlers.py similarity index 100% rename from dataflake/wsgi/werkzeug/loghandlers.py rename to src/dataflake/wsgi/werkzeug/loghandlers.py diff --git a/dataflake/wsgi/werkzeug/skel/etc/site.zcml b/src/dataflake/wsgi/werkzeug/skel/etc/site.zcml similarity index 100% rename from dataflake/wsgi/werkzeug/skel/etc/site.zcml rename to src/dataflake/wsgi/werkzeug/skel/etc/site.zcml diff --git a/dataflake/wsgi/werkzeug/skel/etc/wsgi.conf.in b/src/dataflake/wsgi/werkzeug/skel/etc/wsgi.conf.in similarity index 100% rename from dataflake/wsgi/werkzeug/skel/etc/wsgi.conf.in rename to src/dataflake/wsgi/werkzeug/skel/etc/wsgi.conf.in diff --git a/dataflake/wsgi/werkzeug/skel/etc/zope.ini.in b/src/dataflake/wsgi/werkzeug/skel/etc/zope.ini.in similarity index 100% rename from dataflake/wsgi/werkzeug/skel/etc/zope.ini.in rename to src/dataflake/wsgi/werkzeug/skel/etc/zope.ini.in diff --git a/dataflake/wsgi/werkzeug/skel/var/README.txt b/src/dataflake/wsgi/werkzeug/skel/var/README.txt similarity index 100% rename from dataflake/wsgi/werkzeug/skel/var/README.txt rename to src/dataflake/wsgi/werkzeug/skel/var/README.txt diff --git a/dataflake/wsgi/werkzeug/skel/var/cache/README.txt b/src/dataflake/wsgi/werkzeug/skel/var/cache/README.txt similarity index 100% rename from dataflake/wsgi/werkzeug/skel/var/cache/README.txt rename to src/dataflake/wsgi/werkzeug/skel/var/cache/README.txt diff --git a/dataflake/wsgi/werkzeug/skel/var/log/README.txt b/src/dataflake/wsgi/werkzeug/skel/var/log/README.txt similarity index 100% rename from dataflake/wsgi/werkzeug/skel/var/log/README.txt rename to src/dataflake/wsgi/werkzeug/skel/var/log/README.txt diff --git a/dataflake/wsgi/werkzeug/tests/__init__.py b/src/dataflake/wsgi/werkzeug/tests/__init__.py similarity index 100% rename from dataflake/wsgi/werkzeug/tests/__init__.py rename to src/dataflake/wsgi/werkzeug/tests/__init__.py diff --git a/dataflake/wsgi/werkzeug/tests/test_configbuilder.py b/src/dataflake/wsgi/werkzeug/tests/test_configbuilder.py similarity index 100% rename from dataflake/wsgi/werkzeug/tests/test_configbuilder.py rename to src/dataflake/wsgi/werkzeug/tests/test_configbuilder.py diff --git a/dataflake/wsgi/werkzeug/tests/test_initialization.py b/src/dataflake/wsgi/werkzeug/tests/test_initialization.py similarity index 100% rename from dataflake/wsgi/werkzeug/tests/test_initialization.py rename to src/dataflake/wsgi/werkzeug/tests/test_initialization.py diff --git a/dataflake/wsgi/werkzeug/tests/test_loghandlers.py b/src/dataflake/wsgi/werkzeug/tests/test_loghandlers.py similarity index 100% rename from dataflake/wsgi/werkzeug/tests/test_loghandlers.py rename to src/dataflake/wsgi/werkzeug/tests/test_loghandlers.py diff --git a/tox.ini b/tox.ini index 1fdba04..900e585 100644 --- a/tox.ini +++ b/tox.ini @@ -1,72 +1,99 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/zope-product [tox] +minversion = 3.18 envlist = - py27, - py35, - py36, - py37, - py38, - coverage, - lint + lint + py27 + py35 + py36 + py37 + py38 + py39 + py310 + docs + coverage [testenv] -commands = - {envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} bootstrap - {envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test - {envbindir}/test -deps = - setuptools - zc.buildout skip_install = true - -[testenv:coverage] -basepython = python3.6 -commands = - {envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} bootstrap - {envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test - coverage erase --rcfile={toxinidir}/setup.cfg - coverage run --rcfile={toxinidir}/setup.cfg {envbindir}/test -q - - coverage html -i --rcfile={toxinidir}/setup.cfg - - coverage xml -i --rcfile={toxinidir}/setup.cfg - coverage report --rcfile={toxinidir}/setup.cfg deps = - {[testenv]deps} - coverage -setenv = - COVERAGE_FILE={toxinidir}/.coverage - -[testenv:flake8] -basepython = python3.6 + zc.buildout >= 3.0.0rc3 + wheel > 0.37 +commands_pre = + py27,py35: {envbindir}/buildout -nc {toxinidir}/buildout4.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test + !py27-!py35: {envbindir}/buildout -nc {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test commands = - flake8 --format=html --doctests dataflake setup.py {posargs} -deps = - flake8 - flake8-html - flake8-debugger - flake8-todo + {envbindir}/test {posargs:-cv} [testenv:lint] -basepython = python3.6 +basepython = python3 commands_pre = - mkdir -p {toxinidir}/parts/lint + mkdir -p {toxinidir}/parts/flake8 +allowlist_externals = + mkdir commands = - isort --check-only --diff --recursive {toxinidir}/dataflake setup.py - - flake8 --format=html dataflake tests setup.py - flake8 dataflake tests setup.py + isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py + - flake8 {toxinidir}/src {toxinidir}/setup.py + flake8 {toxinidir}/src {toxinidir}/setup.py + check-manifest + check-python-versions deps = - isort + check-manifest + check-python-versions flake8 - # helper to generate HTML reports: - flake8-html + isort # Useful flake8 plugins that are Python and Plone specific: flake8-coding flake8-debugger - flake8-deprecated - flake8-todo - flake8-isort mccabe - flake8-blind-except - flake8-commas - flake8-string-format - flake8-quotes -whitelist_externals = + +[testenv:isort-apply] +basepython = python3 +commands_pre = +deps = + isort +commands = + isort {toxinidir}/src {toxinidir}/setup.py [] + +[testenv:docs] +basepython = python3 +skip_install = false +extras = + docs +commands_pre = +commands = + sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html + +[testenv:coverage] +basepython = python3 +skip_install = true +allowlist_externals = mkdir +deps = + {[testenv]deps} + coverage + coverage-python-version +commands = + mkdir -p {toxinidir}/parts/htmlcov + coverage run {envbindir}/test {posargs:-cv} + coverage html + coverage report -m --fail-under=95 + +[coverage:run] +branch = True +plugins = coverage_python_version +source = dataflake.wsgi.werkzeug + +[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 = parts/htmlcov