Skip to content

Commit

Permalink
Merge pull request #4 from zopefoundation/py36
Browse files Browse the repository at this point in the history
Add Python 3.6, drop Python 3.3
  • Loading branch information
jamadden committed Jul 27, 2017
2 parents 98b1847 + abaef35 commit 0bbde60
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 64 deletions.
9 changes: 9 additions & 0 deletions .coveragerc
@@ -0,0 +1,9 @@
[run]
source = zope.size

[report]
exclude_lines =
pragma: no cover
if __name__ == '__main__':
raise NotImplementedError
self.fail
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -10,5 +10,6 @@ bin
build
develop-eggs
parts

.coverage
htmlcov/
docs/_build/
13 changes: 9 additions & 4 deletions .travis.yml
Expand Up @@ -2,14 +2,19 @@ language: python
sudo: false
python:
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- pypy
- pypy3
- pypy3.5-5.8.0
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 setup.py -q test -q
after_success:
- coveralls
notifications:
email: false
cache: pip
6 changes: 3 additions & 3 deletions CHANGES.rst
Expand Up @@ -4,9 +4,9 @@ Changes
4.2.0 (unreleased)
------------------

- Add support for Python 3.5.
- Add support for Python 3.5 and 3.6.

- Drop support for Python 2.6 and 3.2.
- Drop support for Python 2.6, 3.2 and 3.3.


4.1.0 (2014-12-29)
Expand Down Expand Up @@ -35,7 +35,7 @@ Changes

- Add support for Python 3.2 and 3.3.

- Conditionally disable tests that require ``zope.configuration`` and
- Conditionally disable tests that require ``zope.configuration`` and
``zope.security``.


Expand Down
17 changes: 15 additions & 2 deletions MANIFEST.in
@@ -1,2 +1,15 @@
include *.txt bootstrap.py buildout.cfg tox.ini
recursive-include src *.py *.txt *.zcml
include *.txt
include *.rst
include bootstrap.py
include buildout.cfg
include tox.ini
include .travis.yml
include .coveragerc

recursive-include src *.py
recursive-include src *.txt
recursive-include src *.zcml

recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs Makefile
20 changes: 17 additions & 3 deletions README.rst
@@ -1,13 +1,25 @@
``zope.size``
=============
===============
``zope.size``
===============

.. image:: https://img.shields.io/pypi/v/zope.size.svg
:target: https://pypi.python.org/pypi/zope.size/
:alt: Latest release

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

.. image:: https://travis-ci.org/zopefoundation/zope.size.png?branch=master
:target: https://travis-ci.org/zopefoundation/zope.size

.. image:: https://readthedocs.org/projects/zopesize/badge/?version=latest
:target: http://zopesize.readthedocs.io/en/latest/?badge=latest
:target: https://zopesize.readthedocs.io/en/latest/
:alt: Documentation Status

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

This package provides a definition of simple interface that allows
applications to retrieve the size of the object for displaying and for sorting.

Expand All @@ -16,3 +28,5 @@ method that returns size in bytes. However, the adapter won't crash if an
object doesn't have one and will show size as "not available" instead.

Development is hosted at https://github.com/zopefoundation/zope.size

Documentation is hosted at https://zopesize.readthedocs.io
2 changes: 2 additions & 0 deletions setup.cfg
@@ -0,0 +1,2 @@
[bdist_wheel]
universal = 1
75 changes: 42 additions & 33 deletions setup.py
Expand Up @@ -25,47 +25,56 @@ def read(*rnames):
with open(os.path.join(os.path.dirname(__file__), *rnames)) as f:
return f.read()

ZCML_REQUIRES = [
'zope.component[zcml]',
'zope.configuration',
'zope.security[zcml]',
]

TESTS_REQUIRE = ZCML_REQUIRES

setup(name='zope.size',
version=read('version.txt'),
url='http://zopesize.readthedocs.io',
version=read('version.txt').strip(),
url='http://github.com/zopefoundation/zope.size',
license='ZPL 2.1',
description=\
'Interfaces and simple adapter that give the size of an object',
keywords="size display human bytes",
author='Zope Foundation and Contributors',
author_email='zope-dev@zope.org',
long_description=read('README.rst') + '\n\n' + read('CHANGES.rst'),
classifiers=[
'Development Status :: 5 - Production/Stable',
'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 :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development',
],
'Development Status :: 5 - Production/Stable',
'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',
'Topic :: Software Development',
],
packages=find_packages('src'),
package_dir = {'': 'src'},
package_dir={'': 'src'},
namespace_packages=['zope'],
tests_require = [],
tests_require=TESTS_REQUIRE,
test_suite='zope.size.tests.test_suite',
extras_require=dict(
zcml=[
'zope.component[zcml]',
'zope.configuration',
'zope.security[zcml]',
]),
install_requires=['setuptools',
'zope.interface',
'zope.i18nmessageid'],
include_package_data = True,
zip_safe = False,
)
extras_require={
'zcml': ZCML_REQUIRES,
'test': TESTS_REQUIRE,
},
install_requires=[
'setuptools',
'zope.interface',
'zope.i18nmessageid',
],
include_package_data=True,
zip_safe=False,
)
2 changes: 1 addition & 1 deletion src/zope/__init__.py
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
18 changes: 4 additions & 14 deletions src/zope/size/tests.py
Expand Up @@ -18,11 +18,8 @@
from zope.size.interfaces import ISized
import zope.size

try:
import zope.component
import zope.configuration.xmlconfig
except:
pass
import zope.component
import zope.configuration.xmlconfig


class ZCMLTest(unittest.TestCase):
Expand All @@ -31,7 +28,7 @@ def test_configure_zcml_should_be_loadable(self):
try:
zope.configuration.xmlconfig.XMLConfig(
'configure.zcml', zope.size)()
except Exception as e:
except Exception as e: # pragma: no cover
self.fail(e)

def test_configure_should_register_n_components(self):
Expand Down Expand Up @@ -117,11 +114,4 @@ def test_byteDisplay(self):


def test_suite():
tests = [Test]
try:
import zope.configuration
tests.append(ZCMLTest)
except:
pass

return unittest.TestSuite([unittest.makeSuite(cls) for cls in tests])
return unittest.defaultTestLoader.loadTestsFromName(__name__)
19 changes: 16 additions & 3 deletions tox.ini
@@ -1,6 +1,19 @@
[tox]
envlist = py27,py33,py34,py35,pypy,pypy3
envlist = py27,py34,py35,py36,pypy,pypy3

[testenv]
commands = python setup.py -q test -q
deps = zope.testrunner
commands =
python setup.py -q test -q
deps =
.[test]

[testenv:coverage]
usedevelop = true
basepython =
python2.7
commands =
coverage run setup.py -q test -q
coverage report --fail-under=100
deps =
{[testenv]deps}
coverage

0 comments on commit 0bbde60

Please sign in to comment.