Skip to content

Commit

Permalink
Add Python 3.4/5/6, drop 3.3 and 2.6
Browse files Browse the repository at this point in the history
Fixes #2

- Rename .txt -> .rst
- Universal wheels
- Modern tox.ini and .travis.yml
  - Add coverage environment and coveralls
- Use zope.testrunner for the namespace path issue.
  • Loading branch information
jamadden committed Oct 16, 2017
1 parent edf8d2f commit aecf445
Show file tree
Hide file tree
Showing 14 changed files with 115 additions and 77 deletions.
11 changes: 11 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[run]
source = z3c.macro

[report]
precision = 2
exclude_lines =
pragma: no cover
if __name__ == '__main__':
raise NotImplementedError
self.fail
raise AssertionError
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ bin
develop-eggs
docs
parts
.coverage
htmlcov/
17 changes: 13 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
language: python
sudo: false
python:
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- pypy
- pypy3
install:
- pip install .
- pip install -U pip setuptools
- pip install -U coverage coveralls
- pip install -U -e .[test]
script:
- python setup.py test -q
- coverage run -m zope.testrunner --test-path=src
after_success:
- coveralls
notifications:
email: false
cache: pip
8 changes: 5 additions & 3 deletions CHANGES.txt → CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
CHANGES
=======

2.0.1 (unreleased)
2.1.0 (unreleased)
------------------

- Nothing changed yet.
- Drop support for Python 2.6 and 3.3.
- Add support for Python 3.4, 3.5 and 3.6.
- Add support for PyPy.


2.0.0 (2015-11-09)
------------------

- Standardize namespace __init__
- Standardize namespace ``__init__``.


2.0.0a1 (2013-02-25)
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ include *.txt
include *.py
include buildout.cfg
include tox.ini
include .travis.yml
include .coveragerc

recursive-include src *

Expand Down
16 changes: 16 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. image:: https://img.shields.io/pypi/v/z3c.macro.svg
:target: https://pypi.python.org/pypi/z3c.macro/
:alt: Latest release

.. image:: https://img.shields.io/pypi/pyversions/z3c.macro.svg
:target: https://pypi.org/project/z3c.macro/
:alt: Supported Python versions

.. image:: https://travis-ci.org/zopefoundation/z3c.macro.svg?branch=master
:target: https://travis-ci.org/zopefoundation/z3c.macro

.. image:: https://coveralls.io/repos/github/zopefoundation/z3c.macro/badge.svg?branch=master
:target: https://coveralls.io/github/zopefoundation/z3c.macro?branch=master

This package provides an adapter and a TALES expression for a more explicit and
more flexible macro handling using the adapter registry for macros.
2 changes: 0 additions & 2 deletions README.txt

This file was deleted.

2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
universal = 1
85 changes: 43 additions & 42 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,62 +17,69 @@
from setuptools import setup, find_packages

def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
with open(os.path.join(os.path.dirname(__file__), *rnames)) as f:
return f.read()

CHAMELEON_REQUIRES = [
'z3c.pt >= 2.1',
'z3c.ptcompat >= 1.0',
]

TESTS_REQUIRE = CHAMELEON_REQUIRES + [
'z3c.template',
'zope.browserpage >= 3.12',
'zope.testing',
'zope.testrunner',
]

setup(
name='z3c.macro',
version='2.0.1.dev0',
author = "Roger Ineichen and the Zope Community",
author_email = "zope-dev@zope.org",
description = "Simpler definition of ZPT macros.",
author="Roger Ineichen and the Zope Community",
author_email="zope-dev@zope.org",
description="Simpler definition of ZPT macros.",
long_description=(
read('README.txt')
read('README.rst')
+ '\n\n' +
'Detailed Documentation\n'
'======================\n'
+ '\n\n' +
read('src', 'z3c', 'macro', 'README.txt')
read('src', 'z3c', 'macro', 'README.rst')
+ '\n\n' +
read('src', 'z3c', 'macro', 'zcml.txt')
read('src', 'z3c', 'macro', 'zcml.rst')
+ '\n\n' +
read('CHANGES.txt')
read('CHANGES.rst')
),
license = "ZPL 2.1",
keywords = "zope3 macro pagetemplate zpt",
classifiers = [
license="ZPL 2.1",
keywords="zope3 macro pagetemplate zpt",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Zope Public License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'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 :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Framework :: Zope3'],
url = 'http://pypi.python.org/pypi/z3c.macro',
packages = find_packages('src'),
package_dir = {'':'src'},
namespace_packages = ['z3c'],
extras_require = dict(
test = [
'z3c.pt >= 2.1',
'z3c.ptcompat>=1.0',
'z3c.template',
'zope.browserpage>=3.12',
'zope.testing',
],
chameleon = [
'z3c.pt >= 2.1',
'z3c.ptcompat>=1.0',
],
),
install_requires = [
'Framework :: Zope3',
],
url='https://github.com/zopefoundation/z3c.macro',
packages=find_packages('src'),
package_dir={'':'src'},
namespace_packages=['z3c'],
extras_require={
'test': TESTS_REQUIRE,
'chameleon': CHAMELEON_REQUIRES,
},
install_requires=[
'setuptools',
'zope.component',
'zope.configuration',
Expand All @@ -82,14 +89,8 @@ def read(*rnames):
'zope.schema',
'zope.tales',
],
tests_require=[
'z3c.pt >= 2.1',
'z3c.ptcompat>=1.0',
'z3c.template',
'zope.browserpage>=3.12',
'zope.testing',
],
tests_require=TESTS_REQUIRE,
test_suite='z3c.macro.tests.test_suite',
include_package_data = True,
zip_safe = False,
)
include_package_data=True,
zip_safe=False,
)
8 changes: 1 addition & 7 deletions src/z3c/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
__import__('pkg_resources').declare_namespace(__name__)
File renamed without changes.
10 changes: 6 additions & 4 deletions src/z3c/macro/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ def tearDown(test):

def test_suite():
tests = ((
doctest.DocFileSuite('README.txt',
doctest.DocFileSuite(
'README.rst',
setUp=setUp, tearDown=tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
),
doctest.DocFileSuite('zcml.txt', setUp=setUp, tearDown=tearDown,
),
doctest.DocFileSuite(
'zcml.rst', setUp=setUp, tearDown=tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,),
) for setUp in (setUpZ3CPT, setUpZPT))
) for setUp in (setUpZ3CPT, setUpZPT))

return unittest.TestSuite(itertools.chain(*tests))

Expand Down
File renamed without changes.
29 changes: 14 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
[tox]
envlist =
py26,py27,py33
py27,py34,py35,py36,pypy,pypy3,coverage

[testenv]
commands =
python setup.py test -q
zope-testrunner --test-path=src []
deps =
setuptools
zope.component
zope.configuration
zope.interface
zope.pagetemplate
zope.publisher
zope.schema
zope.tales
z3c.pt
z3c.ptcompat
z3c.template
zope.browserpage
zope.testing
.[test]

[testenv:coverage]
usedevelop = true
basepython =
python2.7
commands =
coverage run -m zope.testrunner --test-path=src []
coverage report --fail-under=95
deps =
{[testenv]deps}
coverage

0 comments on commit aecf445

Please sign in to comment.