Skip to content

Commit

Permalink
Python 3 and PyPy support.
Browse files Browse the repository at this point in the history
The code is very simple This was mostly test changes, and the change
to account for __setslice__ finally going away.

- 100% test coverage
- Drop a bunch of testing dependencies and be specific about what we
  do need.
- Rename .txt files to .rst as needed. Fix a --pypi-strict rendering
  error in README.rst.
- Multiline traceback reprs don't work well with
  IGNORE_EXCEPTION_MODULE_IN_PYTHON2, so a few of those had to be
  transformed into print().

Fixes #1.
  • Loading branch information
jamadden committed May 3, 2017
1 parent c30f5ca commit 4f25274
Show file tree
Hide file tree
Showing 20 changed files with 647 additions and 242 deletions.
7 changes: 7 additions & 0 deletions .coveragerc
@@ -0,0 +1,7 @@
[run]
source = src

[report]
exclude_lines =
pragma: no cover
if __name__ == '__main__':
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -7,3 +7,5 @@ __pycache__/
build/
dist/
*.egg-info/
.coverage
htmlcov/
27 changes: 22 additions & 5 deletions .travis.yml
@@ -1,9 +1,26 @@
language: python
sudo: false
python:
- 2.7
install:
- pip install .
- 2.7
- 3.4
- 3.5
- 3.6
- pypy-5.4.1
script:
- python setup.py test -q
- coverage run -m zope.testrunner --test-path=src --auto-color --auto-progress

after_success:
- coveralls
notifications:
email: false
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
7 changes: 5 additions & 2 deletions CHANGES.txt → CHANGES.rst
Expand Up @@ -2,10 +2,13 @@
CHANGES
=======

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

- ...
- Add support for Python 3.4, 3.5, 3.6 and PyPy.

- Remove test dependency on ``zope.app.testing`` and
``zope.app.zcmlfiles``, among others.


2.0.0 (2012-11-17)
Expand Down
9 changes: 6 additions & 3 deletions MANIFEST.in
@@ -1,8 +1,11 @@
global-include *.txt
include *.txt
recursive-include src/z3c/baseregistry *.txt *.zcml
include *.rst
include tox.ini
include .coveragerc
include .travis.yml
include buildout.cfg
recursive-include src/z3c/baseregistry *.rst *.zcml

# added by check_manifest.py
include *.py
include .travis.yml
include buildout.cfg
File renamed without changes.
2 changes: 2 additions & 0 deletions setup.cfg
@@ -0,0 +1,2 @@
[bdist_wheel]
universal = 1
108 changes: 71 additions & 37 deletions setup.py
Expand Up @@ -12,67 +12,101 @@
#
##############################################################################
"""Setup
$Id$
"""
import os
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()

tests_require = [
'zope.app.appsetup',
'zope.app.authentication',
'zope.app.basicskin >= 4.0.0',
'zope.app.container >= 4.0.0',
'zope.app.form >= 5.0.0',
'zope.app.publisher',
'zope.app.publication',
'zope.app.rotterdam >= 4.0.0',
'zope.app.schema >= 4.0.0',
'zope.app.wsgi',

'zope.browserpage',
'zope.browserresource',
'zope.container',
'zope.formlib',
'zope.login',
'zope.principalannotation',
'zope.principalregistry',
'zope.publisher',
'zope.securitypolicy',
'zope.testbrowser >= 5.2',
'zope.testing',
'zope.testrunner',
'zope.traversing >= 4.1.0',

'webtest',
]

setup (
name = "z3c.baseregistry",
version='2.0.1dev',
author = "Stephan Richter, Roger Ineichen and the Zope Community",
author_email = "zope-dev@zope.org",
description = "Manage IComponents instances using Python code and ZCML.",
name="z3c.baseregistry",
version='2.1.0.dev0',
author="Stephan Richter, Roger Ineichen and the Zope Community",
author_email="zope-dev@zope.org",
description="Manage IComponents instances using Python code and ZCML.",
long_description=(
read('README.txt')
read('README.rst')
+ '\n\n' +
'Detailed Documentation\n'
'**********************'
+ '\n\n' +
read('src', 'z3c', 'baseregistry', 'README.txt')
read('src', 'z3c', 'baseregistry', 'README.rst')
+ '\n\n' +
read('CHANGES.txt')
read('CHANGES.rst')
),
license = "ZPL 2.1",
keywords = "zope3 z3c component global registry baseregistry",
classifiers = [
license="ZPL 2.1",
keywords="zope3 z3c component global registry baseregistry",
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.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.baseregistry',
packages = find_packages('src'),
include_package_data = True,
package_dir = {'':'src'},
namespace_packages = ['z3c'],
extras_require = dict(
test=[
'zope.app.testing',
'zope.testing',
'Framework :: Zope3'
],
url='http://github.com/zopefoundation/z3c.baseregistry',
packages=find_packages('src'),
include_package_data=True,
package_dir={'':'src'},
namespace_packages=['z3c'],
extras_require={
'test': tests_require,
'zmi': [
'zope.formlib',
],
zmi=[
'zope.formlib',
'zope.app.zcmlfiles',
]
),
install_requires = [
],
},
tests_require=tests_require,
install_requires=[
'setuptools',
'zope.component >= 3.9.4',
'zope.configuration >= 3.8.0',
'zope.i18nmessageid',
'zope.component[hook,zcml] >= 4.3.0',
'zope.configuration >= 4.1.0',
'zope.i18nmessageid >= 2.2',
'zope.interface',
'zope.schema',
'zope.site',
],
zip_safe = False,
)
],
zip_safe=False,
)
8 changes: 1 addition & 7 deletions src/z3c/__init__.py
@@ -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__) # pragma: no cover

0 comments on commit 4f25274

Please sign in to comment.