Skip to content

Commit

Permalink
Merge 59519fc into 95c42ef
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Dec 1, 2018
2 parents 95c42ef + 59519fc commit 39d527f
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 32 deletions.
17 changes: 14 additions & 3 deletions .travis.yml
@@ -1,13 +1,24 @@
language: python
python:
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- pypy
- pypy3
matrix:
include:
- python: "3.7"
dist: xenial
before_install:
- pip install -U pip setuptools
- pip install -U coverage coveralls
install:
- pip install tox-travis
- pip install -U -e .[test]
script:
- tox
- coverage run -m zope.testrunner --test-path=src
after_success:
- coveralls
notifications:
email: false
cache: pip
4 changes: 3 additions & 1 deletion CHANGES.txt
Expand Up @@ -4,7 +4,9 @@ Changelog
4.1.0 (unreleased)
------------------

- Nothing changed yet.
- Add support for Python 3.6, 3.7 and PyPy3.

- Drop support for Python 3.3.


4.0.0 (2016-08-08)
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Expand Up @@ -55,17 +55,18 @@ def read(*rnames):
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Framework :: Zope :: 3'],
url='http://pypi.python.org/pypi/zope.app.appsetup',
url='https://github.com/zopefoundation/zope.app.appsetup',
packages=find_packages('src'),
package_dir={'': 'src'},
namespace_packages=['zope', 'zope.app'],
Expand Down
2 changes: 1 addition & 1 deletion src/zope/app/appsetup/bootstrap.py
Expand Up @@ -180,7 +180,7 @@ def checkSecurityPolicy(event):
was refactored and now it needs to be included from site.zcml.
"""
if getSecurityPolicy() is ParanoidSecurityPolicy:
logging.getLogger('zope.app.appsetup').warn(
logging.getLogger('zope.app.appsetup').warning(
'Security policy is not configured.\n'
'Please make sure that securitypolicy.zcml is included'
' in site.zcml immediately\n'
Expand Down
4 changes: 2 additions & 2 deletions src/zope/app/appsetup/bootstrap.txt
Expand Up @@ -10,8 +10,8 @@ object. It subscribes to DatabaseOpened events:
>>> from zope.app.appsetup import bootstrap
>>> import zope.processlifetime

>>> from ZODB.tests import util
>>> db = util.DB()
>>> from ZODB.MappingStorage import DB
>>> db = DB()
>>> bootstrap.bootStrapSubscriber(zope.processlifetime.DatabaseOpened(db))

The subscriber makes sure that there is a root folder:
Expand Down
3 changes: 2 additions & 1 deletion src/zope/app/appsetup/debug.py
Expand Up @@ -60,7 +60,8 @@ def main(args=None):
db = loadApplication(args)
if "PYTHONSTARTUP" in os.environ:
startup = os.environ["PYTHONSTARTUP"]
exec(compile(open(startup).read(), startup, 'exec'))
with open(startup) as s:
exec(compile(s.read(), startup, 'exec'))
sys.modules['__main__'].root = db.open().root()[ZopePublication.root_name]
print('The application root is known as `root`.')
os.environ["PYTHONINSPECT"] = "true"
Expand Down
2 changes: 1 addition & 1 deletion src/zope/app/appsetup/tests.py
Expand Up @@ -27,7 +27,7 @@

import zope.component

from ZODB.tests.util import DB
from ZODB.MappingStorage import DB
from zope.traversing.api import traverse, getPath
from zope.error.interfaces import IErrorReportingUtility
from zope.error.error import ErrorReportingUtility
Expand Down
35 changes: 14 additions & 21 deletions tox.ini
@@ -1,29 +1,22 @@
[tox]
envlist = coverage-clean, py27, py33, py34, py35, pypy, coverage-report
envlist = flake8, py27, py34, py35, py36, py37, pypy, pypy3, coverage

[testenv]
usedevelop = true
commands =
coverage run setup.py ftest
setenv =
COVERAGE_FILE=.coverage.{envname}
zope-testrunner --test-path=src []
extras = test

[testenv:coverage]
basepython = python3.7
commands =
coverage run -m zope.testrunner --test-path=src []
coverage report --fail-under=80
deps =
.[test]
coverage

[testenv:coverage-clean]
deps = coverage
setenv =
COVERAGE_FILE=.coverage
[testenv:flake8]
basepython = python3.6
skip_install = true
commands = coverage erase

[testenv:coverage-report]
deps = coverage
setenv =
COVERAGE_FILE=.coverage
skip_install = true
commands =
coverage combine
coverage report
coverage html
coverage xml
deps = flake8
commands = flake8 --doctests src setup.py

0 comments on commit 39d527f

Please sign in to comment.