Skip to content

Commit

Permalink
Merge pull request #1 from zopefoundation/python3
Browse files Browse the repository at this point in the history
Add support for Python 3 and PyPy
  • Loading branch information
jamadden committed May 5, 2017
2 parents 2f708ec + d7b9e73 commit 70d53a7
Show file tree
Hide file tree
Showing 26 changed files with 599 additions and 169 deletions.
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[run]
source = src

[report]
exclude_lines =
pragma: no cover
if __name__ == '__main__':
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ build/
dist/
*.egg-info/
.tox/
.coverage
htmlcov/
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
language: python
sudo: false
python:
- 2.7
- pypy-5.4.1
- 3.4
- 3.5
- 3.6
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 --auto-color --auto-progress
notifications:
email: false
after_success:
- coveralls
cache: pip
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
19 changes: 12 additions & 7 deletions CHANGES.txt → CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
=======
CHANGES
=======
=========
CHANGES
=========

3.10.3 (unreleased)
===================
4.0.0 (unreleased)
==================

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

- Replaced an undeclared test dependency on zope.app.authentication with
zope.password.

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

3.10.2 (2010-09-14)
===================

Expand Down Expand Up @@ -37,12 +42,12 @@ Refactor package, spliting it to several new packages:
See zope.ptresource's CHANGES.txt for more information.

* ``zope.browsermenu`` - the menu mechanism was moved here completely.

* ``zope.browserpage`` - the browser:page directive and friends were
moved here. Also, these directives don't depend hardly on menu system
anymore, so they simply ignore the "menu" argument when zope.browsermenu
is not available.

Backward-compatibility imports are provided, so there should not be much impact
for those who uses old imports.

Expand Down
6 changes: 5 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
include *.py
include *.txt
include *.rst
include buildout.cfg
include .travis.yml
include tox.ini
include .coverage
recursive-include src *.pt
recursive-include src *.txt
recursive-include src *.rst
recursive-include src *.zcml
File renamed without changes.
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
121 changes: 79 additions & 42 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,58 +20,95 @@
"""
from setuptools import setup, find_packages

long_description = (open('README.txt').read() + '\n\n' +
open('CHANGES.txt').read())
version = '4.0.0.dev0'

def _read(fname):
with open(fname, 'r') as f:
return f.read()

long_description = (_read('README.rst') + '\n\n' +
_read('CHANGES.rst'))

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='zope.app.publisher',
version = '3.10.3dev',
url='http://pypi.python.org/pypi/zope.app.publisher/',
version=version,
url='http://github.com/zopefoundation/zope.app.publisher/',
author='Zope Corporation and Contributors',
author_email='zope-dev@zope.org',
classifiers = ['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Zope Public License',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Framework :: Zope3',
],
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.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',
],
description='Implementations and means for configuration of Zope 3-'
'style views and resources.',
long_description=long_description,
license='ZPL 2.1',

packages=find_packages('src'),
package_dir={'': 'src'},

namespace_packages=['zope', 'zope.app'],
include_package_data=True,
install_requires=['setuptools',
'zope.browsermenu',
'zope.browserpage',
'zope.browserresource',
'zope.component',
'zope.configuration',
'zope.datetime',
'zope.interface',
'zope.location',
'zope.ptresource',
'zope.publisher>=3.12',
'zope.schema',
'zope.security',
'zope.componentvocabulary',
],
install_requires=[
'setuptools',
'zope.browsermenu',
'zope.browserpage',
'zope.browserresource',
'zope.component',
'zope.configuration',
'zope.datetime',
'zope.interface',
'zope.location',
'zope.ptresource',
'zope.publisher>=3.12',
'zope.schema',
'zope.security',
'zope.componentvocabulary',
],
extras_require={
'test': ['zope.testing',
'zope.app.testing',
'zope.app.zcmlfiles',
'zope.container>=3.9',
'zope.securitypolicy',
'zope.site',
'zope.login',
'zope.password',
],
},

zip_safe = False,
)
'test': tests_require,
},
tests_require=tests_require,
zip_safe=False,
)
8 changes: 1 addition & 7 deletions src/zope/__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__) # pragma: no cover
8 changes: 1 addition & 7 deletions src/zope/app/__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__) # pragma: no cover
8 changes: 4 additions & 4 deletions src/zope/app/publisher/browser/managementviewselector.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
##############################################################################
"""Selecting first available and allowed management view
$Id$
"""
from zope.interface import implements

from zope.interface import implementer
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.publisher.browser import BrowserView
from zope.browsermenu.menu import getFirstMenuItem

@implementer(IBrowserPublisher)
class ManagementViewSelector(BrowserView):
"""View that selects the first available management view.
Support 'zmi_views' actions like: 'javascript:alert("hello")',
Support 'zmi_views' actions like: 'javascript:alert("hello")',
'../view_on_parent.html' or '++rollover++'.
"""
implements(IBrowserPublisher)

def browserDefault(self, request):
return self, ()
Expand Down
6 changes: 3 additions & 3 deletions src/zope/app/publisher/browser/vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
##############################################################################
"""Browser vocabularies
$Id$
"""
from zope.interface import classProvides
from zope.interface import provider
from zope.publisher.interfaces.browser import IBrowserSkinType
from zope.schema.interfaces import IVocabularyFactory
from zope.componentvocabulary.vocabulary import UtilityVocabulary

@provider(IVocabularyFactory)
class BrowserSkinsVocabulary(UtilityVocabulary):
classProvides(IVocabularyFactory)

interface = IBrowserSkinType
Loading

0 comments on commit 70d53a7

Please sign in to comment.