Skip to content

Commit

Permalink
Merge pull request #5 from zopefoundation/python3
Browse files Browse the repository at this point in the history
Fix file attribute of includePlugins directive in Python 3
  • Loading branch information
David Glick committed Oct 14, 2018
2 parents 20ea80b + 196bc83 commit dec01d2
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 8 deletions.
9 changes: 8 additions & 1 deletion .travis.yml
Expand Up @@ -5,8 +5,15 @@ python:
- pypy
- 3.4
- 3.5
- 3.6
matrix:
include:
- python: "3.7"
dist: xenial
sudo: true
install:
- python bootstrap.py
- virtualenv .
- bin/pip install zc.buildout
- bin/buildout
script:
- bin/test -v1
Expand Down
5 changes: 4 additions & 1 deletion CHANGES.rst
Expand Up @@ -4,7 +4,10 @@ Changes
0.3.8 (unreleased)
------------------

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

- Fix the ``includePlugins`` directive to read filenames
as native strings in Python 3.


0.3.7 (2016-08-24)
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Expand Up @@ -20,6 +20,8 @@
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
Expand All @@ -38,7 +40,7 @@
'zope.dottedname',
'zope.interface',
'zope.configuration',
'zope.schema',
'zope.schema>=4.2.0',
'zc.buildout',
],
tests_require=TESTS_REQUIRE,
Expand Down
1 change: 1 addition & 0 deletions src/z3c/autoinclude/plugin.txt
Expand Up @@ -79,6 +79,7 @@ should accurately reflect that the ``FooPackage`` ZCML has been loaded::

``base2`` is a namespace package. ``base2.plug`` is a package that
defines a plugin for base2; it extends ``base2``s namespace.
This also tests that specifying a file with ``includePlugins`` works.

>>> from testdirective.zcml import clear_test_log
>>> clear_test_log()
Expand Down
2 changes: 1 addition & 1 deletion src/z3c/autoinclude/tests/base2/base2/configure.zcml
@@ -1,4 +1,4 @@
<configure xmlns="http://namespaces.zope.org/zope">
<include package="z3c.autoinclude" file="meta.zcml" />
<includePlugins package="." />
<includePlugins package="." file="configure.zcml" />
</configure>
4 changes: 4 additions & 0 deletions src/z3c/autoinclude/tests/tests.py
@@ -1,6 +1,7 @@
import re
import os
import doctest
import sys
import unittest

from zc.buildout import testing
Expand Down Expand Up @@ -59,6 +60,7 @@ def testSetUp(test):
testing.buildoutSetUp(test)
import tempfile
target_dir = tempfile.mkdtemp('.z3c.autoinclude.test-installs')
test._old_path = list(sys.path)
install_projects(test_packages, target_dir)


Expand All @@ -68,6 +70,8 @@ def testTearDown(test):

testing.buildoutTearDown(test)

sys.path = test._old_path


IGNORECASE = doctest.register_optionflag('IGNORECASE')

Expand Down
6 changes: 3 additions & 3 deletions src/z3c/autoinclude/zcml.py
Expand Up @@ -2,7 +2,7 @@
from zope.configuration.xmlconfig import include, includeOverrides
from zope.configuration.fields import GlobalObject
from zope.dottedname.resolve import resolve
from zope.schema import BytesLine
from zope.schema import NativeStringLine

from z3c.autoinclude import api
from z3c.autoinclude.dependency import DependencyFinder
Expand Down Expand Up @@ -66,7 +66,7 @@ def includeDependenciesOverridesDirective(_context, package):

class IIncludePluginsDirective(Interface):
"""Auto-include any ZCML in the dependencies of this package."""

package = GlobalObject(
title=u"Package to auto-include for",
description=u"""
Expand All @@ -75,7 +75,7 @@ class IIncludePluginsDirective(Interface):
required=True,
)

file = BytesLine(
file = NativeStringLine(
title=u"ZCML filename to look for",
description=u"""
Name of a particular ZCML file to look for.
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
@@ -1,6 +1,6 @@
[tox]
envlist =
py27, pypy, py34, py35
py27, pypy, py34, py35, py36, py37

[testenv]
deps =
Expand Down

0 comments on commit dec01d2

Please sign in to comment.