Hello community, here is the log from the commit of package python-CacheControl for openSUSE:Factory checked in at 2020-01-03 17:36:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-CacheControl (Old) and /work/SRC/openSUSE:Factory/.python-CacheControl.new.6675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-CacheControl" Fri Jan 3 17:36:41 2020 rev:7 rq:760434 version:0.12.6 Changes: -------- --- /work/SRC/openSUSE:Factory/python-CacheControl/python-CacheControl.changes 2019-11-01 15:14:06.804753129 +0100 +++ /work/SRC/openSUSE:Factory/.python-CacheControl.new.6675/python-CacheControl.changes 2020-01-03 17:36:43.467287659 +0100 @@ -1,0 +2,12 @@ +Thu Jan 2 11:57:41 UTC 2020 - John Vandenberg <jay...@gmail.com> + +- Drop merged pytest4.patch +- Add explanation of one test failure +- Remove mention of httplib2 from package summary +- Update to v0.12.6 + * Test if cache is None before falling back to DictCache + * Fixed body in 304 response to etag request + * Added check for "*" value in Vary header + * Make v4 cache compatible with msgpack 1.0 in the future + +------------------------------------------------------------------- Old: ---- CacheControl-0.12.5.tar.gz pytest4.patch New: ---- CacheControl-0.12.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-CacheControl.spec ++++++ --- /var/tmp/diff_new_pack.DIVV8a/_old 2020-01-03 17:36:44.231288052 +0100 +++ /var/tmp/diff_new_pack.DIVV8a/_new 2020-01-03 17:36:44.235288054 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-CacheControl # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,14 +18,13 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-CacheControl -Version: 0.12.5 +Version: 0.12.6 Release: 0 -Summary: httplib2 caching for requests +Summary: Caching library for Python requests License: Apache-2.0 Group: Development/Languages/Python URL: https://github.com/ionrock/cachecontrol -Source: https://github.com/ionrock/cachecontrol/archive/v0.12.5.tar.gz#/CacheControl-%{version}.tar.gz -Patch0: pytest4.patch +Source: https://github.com/ionrock/cachecontrol/archive/v%{version}.tar.gz#/CacheControl-%{version}.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -52,7 +51,6 @@ %prep %setup -q -n cachecontrol-%{version} -%patch0 -p1 %build %python_build @@ -62,8 +60,8 @@ %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -# These two failures are possibly bugs needing investigation -PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_bin_suffix} -v -k 'not test_file_cache_recognizes_consumed_file_handle and not test_etags_get_example' +# test_file_cache_recognizes_consumed_file_handle uses httpbin.org directly +PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_bin_suffix} -v -k 'not test_file_cache_recognizes_consumed_file_handle' %files %{python_files} %license LICENSE.txt ++++++ CacheControl-0.12.5.tar.gz -> CacheControl-0.12.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/.bumpversion.cfg new/cachecontrol-0.12.6/.bumpversion.cfg --- old/cachecontrol-0.12.5/.bumpversion.cfg 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/.bumpversion.cfg 2019-12-22 18:43:35.000000000 +0100 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.12.5 +current_version = 0.12.6 files = setup.py cachecontrol/__init__.py docs/conf.py commit = True tag = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/Makefile new/cachecontrol-0.12.6/Makefile --- old/cachecontrol-0.12.5/Makefile 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/Makefile 2019-12-22 18:43:35.000000000 +0100 @@ -46,10 +46,10 @@ $(VENV)/bin/py.test --cov cachecontrol release: dist - $(VENV)/bin/twine upload dist/CacheControl-*.tar.gz + $(VENV)/bin/twine upload dist/* dist: clean - python setup.py sdist + python setup.py sdist bdist_wheel ls -l dist bump: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/README.rst new/cachecontrol-0.12.6/README.rst --- old/cachecontrol-0.12.5/README.rst 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/README.rst 2019-12-22 18:43:35.000000000 +0100 @@ -13,7 +13,7 @@ requests_ session object. It was written because httplib2's better support for caching is often -mitigated by its lack of threadsafety. The same is true of requests in +mitigated by its lack of thread safety. The same is true of requests in terms of caching. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/cachecontrol/__init__.py new/cachecontrol-0.12.6/cachecontrol/__init__.py --- old/cachecontrol-0.12.5/cachecontrol/__init__.py 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/cachecontrol/__init__.py 2019-12-22 18:43:35.000000000 +0100 @@ -4,7 +4,7 @@ """ __author__ = "Eric Larson" __email__ = "e...@ionrock.org" -__version__ = "0.12.5" +__version__ = "0.12.6" from .wrapper import CacheControl from .adapter import CacheControlAdapter diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/cachecontrol/adapter.py new/cachecontrol-0.12.6/cachecontrol/adapter.py --- old/cachecontrol-0.12.5/cachecontrol/adapter.py 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/cachecontrol/adapter.py 2019-12-22 18:43:35.000000000 +0100 @@ -24,7 +24,7 @@ **kw ): super(CacheControlAdapter, self).__init__(*args, **kw) - self.cache = cache or DictCache() + self.cache = DictCache() if cache is None else cache self.heuristic = heuristic self.cacheable_methods = cacheable_methods or ("GET",) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/cachecontrol/controller.py new/cachecontrol-0.12.6/cachecontrol/controller.py --- old/cachecontrol-0.12.5/cachecontrol/controller.py 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/cachecontrol/controller.py 2019-12-22 18:43:35.000000000 +0100 @@ -34,7 +34,7 @@ def __init__( self, cache=None, cache_etags=True, serializer=None, status_codes=None ): - self.cache = cache or DictCache() + self.cache = DictCache() if cache is None else cache self.cache_etags = cache_etags self.serializer = serializer or Serializer() self.cacheable_status_codes = status_codes or (200, 203, 300, 301) @@ -293,6 +293,15 @@ if no_store: return + # https://tools.ietf.org/html/rfc7234#section-4.1: + # A Vary header field-value of "*" always fails to match. + # Storing such a response leads to a deserialization warning + # during cache lookup and is not allowed to ever be served, + # so storing it can be avoided. + if "*" in response_headers.get("vary", ""): + logger.debug('Response header has "Vary: *"') + return + # If we've been given an etag, then keep the response if self.cache_etags and "etag" in response_headers: logger.debug("Caching due to etag") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/cachecontrol/serialize.py new/cachecontrol-0.12.6/cachecontrol/serialize.py --- old/cachecontrol-0.12.5/cachecontrol/serialize.py 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/cachecontrol/serialize.py 2019-12-22 18:43:35.000000000 +0100 @@ -107,6 +107,8 @@ """ # Special case the '*' Vary value as it means we cannot actually # determine if the cached response is suitable for this request. + # This case is also handled in the controller code when creating + # a cache entry, but is left here for backwards compatibility. if "*" in cached.get("vary", {}): return @@ -179,7 +181,7 @@ def _loads_v4(self, request, data): try: - cached = msgpack.loads(data, encoding="utf-8") + cached = msgpack.loads(data, raw=False) except ValueError: return diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/cachecontrol/wrapper.py new/cachecontrol-0.12.6/cachecontrol/wrapper.py --- old/cachecontrol-0.12.5/cachecontrol/wrapper.py 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/cachecontrol/wrapper.py 2019-12-22 18:43:35.000000000 +0100 @@ -13,7 +13,7 @@ cacheable_methods=None, ): - cache = cache or DictCache() + cache = DictCache() if cache is None else cache adapter_class = adapter_class or CacheControlAdapter adapter = adapter_class( cache, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/dev_requirements.txt new/cachecontrol-0.12.6/dev_requirements.txt --- old/cachecontrol-0.12.5/dev_requirements.txt 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/dev_requirements.txt 2019-12-22 18:43:35.000000000 +0100 @@ -11,3 +11,4 @@ bumpversion twine black +wheel diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/docs/conf.py new/cachecontrol-0.12.6/docs/conf.py --- old/cachecontrol-0.12.5/docs/conf.py 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/docs/conf.py 2019-12-22 18:43:35.000000000 +0100 @@ -48,9 +48,9 @@ # built documents. # # The short X.Y version. -version = "0.12.5" +version = "0.12.6" # The full version, including alpha/beta/rc tags. -release = "0.12.5" +release = "0.12.6" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/docs/storage.rst new/cachecontrol-0.12.6/docs/storage.rst --- old/cachecontrol-0.12.5/docs/storage.rst 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/docs/storage.rst 2019-12-22 18:43:35.000000000 +0100 @@ -97,8 +97,17 @@ This is primarily a proof of concept, so please file bugs if there is a better method for utilizing redis as a cache. +Third-Party Cache Providers +=========================== + +* cachecontrol-django_ uses Django's caching mechanism. +* cachecontrol-uwsgi_ uses uWSGI's caching framework. + + .. _httplib2: http://code.google.com/p/httplib2/ .. _lockfile: https://github.com/smontanaro/pylockfile .. _requests 2.1: http://docs.python-requests.org/en/latest/community/updates/#id2 .. _redis: https://github.com/andymccurdy/redis-py +.. _cachecontrol-django: https://github.com/glassesdirect/cachecontrol-django +.. _cachecontrol-uwsgi: https://github.com/etene/cachecontrol-uwsgi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/setup.cfg new/cachecontrol-0.12.6/setup.cfg --- old/cachecontrol-0.12.5/setup.cfg 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/setup.cfg 2019-12-22 18:43:35.000000000 +0100 @@ -1,2 +1,5 @@ [tool:pytest] norecursedirs = bin lib include build + +[bdist_wheel] +universal = 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/setup.py new/cachecontrol-0.12.6/setup.py --- old/cachecontrol-0.12.5/setup.py 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/setup.py 2019-12-22 18:43:35.000000000 +0100 @@ -2,7 +2,7 @@ long_description = open("README.rst").read() -VERSION = "0.12.5" +VERSION = "0.12.6" setup_params = dict( name="CacheControl", @@ -17,7 +17,7 @@ include_package_data=True, description="httplib2 caching for requests", long_description=long_description, - install_requires=["requests", "msgpack"], + install_requires=["requests", "msgpack>=0.5.2"], extras_require={"filecache": ["lockfile>=0.9"], "redis": ["redis>=2.10.5"]}, entry_points={"console_scripts": ["doesitcache = cachecontrol._cmd:main"]}, python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/tests/conftest.py new/cachecontrol-0.12.6/tests/conftest.py --- old/cachecontrol-0.12.5/tests/conftest.py 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/tests/conftest.py 2019-12-22 18:43:35.000000000 +0100 @@ -64,6 +64,7 @@ headers = [("Etag", self.etag_string)] if env.get("HTTP_IF_NONE_MATCH") == self.etag_string: start_response("304 Not Modified", headers) + return [] else: start_response("200 OK", headers) return [pformat(env).encode("utf8")] @@ -107,7 +108,7 @@ @pytest.fixture(scope="session") def server(): - return pytest.server + return cherrypy.server @pytest.fixture() @@ -124,7 +125,7 @@ return ip, port -def pytest_namespace(): +def pytest_configure(config): cherrypy.tree.graft(SimpleApp(), "/") ip, port = get_free_port() @@ -136,7 +137,6 @@ logger.removeHandler(logger.handlers[0]) cherrypy.server.start() - return {"server": cherrypy.server} def pytest_unconfigure(config): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cachecontrol-0.12.5/tests/test_cache_control.py new/cachecontrol-0.12.6/tests/test_cache_control.py --- old/cachecontrol-0.12.5/tests/test_cache_control.py 2018-06-07 16:53:04.000000000 +0200 +++ new/cachecontrol-0.12.6/tests/test_cache_control.py 2019-12-22 18:43:35.000000000 +0100 @@ -112,6 +112,14 @@ assert not cc.cache.set.called + def test_no_cache_with_vary_star(self, cc): + # Vary: * indicates that the response can never be served + # from the cache, so storing it can be avoided. + resp = self.resp({"vary": "*"}) + cc.cache_response(self.req(), resp) + + assert not cc.cache.set.called + def test_update_cached_response_with_valid_headers(self): cached_resp = Mock(headers={"ETag": "jfd9094r808", "Content-Length": 100})