Hello community, here is the log from the commit of package python-zipp for openSUSE:Factory checked in at 2020-10-29 09:46:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-zipp (Old) and /work/SRC/openSUSE:Factory/.python-zipp.new.3463 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-zipp" Thu Oct 29 09:46:13 2020 rev:9 rq:838271 version:3.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-zipp/python-zipp.changes 2020-04-19 21:40:03.054946893 +0200 +++ /work/SRC/openSUSE:Factory/.python-zipp.new.3463/python-zipp.changes 2020-10-29 09:46:15.104052180 +0100 @@ -1,0 +2,12 @@ +Mon Sep 28 12:03:20 UTC 2020 - Dirk Mueller <dmuel...@suse.com> + +- update to 3.2.0: + * #57 and bpo-40564: Mutate the passed ZipFile object + type instead of making a copy. Prevents issues when + both the local copy and the caller's copy attempt to + close the same file handle. + * #56 and bpo-41035: ``Path._next`` now honors + subclasses. + * #55: ``Path.is_file()`` now returns False for non-existent names. + +------------------------------------------------------------------- Old: ---- zipp-3.1.0.tar.gz New: ---- zipp-3.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-zipp.spec ++++++ --- /var/tmp/diff_new_pack.IVHmSC/_old 2020-10-29 09:46:15.760052800 +0100 +++ /var/tmp/diff_new_pack.IVHmSC/_new 2020-10-29 09:46:15.760052800 +0100 @@ -27,7 +27,7 @@ %bcond_with test %endif Name: python-zipp%{psuffix} -Version: 3.1.0 +Version: 3.2.0 Release: 0 Summary: Pathlib-compatible object wrapper for zip files License: MIT ++++++ zipp-3.1.0.tar.gz -> zipp-3.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/.pre-commit-config.yaml new/zipp-3.2.0/.pre-commit-config.yaml --- old/zipp-3.1.0/.pre-commit-config.yaml 2020-03-03 11:58:43.000000000 +0100 +++ new/zipp-3.2.0/.pre-commit-config.yaml 2020-09-22 17:28:55.000000000 +0200 @@ -1,10 +1,10 @@ repos: - repo: https://github.com/psf/black - rev: 19.10b0 + rev: stable hooks: - id: black - repo: https://github.com/asottile/blacken-docs - rev: v1.4.0 + rev: v1.8.0 hooks: - id: blacken-docs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/.travis.yml new/zipp-3.2.0/.travis.yml --- old/zipp-3.1.0/.travis.yml 2020-03-03 11:58:43.000000000 +0100 +++ new/zipp-3.2.0/.travis.yml 2020-09-22 17:28:55.000000000 +0200 @@ -1,4 +1,4 @@ -dist: xenial +dist: bionic language: python python: @@ -8,10 +8,11 @@ cache: pip install: -- pip install tox tox-venv +# ensure virtualenv is upgraded to avoid issues like jaraco/path#188 +- pip install -U --upgrade-strategy=eager tox before_script: - # Disable IPv6. Ref travis-ci/travis-ci#8361 + # Enable IPv6. Ref travis-ci/travis-ci#8361 - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'; fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/CHANGES.rst new/zipp-3.2.0/CHANGES.rst --- old/zipp-3.1.0/CHANGES.rst 2020-03-03 11:58:43.000000000 +0100 +++ new/zipp-3.2.0/CHANGES.rst 2020-09-22 17:28:55.000000000 +0200 @@ -1,3 +1,16 @@ +v3.2.0 +====== + +#57 and bpo-40564: Mutate the passed ZipFile object +type instead of making a copy. Prevents issues when +both the local copy and the caller's copy attempt to +close the same file handle. + +#56 and bpo-41035: ``Path._next`` now honors +subclasses. + +#55: ``Path.is_file()`` now returns False for non-existent names. + v3.1.0 ====== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/PKG-INFO new/zipp-3.2.0/PKG-INFO --- old/zipp-3.1.0/PKG-INFO 2020-03-03 11:59:12.363708500 +0100 +++ new/zipp-3.2.0/PKG-INFO 2020-09-22 17:29:17.801306000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: zipp -Version: 3.1.0 +Version: 3.2.0 Summary: Backport of pathlib-compatible object wrapper for zip files Home-page: https://github.com/jaraco/zipp Author: Jason R. Coombs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/appveyor.yml new/zipp-3.2.0/appveyor.yml --- old/zipp-3.1.0/appveyor.yml 2020-03-03 11:58:43.000000000 +0100 +++ new/zipp-3.2.0/appveyor.yml 2020-09-22 17:28:55.000000000 +0200 @@ -18,7 +18,7 @@ - '%LOCALAPPDATA%\pip\Cache' test_script: - - "python -m pip install -U tox tox-venv virtualenv" + - "python -m pip install -U tox virtualenv" - "tox" version: '{build}' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/azure-pipelines.yml new/zipp-3.2.0/azure-pipelines.yml --- old/zipp-3.1.0/azure-pipelines.yml 2020-03-03 11:58:43.000000000 +0100 +++ new/zipp-3.2.0/azure-pipelines.yml 2020-09-22 17:28:55.000000000 +0200 @@ -11,10 +11,12 @@ - '*' pool: - vmimage: 'Ubuntu-18.04' + vmImage: $(pool_vm_image) variables: - group: Azure secrets +- name: pool_vm_image + value: Ubuntu-18.04 stages: - stage: Test @@ -23,17 +25,38 @@ - job: 'Test' strategy: matrix: - Python36: + Bionic Python 3.6: python.version: '3.6' - Python38: + Bionic Python 3.8: python.version: '3.8' + Windows Python 3.8: + python.version: '3.8' + pool_vm_image: vs2017-win2016 + Windows Python Prerelease: + python.version: '3.9' + pool_vm_image: vs2017-win2016 + MacOS: + python.version: '3.8' + pool_vm_image: macos-10.15 + maxParallel: 4 steps: + - task: NuGetToolInstaller@1 + displayName: 'Install NuGet' + condition: eq(variables['pool_vm_image'], 'vs2017-win2016') + + - powershell: | + nuget install python -Prerelease -OutputDirectory "$(Build.BinariesDirectory)" -ExcludeVersion -NonInteractive + Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\python\tools" + Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\python\tools\Scripts" + condition: and(succeeded(), and(eq(variables['python.version'], '3.9'), eq(variables['pool_vm_image'], 'vs2017-win2016'))) + - task: UsePythonVersion@0 inputs: versionSpec: '$(python.version)' architecture: 'x64' + condition: and(succeeded(), ne(variables['python.version'], '3.9')) - script: python -m pip install tox displayName: 'Install tox' @@ -66,6 +89,7 @@ tox -e release env: TWINE_PASSWORD: $(PyPI-token) + GITHUB_TOKEN: $(Github-token) displayName: 'publish to PyPI' condition: contains(variables['Build.SourceBranch'], 'tags') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/mypy.ini new/zipp-3.2.0/mypy.ini --- old/zipp-3.1.0/mypy.ini 1970-01-01 01:00:00.000000000 +0100 +++ new/zipp-3.2.0/mypy.ini 2020-09-22 17:28:55.000000000 +0200 @@ -0,0 +1,2 @@ +[mypy] +ignore_missing_imports = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/pyproject.toml new/zipp-3.2.0/pyproject.toml --- old/zipp-3.1.0/pyproject.toml 2020-03-03 11:58:43.000000000 +0100 +++ new/zipp-3.2.0/pyproject.toml 2020-09-22 17:28:55.000000000 +0200 @@ -6,3 +6,17 @@ skip-string-normalization = true [tool.setuptools_scm] + +# jaraco/skeleton#22 +[tool.jaraco.pytest.plugins.black] +addopts = "--black" + +# jaraco/skeleton#22 +[tool.jaraco.pytest.plugins.mypy] +addopts = "--mypy" + +[tool.jaraco.pytest.plugins.flake8] +addopts = "--flake8" + +[tool.jaraco.pytest.plugins.cov] +addopts = "--cov" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/pytest.ini new/zipp-3.2.0/pytest.ini --- old/zipp-3.1.0/pytest.ini 1970-01-01 01:00:00.000000000 +0100 +++ new/zipp-3.2.0/pytest.ini 2020-09-22 17:28:55.000000000 +0200 @@ -0,0 +1,9 @@ +[pytest] +norecursedirs=dist build .tox .eggs +addopts=--doctest-modules +doctest_optionflags=ALLOW_UNICODE ELLIPSIS +# workaround for warning pytest-dev/pytest#6178 +junit_family=xunit2 +filterwarnings= + # https://github.com/pytest-dev/pytest/issues/6928 + ignore:direct construction of .*Item has been deprecated:DeprecationWarning diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/setup.cfg new/zipp-3.2.0/setup.cfg --- old/zipp-3.1.0/setup.cfg 2020-03-03 11:59:12.363708500 +0100 +++ new/zipp-3.2.0/setup.cfg 2020-09-22 17:29:17.805306200 +0200 @@ -23,6 +23,13 @@ [options.extras_require] testing = + pytest >= 3.5, !=3.7.3 + pytest-checkdocs >= 1.2.3 + pytest-flake8 + pytest-black >= 0.3.7; python_implementation != "PyPy" + pytest-cov + pytest-mypy; python_implementation != "PyPy" + jaraco.test >= 3.2.0 jaraco.itertools func-timeout diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/skeleton.md new/zipp-3.2.0/skeleton.md --- old/zipp-3.1.0/skeleton.md 2020-03-03 11:58:43.000000000 +0100 +++ new/zipp-3.2.0/skeleton.md 2020-09-22 17:28:55.000000000 +0200 @@ -40,6 +40,10 @@ Whenever a change is needed or desired for the general technique for packaging, it can be made in the skeleton project and then merged into each of the derived projects as needed, recommended before each release. As a result, features and best practices for packaging are centrally maintained and readily trickle into a whole suite of packages. This technique lowers the amount of tedious work necessary to create or maintain a project, and coupled with other techniques like continuous integration and deployment, lowers the cost of creating and maintaining refined Python projects to just a few, familiar Git operations. +For example, here's a session of the [path project](https://pypi.org/project/path) pulling non-conflicting changes from the skeleton: + +<img src="https://raw.githubusercontent.com/jaraco/skeleton/gh-pages/docs/refresh.svg"> + Thereafter, the target project can make whatever customizations it deems relevant to the scaffolding. The project may even at some point decide that the divergence is too great to merit renewed merging with the original skeleton. This approach applies maximal guidance while creating minimal constraints. # Features @@ -120,7 +124,7 @@ Features include: - test against Python 3 -- run on Ubuntu Xenial +- run on Ubuntu Bionic - correct for broken IPv6 ### AppVeyor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/test_zipp.py new/zipp-3.2.0/test_zipp.py --- old/zipp-3.1.0/test_zipp.py 2020-03-03 11:58:43.000000000 +0100 +++ new/zipp-3.2.0/test_zipp.py 2020-09-22 17:28:55.000000000 +0200 @@ -101,12 +101,24 @@ assert g.is_dir() c, f, d = b.iterdir() assert c.is_file() and f.is_file() - e, = d.iterdir() + (e,) = d.iterdir() assert e.is_file() - h, = g.iterdir() - i, = h.iterdir() + (h,) = g.iterdir() + (i,) = h.iterdir() assert i.is_file() + def test_is_file_missing(self): + for alpharep in self.zipfile_alpharep(): + root = zipp.Path(alpharep) + assert not root.joinpath('missing.txt').is_file() + + def test_iterdir_on_file(self): + for alpharep in self.zipfile_alpharep(): + root = zipp.Path(alpharep) + a, b, g = root.iterdir() + with self.assertRaises(ValueError): + a.iterdir() + def test_subdir_is_dir(self): for alpharep in self.zipfile_alpharep(): root = zipp.Path(alpharep) @@ -142,6 +154,14 @@ with self.assertRaises(IsADirectoryError): zf.joinpath('b').open() + def test_open_binary_invalid_args(self): + for alpharep in self.zipfile_alpharep(): + root = zipp.Path(alpharep) + with self.assertRaises(ValueError): + root.joinpath('a.txt').open('rb', encoding='utf-8') + with self.assertRaises(ValueError): + root.joinpath('a.txt').open('rb', 'utf-8') + def test_open_missing_directory(self): """ Attempting to open a missing directory raises FileNotFoundError. @@ -160,7 +180,7 @@ def test_joinpath(self): for alpharep in self.zipfile_alpharep(): root = zipp.Path(alpharep) - a = root.joinpath("a") + a = root.joinpath("a.txt") assert a.is_file() e = root.joinpath("b").joinpath("d").joinpath("e.txt") assert e.read_text() == "content of e" @@ -168,7 +188,7 @@ def test_traverse_truediv(self): for alpharep in self.zipfile_alpharep(): root = zipp.Path(alpharep) - a = root / "a" + a = root / "a.txt" assert a.is_file() e = root / "b" / "d" / "e.txt" assert e.read_text() == "content of e" @@ -226,11 +246,9 @@ a, b, g = root.iterdir() alpharep.writestr('foo.txt', 'foo') alpharep.writestr('bar/baz.txt', 'baz') - assert any( - child.name == 'foo.txt' - for child in root.iterdir()) + assert any(child.name == 'foo.txt' for child in root.iterdir()) assert (root / 'foo.txt').read_text() == 'foo' - baz, = (root / 'bar').iterdir() + (baz,) = (root / 'bar').iterdir() assert baz.read_text() == 'baz' HUGE_ZIPFILE_NUM_ENTRIES = 2 ** 13 @@ -259,3 +277,17 @@ def test_implied_dirs_performance(self): data = ['/'.join(string.ascii_lowercase + str(n)) for n in range(10000)] zipp.CompleteDirs._implied_dirs(data) + + def test_read_does_not_close(self): + for alpharep in self.zipfile_ondisk(): + with zipfile.ZipFile(alpharep) as file: + for rep in range(2): + zipp.Path(file, 'a.txt').read_text() + + def test_subclass(self): + class Subclass(zipp.Path): + pass + + for alpharep in self.zipfile_alpharep(): + root = Subclass(alpharep) + assert isinstance(root / 'b', Subclass) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/tox.ini new/zipp-3.2.0/tox.ini --- old/zipp-3.1.0/tox.ini 2020-03-03 11:58:43.000000000 +0100 +++ new/zipp-3.2.0/tox.ini 2020-09-22 17:28:55.000000000 +0200 @@ -3,17 +3,12 @@ minversion = 3.2 # https://github.com/jaraco/skeleton/issues/6 tox_pip_extensions_ext_venv_update = true -# Ensure that a late version of pip is used even on tox-venv. -requires = - tox-pip-version>=0.0.6 - tox-venv [testenv] deps = -pip_version = pip commands = - python -m unittest discover + pytest {posargs} usedevelop = True extras = testing @@ -31,11 +26,14 @@ pep517>=0.5 twine[keyring]>=1.13 path + jaraco.develop>=7.1 passenv = TWINE_PASSWORD + GITHUB_TOKEN setenv = TWINE_USERNAME = {env:TWINE_USERNAME:__token__} commands = python -c "import path; path.Path('dist').rmtree_p()" python -m pep517.build . python -m twine upload dist/* + python -m jaraco.develop.create-github-release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/zipp.egg-info/PKG-INFO new/zipp-3.2.0/zipp.egg-info/PKG-INFO --- old/zipp-3.1.0/zipp.egg-info/PKG-INFO 2020-03-03 11:59:11.000000000 +0100 +++ new/zipp-3.2.0/zipp.egg-info/PKG-INFO 2020-09-22 17:29:17.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: zipp -Version: 3.1.0 +Version: 3.2.0 Summary: Backport of pathlib-compatible object wrapper for zip files Home-page: https://github.com/jaraco/zipp Author: Jason R. Coombs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/zipp.egg-info/SOURCES.txt new/zipp-3.2.0/zipp.egg-info/SOURCES.txt --- old/zipp-3.1.0/zipp.egg-info/SOURCES.txt 2020-03-03 11:59:12.000000000 +0100 +++ new/zipp-3.2.0/zipp.egg-info/SOURCES.txt 2020-09-22 17:29:17.000000000 +0200 @@ -9,7 +9,9 @@ appveyor.yml azure-pipelines.yml conftest.py +mypy.ini pyproject.toml +pytest.ini setup.cfg setup.py skeleton.md diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/zipp.egg-info/requires.txt new/zipp-3.2.0/zipp.egg-info/requires.txt --- old/zipp-3.1.0/zipp.egg-info/requires.txt 2020-03-03 11:59:11.000000000 +0100 +++ new/zipp-3.2.0/zipp.egg-info/requires.txt 2020-09-22 17:29:17.000000000 +0200 @@ -5,5 +5,14 @@ rst.linker>=1.9 [testing] +pytest!=3.7.3,>=3.5 +pytest-checkdocs>=1.2.3 +pytest-flake8 +pytest-cov +jaraco.test>=3.2.0 jaraco.itertools func-timeout + +[testing:platform_python_implementation != "PyPy"] +pytest-black>=0.3.7 +pytest-mypy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zipp-3.1.0/zipp.py new/zipp-3.2.0/zipp.py --- old/zipp-3.1.0/zipp.py 2020-03-03 11:58:43.000000000 +0100 +++ new/zipp-3.2.0/zipp.py 2020-09-22 17:28:55.000000000 +0200 @@ -105,13 +105,12 @@ if not isinstance(source, zipfile.ZipFile): return cls(_pathlib_compat(source)) - # Only allow for FastPath when supplied zipfile is read-only + # Only allow for FastLookup when supplied zipfile is read-only if 'r' not in source.mode: cls = CompleteDirs - res = cls.__new__(cls) - vars(res).update(vars(source)) - return res + source.__class__ = cls + return source class FastLookup(CompleteDirs): @@ -119,6 +118,7 @@ ZipFile subclass to ensure implicit dirs exist and are resolved rapidly. """ + def namelist(self): with contextlib.suppress(AttributeError): return self.__names @@ -211,6 +211,15 @@ __repr = "{self.__class__.__name__}({self.root.filename!r}, {self.at!r})" def __init__(self, root, at=""): + """ + Construct a Path from a ZipFile or filename. + + Note: When the source is an existing ZipFile object, + its type (__class__) will be mutated to a + specialized type. If the caller wishes to retain the + original type, the caller should either create a + separate ZipFile object or pass a filename. + """ self.root = FastLookup.make(root) self.at = at @@ -248,13 +257,13 @@ return posixpath.dirname(path.at.rstrip("/")) == self.at.rstrip("/") def _next(self, at): - return Path(self.root, at) + return self.__class__(self.root, at) def is_dir(self): return not self.at or self.at.endswith("/") def is_file(self): - return not self.is_dir() + return self.exists() and not self.is_dir() def exists(self): return self.at in self.root._name_set()