Skip to content

Commit

Permalink
Config with pure python (#4)
Browse files Browse the repository at this point in the history
* Remove no longer needed buildout.cfg.

It only used to generate the `bin/test` script.
  • Loading branch information
sallner authored May 15, 2020
1 parent 8b37ccf commit 48f422f
Show file tree
Hide file tree
Showing 15 changed files with 166 additions and 50 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
27 changes: 19 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
bin/
eggs/
develop-eggs/
parts/
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
*.egg-info/
*.profraw
*.pyc
*.pyo
.coverage
.coverage.*
.installed.cfg
*.py[co]
.mr.developer.cfg
.tox/
__pycache__/
bin/
build/
coverage.xml
develop-eggs/
dist/
*.egg-info/
.tox/
.coverage
docs/_build
eggs/
htmlcov/
lib/
lib64
parts/
pyvenv.cfg
7 changes: 7 additions & 0 deletions .meta.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[meta]
template = pure-python
commit-id = 6880d297483d0c3206e8ba275b01d93cd0fa4d72
fail-under = 0

33 changes: 19 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
language: python
sudo: false
python:
- 2.7
- pypy
- 3.5
- 3.6
- 3.7
- 3.8
- pypy
- pypy3

matrix:
include:
- name: "lint"
python: 3.7
env: TOXENV="lint"
- name: "coverage"
python: 3.7
env: TOXENV="coverage"
after_success:
- coveralls

install:
- pip install -U pip
- pip install -U tox-travis coveralls

script:
- coverage run -m zope.testrunner --test-path=src --auto-color --auto-progress
- tox

after_success:
- coveralls
notifications:
email: false

install:
- pip install -U pip setuptools
- pip install -U coveralls coverage
- pip install -U -e ".[test]"


cache: pip

before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
19 changes: 14 additions & 5 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
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
exclude .coverage

exclude MANIFEST.in

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

recursive-include src *.gif
recursive-include src *.pt
recursive-include src *.rst
recursive-include src *.txt
recursive-include src *.xml
recursive-include src *.zcml
8 changes: 0 additions & 8 deletions buildout.cfg

This file was deleted.

11 changes: 11 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# 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
.travis.yml
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def read(*rnames):
with open(os.path.join(os.path.dirname(__file__), *rnames)) as f:
return f.read()


setup(name='zope.app.broken',
version='4.2.dev0',
author='Zope Corporation and Contributors',
Expand Down Expand Up @@ -90,4 +91,4 @@ def read(*rnames):
},
include_package_data=True,
zip_safe=False,
)
)
2 changes: 1 addition & 1 deletion src/zope/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
2 changes: 1 addition & 1 deletion src/zope/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
3 changes: 2 additions & 1 deletion src/zope/app/broken/broken.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class Broken(ZODB.broken.Broken):
def __get_state(self, key, default=None):
get = getattr(self.__Broken_state__, 'get', None)
if get is None:
get = lambda k, d: default
def get(key, default):
return default
return get(key, default)

@property
Expand Down
4 changes: 3 additions & 1 deletion src/zope/app/broken/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@

__docformat__ = "reStructuredText"

from ZODB.interfaces import IBroken # BBB
from ZODB.interfaces import IBroken

__all__ = ["IBroken"]
3 changes: 2 additions & 1 deletion src/zope/app/broken/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class TestConfiguration(cleanup.CleanUp,

def test_configure(self):
xmlconfig.string(r"""
<configure xmlns="http://namespaces.zope.org/browser" i18n_domain="zope">
<configure xmlns="http://namespaces.zope.org/browser"
i18n_domain="zope">
<include package="zope.browsermenu" file="meta.zcml" />
<menu
id="zmi_views"
Expand Down
48 changes: 46 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,60 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[tox]
envlist =
lint,
py27,
pypy,
py35,
py36,
py37,
py38,
pypy,
pypy3,
coverage

[testenv]
usedevelop = true
deps =
zope.testrunner
commands =
zope-testrunner --test-path=src []
extras = test

[testenv:lint]
basepython = python3
skip_install = true
deps =
py27,pypy: mock
flake8
check-manifest
check-python-versions
commands =
flake8 src setup.py
check-manifest
check-python-versions .

[testenv:coverage]
basepython = python3
deps =
coverage
coverage-python-version
zope.testrunner
commands =
coverage run -m zope.testrunner --test-path=src []
coverage html
coverage report -m --fail-under=0

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

[coverage:report]
precision = 2
exclude_lines =
pragma: nocover
except ImportError:
raise NotImplementedError
if __name__ == '__main__':

[coverage:html]
directory = htmlcov

0 comments on commit 48f422f

Please sign in to comment.