Skip to content

Commit

Permalink
Update: Configuring for pure-python (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Sep 1, 2021
1 parent 77cd455 commit 3dba9ad
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ max_line_length = off
# 4 space indentation
indent_size = 4

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

Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ name: tests

on:
push:
branches: [ master ]
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.8", "lint"]
Expand All @@ -26,12 +31,12 @@ jobs:
- ["pypy3", "pypy3"]
- ["3.8", "coverage"]

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}-latest
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
*.dll
*.egg-info/
*.profraw
*.pyc
*.pyo
*.so
.coverage
.coverage.*
.eggs/
.installed.cfg
.mr.developer.cfg
.tox/
.vscode/
__pycache__/
bin/
build/
coverage.xml
develop-eggs/
develop/
dist/
docs/_build
eggs/
htmlcov/
etc/
lib/
lib64
log/
parts/
pyvenv.cfg
var/
16 changes: 13 additions & 3 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[meta]
template = "pure-python"
commit-id = "4e9825189b9b8d18f28e7dbc63373d4baea08602"
commit-id = "d3ec10bba12b9b7be0eb8b011ffbb2319f08dae2"

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

[coverage]
fail-under = 84

[tox]
use-flake8 = true

[manifest]
additional-rules = [
"recursive-include src *.pt",
"recursive-include src *.rst",
"recursive-include src *.zcml",
]
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ include *.txt
include buildout.cfg
include tox.ini

recursive-include src *.pt
recursive-include src *.py
recursive-include src *.pt
recursive-include src *.rst
recursive-include src *.txt
recursive-include src *.zcml
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ def read(*rnames):
'z3c.macro',
'zope.app.pagetemplate',
'zope.app.testing',
'zope.browserresource',
'zope.publisher',
'zope.testing',
'zope.browserresource',
'zope.testrunner',
],
),
install_requires=[
Expand Down
15 changes: 9 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[tox]
minversion = 3.18
envlist =
lint
py27
Expand All @@ -16,9 +17,8 @@ envlist =
[testenv]
usedevelop = true
deps =
zope.testrunner
commands =
zope-testrunner --test-path=src []
zope-testrunner --test-path=src {posargs:-vc}
extras =
test

Expand All @@ -29,26 +29,29 @@ deps =
flake8
check-manifest
check-python-versions
wheel
commands =
flake8 src setup.py
check-manifest
check-python-versions

[testenv:coverage]
basepython = python3
allowlist_externals =
mkdir
deps =
coverage
coverage-python-version
zope.testrunner
commands =
coverage run -m zope.testrunner --test-path=src []
mkdir -p {toxinidir}/parts/htmlcov
coverage run -m zope.testrunner --test-path=src {posargs:-vc}
coverage html
coverage report -m --fail-under=84

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

[coverage:report]
precision = 2
Expand All @@ -62,4 +65,4 @@ exclude_lines =
raise AssertionError

[coverage:html]
directory = htmlcov
directory = parts/htmlcov

0 comments on commit 3dba9ad

Please sign in to comment.