Skip to content

Commit

Permalink
Config with pure python (#15)
Browse files Browse the repository at this point in the history
* Lint the code.
* Add support for Python 3.9.
  • Loading branch information
Michael Howitz committed Jun 8, 2021
1 parent e3ca9eb commit 7c7aea2
Show file tree
Hide file tree
Showing 45 changed files with 390 additions and 421 deletions.
7 changes: 0 additions & 7 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
60 changes: 60 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
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:
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", "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-${{ 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 }}
34 changes: 25 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
bin/
eggs/
develop-eggs/
parts/
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
*.egg-info/
*.profraw
*.pyc
*.pyo
.coverage
.coverage.*
.eggs/
.installed.cfg
*.py[co]
.mr.developer.cfg
.tox/
.vscode/
__pycache__/
bin/
build/
coverage.xml
develop-eggs/
develop/
dist/
*.egg-info/
.tox/
.coverage
htmlcov/
docs/_build
eggs/
etc/
lib/
lib64
log/
parts/
pyvenv.cfg
var/
51 changes: 51 additions & 0 deletions .meta.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[meta]
template = "pure-python"
commit-id = "d38d4a51cd2453eb800866e6e01bfb0fd4e80019"

[python]
with-appveyor = false
with-pypy = true
with-legacy-python = true
with-docs = false
with-sphinx-doctests = false

[tox]
use-flake8 = true

[coverage]
fail-under = 98

[flake8]
additional-config = [
"# F401 imported but unused",
"per-file-ignores =",
" src/zope/app/publisher/browser/__init__.py: F401",
" src/zope/app/publisher/browser/directoryresource.py: F401",
" src/zope/app/publisher/browser/fields.py: F401",
" src/zope/app/publisher/browser/fileresource.py: F401",
" src/zope/app/publisher/browser/i18nfileresource.py: F401",
" src/zope/app/publisher/browser/i18nresourcemeta.py: F401",
" src/zope/app/publisher/browser/icon.py: F401",
" src/zope/app/publisher/browser/menu.py: F401",
" src/zope/app/publisher/browser/menumeta.py: F401",
" src/zope/app/publisher/browser/metaconfigure.py: F401",
" src/zope/app/publisher/browser/metadirectives.py: F401",
" src/zope/app/publisher/browser/pagetemplateresource.py: F401",
" src/zope/app/publisher/browser/resource.py: F401",
" src/zope/app/publisher/browser/resourcemeta.py: F401",
" src/zope/app/publisher/browser/resources.py: F401",
" src/zope/app/publisher/browser/viewmeta.py: F401",
" src/zope/app/publisher/interfaces/__init__.py: F401",
" src/zope/app/publisher/interfaces/browser.py: F401",
" src/zope/app/publisher/interfaces/xmlrpc.py: F401",
" src/zope/app/publisher/pagetemplateresource.py: F401",
]

[manifest]
additional-rules = [
"recursive-include src *.pt",
"recursive-include src *.rst",
"recursive-include src *.zcml",
]
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
its request, allowing WSGI applications that serve multiple virtual hosts
to tell the difference between them.

- Add support for Python 3.9.


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

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

0 comments on commit 7c7aea2

Please sign in to comment.