Skip to content

Commit

Permalink
Drop support for Python 3.4; add support for Python 3.8, 3.9, 3.10.
Browse files Browse the repository at this point in the history
Lint the code.
  • Loading branch information
Michael Howitz committed Aug 29, 2022
1 parent 7ae82ab commit f01dc9b
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 51 deletions.
5 changes: 5 additions & 0 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ testenv-deps = [

[coverage]
fail-under = 100

[manifest]
additional-rules = [
"recursive-include src *.zcml",
]
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Changes
4.4 (unreleased)
----------------

- Nothing changed yet.
- Drop support for Python 3.4.

- Add support for Python 3.8, 3.9, 3.10.


4.3 (2018-10-05)
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ recursive-include docs *.txt
recursive-include docs Makefile

recursive-include src *.py
recursive-include src *.zcml
99 changes: 52 additions & 47 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ 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',
Expand All @@ -36,51 +37,55 @@ def read(*rnames):

TESTS_REQUIRE = ZCML_REQUIRES

setup(name='zope.size',
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.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',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development',
],
packages=find_packages('src'),
package_dir={'': 'src'},
namespace_packages=['zope'],
extras_require={
'zcml': ZCML_REQUIRES,
'test': TESTS_REQUIRE,
'docs': [
'Sphinx',
'repoze.sphinx.autointerface',
],
},
install_requires=[
'setuptools',
'zope.interface',
'zope.i18nmessageid',
],
include_package_data=True,
zip_safe=False,
setup(
name='zope.size',
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.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'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'},
namespace_packages=['zope'],
extras_require={
'zcml': ZCML_REQUIRES,
'test': TESTS_REQUIRE,
'docs': [
'Sphinx',
'repoze.sphinx.autointerface',
],
},
install_requires=[
'setuptools',
'zope.interface',
'zope.i18nmessageid',
],
include_package_data=True,
zip_safe=False,
)
2 changes: 1 addition & 1 deletion src/zope/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
2 changes: 2 additions & 0 deletions src/zope/size/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

_ = MessageFactory('zope')


@implementer(ISized)
class DefaultSized(object):
"""
Expand Down Expand Up @@ -48,6 +49,7 @@ def sizeForDisplay(self):
return byteDisplay(size)
return _('not-available', 'n/a')


def byteDisplay(size):
"""
Returns a size with the correct unit (KB, MB), given the size in bytes.
Expand Down
3 changes: 1 addition & 2 deletions src/zope/size/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_configure_zcml_should_be_loadable(self):
try:
zope.configuration.xmlconfig.XMLConfig(
'configure.zcml', zope.size)()
except Exception as e: # pragma: no cover
except Exception as e: # pragma: no cover
self.fail(e)

def test_configure_should_register_n_components(self):
Expand Down Expand Up @@ -113,4 +113,3 @@ def test_byteDisplay(self):
self.assertEqual(byteDisplay(2048).mapping, {'size': '2'})
self.assertEqual(byteDisplay(2000000), '${size} MB')
self.assertEqual(byteDisplay(2000000).mapping, {'size': '1.91'})

0 comments on commit f01dc9b

Please sign in to comment.