From 7da331464b0abbab12b2d0d5e3d6c2e7d9fe3a2c Mon Sep 17 00:00:00 2001 From: "Gavin M. Roy" Date: Tue, 5 Mar 2019 09:32:00 -0500 Subject: [PATCH] Support Tornado 6, remove setuptools_scm --- docs/history.rst | 5 +++++ requires/installation.txt | 2 +- setup.cfg | 5 ++++- setup.py | 11 +++-------- sprockets/__init__.py | 1 + sprockets/mixins/__init__.py | 1 + sprockets/mixins/mediatype/__init__.py | 22 +++++++++++++++++++--- 7 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 sprockets/__init__.py create mode 100644 sprockets/mixins/__init__.py diff --git a/docs/history.rst b/docs/history.rst index 9651889..1eb73dc 100644 --- a/docs/history.rst +++ b/docs/history.rst @@ -1,6 +1,11 @@ Version History =============== +`3.0.1`_ (5 Mar 2019) +--------------------- +- Set Tornado PIN to >=5, <7 +- Remove setuptools_scm + `3.0.0`_ (4 Dec 2018) --------------------- - Add MessagePack dependencies to package extras (eg. `pip install sprockets.mixins.mediatype[msgpack]`) diff --git a/requires/installation.txt b/requires/installation.txt index 2a8bd43..0fbae78 100644 --- a/requires/installation.txt +++ b/requires/installation.txt @@ -1,2 +1,2 @@ ietfparse>=1.5.1,<2 -tornado>=5,<6 +tornado>=5,<7 diff --git a/setup.cfg b/setup.cfg index f1b8193..e666f36 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,4 +14,7 @@ exclude = build,env,.eggs [nosetests] cover-branches = 1 cover-erase = 1 -cover-package = sprockets.mixins +cover-package = sprockets.mixins.mediatype +logging-level=DEBUG +verbosity=2 +with-coverage=1 diff --git a/setup.py b/setup.py index 0f3ace5..63814cd 100755 --- a/setup.py +++ b/setup.py @@ -1,8 +1,8 @@ #!/usr/bin/env python -# import pathlib import setuptools +from sprockets.mixins import mediatype REPO_DIR = pathlib.Path(__name__).parent @@ -23,6 +23,7 @@ def read_requirements(name): setuptools.setup( name='sprockets.mixins.mediatype', + version=mediatype.__version__, description='A mixin for reporting handling content-type/accept headers', long_description=REPO_DIR.joinpath('README.rst').read_text(), url='https://github.com/sprockets/sprockets.mixins.mediatype', @@ -41,18 +42,12 @@ setuptools.setup( 'Topic :: Software Development :: Libraries', 'Topic :: Software Development :: Libraries :: Python Modules' ], - packages=[ - 'sprockets', - 'sprockets.mixins', - 'sprockets.mixins.mediatype' - ], + packages=setuptools.find_packages(), install_requires=read_requirements('requires/installation.txt'), tests_require=read_requirements('requires/testing.txt'), extras_require={ 'msgpack': ['u-msgpack-python>=2.5.0,<3'] }, - setup_requires=['setuptools_scm'], - use_scm_version=True, namespace_packages=['sprockets', 'sprockets.mixins'], test_suite='nose.collector', python_requires='>=3.7', diff --git a/sprockets/__init__.py b/sprockets/__init__.py new file mode 100644 index 0000000..de40ea7 --- /dev/null +++ b/sprockets/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/sprockets/mixins/__init__.py b/sprockets/mixins/__init__.py new file mode 100644 index 0000000..de40ea7 --- /dev/null +++ b/sprockets/mixins/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/sprockets/mixins/mediatype/__init__.py b/sprockets/mixins/mediatype/__init__.py index ad9c69b..802b408 100644 --- a/sprockets/mixins/mediatype/__init__.py +++ b/sprockets/mixins/mediatype/__init__.py @@ -2,11 +2,27 @@ sprockets.mixins.mediatype """ +try: + from .content import (ContentMixin, ContentSettings, + add_binary_content_type, add_text_content_type, + set_default_content_type) +except ImportError as error: # pragma no cover + def _error_closure(*args, **kwargs): + raise error -from .content import (ContentMixin, ContentSettings, - add_binary_content_type, add_text_content_type, - set_default_content_type) + class ErrorClosureClass(object): + def __init__(self, *args, **kwargs): + raise error + ContentMixin = ErrorClosureClass + ContentSettings = ErrorClosureClass + add_binary_content_type = _error_closure + add_text_content_type = _error_closure + set_default_content_type = _error_closure + + +version_info = (3, 0, 1) +__version__ = '.'.join(str(x) for x in version_info) __all__ = ['ContentMixin', 'ContentSettings', 'add_binary_content_type', 'add_text_content_type', 'set_default_content_type',