Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-wcmatch for openSUSE:Factory checked in at 2024-03-13 22:21:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-wcmatch (Old) and /work/SRC/openSUSE:Factory/.python-wcmatch.new.1770 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-wcmatch" Wed Mar 13 22:21:39 2024 rev:5 rq:1157753 version:8.5.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-wcmatch/python-wcmatch.changes 2024-01-03 12:31:46.122341075 +0100 +++ /work/SRC/openSUSE:Factory/.python-wcmatch.new.1770/python-wcmatch.changes 2024-03-13 22:23:00.278066650 +0100 @@ -1,0 +2,6 @@ +Wed Mar 13 19:02:53 UTC 2024 - Dirk Müller <[email protected]> + +- update to 8.5.1: + * Fix issue with type check failure in `wcmatch.glob`. + +------------------------------------------------------------------- Old: ---- wcmatch-8.5.tar.gz New: ---- wcmatch-8.5.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-wcmatch.spec ++++++ --- /var/tmp/diff_new_pack.AJWUPa/_old 2024-03-13 22:23:00.674081266 +0100 +++ /var/tmp/diff_new_pack.AJWUPa/_new 2024-03-13 22:23:00.678081413 +0100 @@ -19,7 +19,7 @@ %{?sle15_python_module_pythons} %{?python_enable_dependency_generator} Name: python-wcmatch -Version: 8.5 +Version: 8.5.1 Release: 0 Summary: Wildcard/glob file name matcher License: MIT ++++++ wcmatch-8.5.tar.gz -> wcmatch-8.5.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/LICENSE.md new/wcmatch-8.5.1/LICENSE.md --- old/wcmatch-8.5/LICENSE.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/LICENSE.md 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 - 2023 Isaac Muse +Copyright (c) 2018 - 2024 Isaac Muse Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/PKG-INFO new/wcmatch-8.5.1/PKG-INFO --- old/wcmatch-8.5/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: wcmatch -Version: 8.5 +Version: 8.5.1 Summary: Wildcard/glob file name matcher. Project-URL: Homepage, https://github.com/facelessuser/wcmatch Author-email: Isaac Muse <[email protected]> @@ -25,7 +25,6 @@ Description-Content-Type: text/markdown [![Donate via PayPal][donate-image]][donate-link] -[![Discord][discord-image]][discord-link] [![Build][github-ci-image]][github-ci-link] [![Coverage Status][codecov-image]][codecov-link] [![PyPI Version][pypi-image]][pypi-link] @@ -87,11 +86,9 @@ MIT -[github-ci-image]: https://github.com/facelessuser/wcmatch/workflows/build/badge.svg?branch=master&event=push -[github-ci-link]: https://github.com/facelessuser/wcmatch/actions?query=workflow%3Abuild+branch%3Amaster -[discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333 -[discord-link]:https://discord.gg/TWs8Tgr -[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/wcmatch/master.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333 +[github-ci-image]: https://github.com/facelessuser/wcmatch/workflows/build/badge.svg?branch=main&event=push +[github-ci-link]: https://github.com/facelessuser/wcmatch/actions?query=workflow%3Abuild+branch%3Amain +[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/wcmatch/main.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333 [codecov-link]: https://codecov.io/github/facelessuser/wcmatch [pypi-image]: https://img.shields.io/pypi/v/wcmatch.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333 [pypi-down]: https://img.shields.io/pypi/dm/wcmatch.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/README.md new/wcmatch-8.5.1/README.md --- old/wcmatch-8.5/README.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/README.md 2020-02-02 01:00:00.000000000 +0100 @@ -1,5 +1,4 @@ [![Donate via PayPal][donate-image]][donate-link] -[![Discord][discord-image]][discord-link] [![Build][github-ci-image]][github-ci-link] [![Coverage Status][codecov-image]][codecov-link] [![PyPI Version][pypi-image]][pypi-link] @@ -61,11 +60,9 @@ MIT -[github-ci-image]: https://github.com/facelessuser/wcmatch/workflows/build/badge.svg?branch=master&event=push -[github-ci-link]: https://github.com/facelessuser/wcmatch/actions?query=workflow%3Abuild+branch%3Amaster -[discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333 -[discord-link]:https://discord.gg/TWs8Tgr -[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/wcmatch/master.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333 +[github-ci-image]: https://github.com/facelessuser/wcmatch/workflows/build/badge.svg?branch=main&event=push +[github-ci-link]: https://github.com/facelessuser/wcmatch/actions?query=workflow%3Abuild+branch%3Amain +[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/wcmatch/main.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333 [codecov-link]: https://codecov.io/github/facelessuser/wcmatch [pypi-image]: https://img.shields.io/pypi/v/wcmatch.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333 [pypi-down]: https://img.shields.io/pypi/dm/wcmatch.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/docs/src/markdown/about/changelog.md new/wcmatch-8.5.1/docs/src/markdown/about/changelog.md --- old/wcmatch-8.5/docs/src/markdown/about/changelog.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/docs/src/markdown/about/changelog.md 2020-02-02 01:00:00.000000000 +0100 @@ -1,5 +1,9 @@ # Changelog +## 8.5.1 + +- **FIX**: Fix issue with type check failure in `wcmatch.glob`. + ## 8.5 - **NEW**: Formally support Python 3.11 (no change). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/hatch_build.py new/wcmatch-8.5.1/hatch_build.py --- old/wcmatch-8.5/hatch_build.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/hatch_build.py 2020-02-02 01:00:00.000000000 +0100 @@ -15,24 +15,12 @@ return module.__version_info__._get_dev_status() -def get_requirements(root): - """Load list of dependencies.""" - - install_requires = [] - with open(os.path.join(root, "requirements", "setup.txt")) as f: - for line in f: - if not line.startswith("#"): - install_requires.append(line.strip()) - return install_requires - - class CustomMetadataHook(MetadataHookInterface): """Our metadata hook.""" def update(self, metadata): """See https://ofek.dev/hatch/latest/plugins/metadata-hook/ for more information.""" - metadata["dependencies"] = get_requirements(self.root) metadata["classifiers"] = [ f"Development Status :: {get_version_dev_status(self.root)}", 'Environment :: Console', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/mkdocs.yml new/wcmatch-8.5.1/mkdocs.yml --- old/wcmatch-8.5/mkdocs.yml 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/mkdocs.yml 2020-02-02 01:00:00.000000000 +0100 @@ -4,7 +4,7 @@ edit_uri: tree/main/docs/src/markdown site_description: A wildcard file name matching library copyright: | - Copyright © 2014 - 2023 <a href="https://github.com/facelessuser" target="_blank" rel="noopener">Isaac Muse</a> + Copyright © 2014 - 2024 <a href="https://github.com/facelessuser" target="_blank" rel="noopener">Isaac Muse</a> docs_dir: docs/src/markdown theme: @@ -85,8 +85,8 @@ - pymdownx.caret: - pymdownx.smartsymbols: - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg - pymdownx.escapeall: hardbreak: True nbsp: True @@ -120,6 +120,35 @@ - example - quote - pymdownx.blocks.details: + types: + - name: details-new + class: new + - name: details-settings + class: settings + - name: details-note + class: note + - name: details-abstract + class: abstract + - name: details-info + class: info + - name: details-tip + class: tip + - name: details-success + class: success + - name: details-question + class: question + - name: details-warning + class: warning + - name: details-failure + class: failure + - name: details-danger + class: danger + - name: details-bug + class: bug + - name: details-example + class: example + - name: details-quote + class: quote - pymdownx.blocks.html: - pymdownx.blocks.definition: - pymdownx.blocks.tab: @@ -129,8 +158,6 @@ social: - icon: fontawesome/brands/github link: https://github.com/facelessuser - - icon: fontawesome/brands/discord - link: https://discord.gg/TWs8Tgr plugins: - search diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/pyproject.toml new/wcmatch-8.5.1/pyproject.toml --- old/wcmatch-8.5/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 @@ -21,10 +21,13 @@ ] dynamic = [ "classifiers", - "dependencies", "version", ] +dependencies = [ + "bracex>=2.1.1" +] + [project.urls] Homepage = "https://github.com/facelessuser/wcmatch" @@ -53,8 +56,7 @@ "/tools/**/*.py", "/.pyspelling.yml", "/.coveragerc", - "/mkdocs.yml", - "/tox.ini", + "/mkdocs.yml" ] [tool.mypy] @@ -65,3 +67,78 @@ show_error_codes = true [tool.hatch.metadata.hooks.custom] + +[tool.ruff] +line-length = 120 + +select = [ + "A", # flake8-builtins + "B", # flake8-bugbear + "D", # pydocstyle + "C4", # flake8-comprehensions + "N", # pep8-naming + "E", # pycodestyle + "F", # pyflakes + "PGH", # pygrep-hooks + "RUF", # ruff + # "UP", # pyupgrade + "W", # pycodestyle + "YTT", # flake8-2020, + "PERF" # Perflint +] + +ignore = [ + "E741", + "D202", + "D401", + "D212", + "D203", + "D417", + "N802", + "N801", + "N803", + "N806", + "N818", + "RUF012", + "RUF005", + "PGH004", + "RUF100" +] + +[tool.tox] +legacy_tox_ini = """ +[tox] +isolated_build = true +skipsdist=true +envlist= + py38,py39,py310,py311,py312, + lint + +[testenv] +passenv=LANG +deps= + . + -r requirements/test.txt +commands= + {envpython} -m mypy + {envpython} -m pytest --cov wcmatch --cov-append tests + {envpython} -m coverage html -d {envtmpdir}/coverage + {envpython} -m coverage xml + {envpython} -m coverage report --show-missing + +[testenv:lint] +deps= + -r requirements/lint.txt +commands= + "{envbindir}"/ruff check . + +[testenv:documents] +deps= + -r requirements/docs.txt +commands= + {envpython} -m mkdocs build --clean --verbose --strict + {envbindir}/pyspelling + +[pytest] +addopts=-p no:warnings +""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/requirements/lint.txt new/wcmatch-8.5.1/requirements/lint.txt --- old/wcmatch-8.5/requirements/lint.txt 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/requirements/lint.txt 2020-02-02 01:00:00.000000000 +0100 @@ -1,5 +1 @@ -flake8 -flake8-docstrings -pep8-naming -flake8-mutable -flake8-builtins +ruff diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/tests/test_fnmatch.py new/wcmatch-8.5.1/tests/test_fnmatch.py --- old/wcmatch-8.5/tests/test_fnmatch.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/tests/test_fnmatch.py 2020-02-02 01:00:00.000000000 +0100 @@ -761,12 +761,12 @@ def test_match_set(self): """Test `set` matching.""" - self.assertTrue(fnmatch.fnmatch('a', set(['a']))) + self.assertTrue(fnmatch.fnmatch('a', {'a'})) def test_match_tuple(self): """Test `tuple` matching.""" - self.assertTrue(fnmatch.fnmatch('a', tuple(['a']))) + self.assertTrue(fnmatch.fnmatch('a', ('a',))) def test_match_list(self): """Test `list` matching.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/tests/test_glob.py new/wcmatch-8.5.1/tests/test_glob.py --- old/wcmatch-8.5/tests/test_glob.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/tests/test_glob.py 2020-02-02 01:00:00.000000000 +0100 @@ -115,7 +115,7 @@ del self._environ[k] else: self._environ[k] = v - os.environ = self._environ + os.environ = self._environ # noqa: B003 @contextlib.contextmanager @@ -124,6 +124,7 @@ Return a context manager that changes the current working directory. Arguments: + --------- path: the directory to use as the temporary current working directory. quiet: if False (the default), the context manager raises an exception on error. Otherwise, it issues only a warning and keeps the current @@ -265,7 +266,7 @@ try: os.makedirs(base) retry = 0 - except Exception: + except Exception: # noqa: PERF203 retry -= 1 create_empty_file(filename) @@ -298,7 +299,7 @@ try: shutil.rmtree(cls.tempdir) retry = 0 - except Exception: + except Exception: # noqa: PERF203 retry -= 1 @staticmethod diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/tests/test_globmatch.py new/wcmatch-8.5.1/tests/test_globmatch.py --- old/wcmatch-8.5/tests/test_globmatch.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/tests/test_globmatch.py 2020-02-02 01:00:00.000000000 +0100 @@ -70,7 +70,7 @@ try: os.makedirs(base) retry = 0 - except Exception: + except Exception: # noqa: PERF203 retry -= 1 create_empty_file(filename) @@ -105,7 +105,7 @@ while os.path.exists(self.tempdir): pass retry = 0 - except Exception: + except Exception: # noqa: PERF203 retry -= 1 @@ -134,7 +134,8 @@ class TestGlobFilter: - """Test matches against `globfilter`. + """ + Test matches against `globfilter`. Each list entry in `cases` is run through the `globsplit` and then `globfilter`. Entries are run through `globsplit` ensure it does not add any unintended side effects. @@ -1255,11 +1256,9 @@ self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, b'!**/*.md', flags=self.flags | glob.SPLIT ) for x in glob.glob(b'!**/*.md', flags=self.flags | glob.SPLIT) - ] ) ) @@ -1271,66 +1270,52 @@ # UNC mounts are special cases and it matters there. self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '**/../*.{md,py}', flags=self.flags ) for x in glob.glob('**/../*.{md,py}', flags=self.flags) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, './**/./../*.py', flags=self.flags ) for x in glob.glob('./**/./../*.py', flags=self.flags) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, './///**///./../*.py', flags=self.flags ) for x in glob.glob('./**/.//////..////*.py', flags=self.flags) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '**/docs/**', flags=self.flags ) for x in glob.glob('**/docs/**', flags=self.flags) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '**/docs/**|!**/*.md', flags=self.flags | glob.SPLIT ) for x in glob.glob('**/docs/**|!**/*.md', flags=self.flags | glob.SPLIT) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '!**/*.md', flags=self.flags | glob.SPLIT ) for x in glob.glob('!**/*.md', flags=self.flags | glob.SPLIT) - ] ) ) self.assertFalse( all( - [ - glob.globmatch( + glob.globmatch( x, '**/docs/**|!**/*.md', flags=self.flags | glob.SPLIT ) for x in glob.glob('**/docs/**', flags=self.flags | glob.SPLIT) - ] ) ) @@ -1342,39 +1327,31 @@ # UNC mounts are special cases and it matters there. self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '**/docs/**', flags=self.flags | glob.MARK ) for x in glob.glob('**/docs/**', flags=self.flags | glob.MARK) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '**/docs/**|!**/*.md', flags=self.flags | glob.SPLIT | glob.MARK ) for x in glob.glob('**/docs/**|!**/*.md', flags=self.flags | glob.SPLIT | glob.MARK) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '!**/*.md', flags=self.flags | glob.SPLIT | glob.MARK ) for x in glob.glob('!**/*.md', flags=self.flags | glob.SPLIT | glob.MARK) - ] ) ) self.assertFalse( all( - [ - glob.globmatch( + glob.globmatch( x, '**/docs/**|!**/*.md', flags=self.flags | glob.SPLIT | glob.MARK ) for x in glob.glob('**/docs/**', flags=self.flags | glob.SPLIT | glob.MARK) - ] ) ) @@ -1386,65 +1363,51 @@ # UNC mounts are special cases and it matters there. self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '**/../*.{md,py}', flags=self.flags | glob.REALPATH ) for x in glob.glob('**/../*.{md,py}', flags=self.flags) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, './**/./../*.py', flags=self.flags | glob.REALPATH ) for x in glob.glob('./**/./../*.py', flags=self.flags) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, './///**///./../*.py', flags=self.flags | glob.REALPATH ) for x in glob.glob('./**/.//////..////*.py', flags=self.flags) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '**/docs/**', flags=self.flags | glob.REALPATH ) for x in glob.glob('**/docs/**', flags=self.flags) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '**/docs/**|!**/*.md', flags=self.flags | glob.SPLIT | glob.REALPATH ) for x in glob.glob('**/docs/**|!**/*.md', flags=self.flags | glob.SPLIT) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '!**/*.md', flags=self.flags | glob.SPLIT | glob.REALPATH ) for x in glob.glob('!**/*.md', flags=self.flags | glob.SPLIT) - ] ) ) self.assertFalse( all( - [ - glob.globmatch( + glob.globmatch( x, '**/docs/**|!**/*.md', flags=self.flags | glob.SPLIT | glob.REALPATH ) for x in glob.glob('**/docs/**', flags=self.flags | glob.SPLIT) - ] ) ) @@ -1456,38 +1419,30 @@ # UNC mounts are special cases and it matters there. self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '**/docs/**', flags=self.flags | glob.REALPATH | glob.MARK ) for x in glob.glob('**/docs/**', flags=self.flags | glob.MARK) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '**/docs/**|!**/*.md', flags=self.flags | glob.SPLIT | glob.REALPATH | glob.MARK ) for x in glob.glob('**/docs/**|!**/*.md', flags=self.flags | glob.SPLIT | glob.MARK) - ] ) ) self.assertTrue( all( - [ - glob.globmatch( + glob.globmatch( x, '!**/*.md', flags=self.flags | glob.SPLIT | glob.REALPATH | glob.MARK ) for x in glob.glob('!**/*.md', flags=self.flags | glob.SPLIT | glob.MARK) - ] ) ) self.assertFalse( all( - [ - glob.globmatch( + glob.globmatch( x, '**/docs/**|!**/*.md', flags=self.flags | glob.SPLIT | glob.REALPATH | glob.MARK ) for x in glob.glob('**/docs/**', flags=self.flags | glob.SPLIT | glob.MARK) - ] ) ) @@ -1603,7 +1558,7 @@ root_dir=pathlib.Path('docs/src') ) - self.assertTrue(all([isinstance(result, pathlib.Path) for result in results])) + self.assertTrue(all(isinstance(result, pathlib.Path) for result in results)) def test_filter_root_dir_pathlib_bytes(self): """Test root directory with `globfilter`.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/tests/test_pathlib.py new/wcmatch-8.5.1/tests/test_pathlib.py --- old/wcmatch-8.5/tests/test_pathlib.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/tests/test_pathlib.py 2020-02-02 01:00:00.000000000 +0100 @@ -15,6 +15,7 @@ Return a context manager that changes the current working directory. Arguments: + --------- path: the directory to use as the temporary current working directory. quiet: if False (the default), the context manager raises an exception on error. Otherwise, it issues only a warning and keeps the current @@ -53,7 +54,7 @@ with change_cwd(os.path.dirname(abspath)): results = list(p.glob('docs/**/*.md', flags=pathlib.GLOBSTAR)) self.assertTrue(len(results)) - self.assertTrue(all([file.suffix == '.md' for file in results])) + self.assertTrue(all(file.suffix == '.md' for file in results)) def test_relative_exclude(self): """Test relative path exclude.""" @@ -63,7 +64,7 @@ with change_cwd(os.path.dirname(abspath)): results = list(p.glob('docs/**/*.md|!**/index.md', flags=pathlib.GLOBSTAR | pathlib.NEGATE | pathlib.SPLIT)) self.assertTrue(len(results)) - self.assertTrue(all([file.name != 'index.md' for file in results])) + self.assertTrue(all(file.name != 'index.md' for file in results)) def test_glob(self): """Test globbing function.""" @@ -74,7 +75,7 @@ results = list(p.glob('**/*.md', flags=pathlib.GLOBSTAR)) self.assertTrue(len(results)) - self.assertTrue(all([file.suffix == '.md' for file in results])) + self.assertTrue(all(file.suffix == '.md' for file in results)) def test_rglob(self): """Test globbing function.""" @@ -82,15 +83,15 @@ p = pathlib.Path('docs') results = list(p.rglob('*.md')) self.assertTrue(len(results)) - self.assertTrue(all([file.suffix == '.md' for file in results])) + self.assertTrue(all(file.suffix == '.md' for file in results)) results = list(p.rglob('*.md')) self.assertTrue(len(results)) - self.assertTrue(all([file.suffix == '.md' for file in results])) + self.assertTrue(all(file.suffix == '.md' for file in results)) results = list(p.rglob('markdown/*.md')) self.assertTrue(len(results)) - self.assertTrue(all([file.suffix == '.md' for file in results])) + self.assertTrue(all(file.suffix == '.md' for file in results)) def test_integrity(self): """Test glob integrity, or better put, test the path structure comes out sane.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/tests/test_wcmatch.py new/wcmatch-8.5.1/tests/test_wcmatch.py --- old/wcmatch-8.5/tests/test_wcmatch.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/tests/test_wcmatch.py 2020-02-02 01:00:00.000000000 +0100 @@ -67,7 +67,7 @@ try: os.makedirs(base) retry = 0 - except Exception: + except Exception: # noqa: PERF203 retry -= 1 create_empty_file(filename) @@ -105,7 +105,7 @@ try: shutil.rmtree(self.tempdir) retry = 0 - except Exception: + except Exception: # noqa: PERF203 retry -= 1 def crawl_files(self, walker): @@ -282,7 +282,7 @@ ) records = 0 - for f in walker.imatch(): + for _f in walker.imatch(): records += 1 walker.kill() self.assertEqual(records, 1) @@ -308,7 +308,7 @@ walker.kill() records = 0 - for f in walker.imatch(): + for _f in walker.imatch(): records += 1 self.assertTrue(records == 0 or walker.get_skipped() == 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/tox.ini new/wcmatch-8.5.1/tox.ini --- old/wcmatch-8.5/tox.ini 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/tox.ini 1970-01-01 01:00:00.000000000 +0100 @@ -1,39 +0,0 @@ -[tox] -isolated_build = true -skipsdist=true -envlist= - py38,py39,py310,py311,py312, - lint - -[testenv] -passenv=LANG -deps= - -r requirements/setup.txt - -r requirements/test.txt -commands= - {envpython} -m mypy - {envpython} -m pytest --cov wcmatch --cov-append tests - {envpython} -m coverage html -d {envtmpdir}/coverage - {envpython} -m coverage xml - {envpython} -m coverage report --show-missing - -[testenv:lint] -deps= - -r requirements/lint.txt -commands= - {envbindir}/flake8 . - -[testenv:documents] -deps= - -r requirements/docs.txt -commands= - {envpython} -m mkdocs build --clean --verbose --strict - {envbindir}/pyspelling - -[flake8] -exclude=build/*,.tox/*,dist/* -max-line-length=120 -ignore=D202,D203,D401,N802,N801,N803,N806,E741,W504,N818 - -[pytest] -addopts=-p no:warnings diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/wcmatch/__meta__.py new/wcmatch-8.5.1/wcmatch/__meta__.py --- old/wcmatch-8.5/wcmatch/__meta__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/wcmatch/__meta__.py 2020-02-02 01:00:00.000000000 +0100 @@ -194,5 +194,5 @@ return Version(major, minor, micro, release, pre, post, dev) -__version_info__ = Version(8, 5, 0, "final") +__version_info__ = Version(8, 5, 1, "final") __version__ = __version_info__._get_canonical() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/wcmatch/_wcparse.py new/wcmatch-8.5.1/wcmatch/_wcparse.py --- old/wcmatch-8.5/wcmatch/_wcparse.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/wcmatch/_wcparse.py 2020-02-02 01:00:00.000000000 +0100 @@ -375,10 +375,10 @@ complete = 1 first = 1 count = 0 - for count, m in enumerate(RE_WIN_DRIVE_PART.finditer(pattern, m.end(0)), 1): - end = m.end(0) - part.append(RE_WIN_DRIVE_UNESCAPE.sub(r'\1', m.group(1))) - slash = bool(m.group(2)) + for count, m2 in enumerate(RE_WIN_DRIVE_PART.finditer(pattern, m.end(0)), 1): + end = m2.end(0) + part.append(RE_WIN_DRIVE_UNESCAPE.sub(r'\1', m2.group(1))) + slash = bool(m2.group(2)) if is_special: if count == first and part[-1].lower() == 'unc': complete += 2 @@ -412,7 +412,7 @@ if unix: magic_drive = set() # type: set[AnyStr] else: - magic_drive = set([slash]) + magic_drive = {slash} magic |= cast('set[AnyStr]', MAGIC_DEF[ptype]) if flags & BRACE: @@ -505,7 +505,7 @@ try: # Turn off limit as we are handling it ourselves. yield from bracex.iexpand(p, keep_escapes=True, limit=limit) - except bracex.ExpansionLimitException: + except bracex.ExpansionLimitException: # noqa: PERF203 raise except Exception: # pragma: no cover # We will probably never hit this as `bracex` @@ -640,7 +640,8 @@ for pattern in iter_patterns(patterns): pattern = util.norm_pattern(pattern, not is_unix, bool(flags & RAWCHARS)) count = 0 - for count, expanded in enumerate(expand(pattern, flags, current_limit), 1): + for expanded in expand(pattern, flags, current_limit): + count += 1 total += 1 if 0 < limit < total: raise PatternLimitException("Pattern limit exceeded the limit of {:d}".format(limit)) @@ -654,8 +655,8 @@ current_limit -= count if current_limit < 1: current_limit = 1 - except bracex.ExpansionLimitException: - raise PatternLimitException("Pattern limit exceeded the limit of {:d}".format(limit)) + except bracex.ExpansionLimitException as e: + raise PatternLimitException("Pattern limit exceeded the limit of {:d}".format(limit)) from e if negative and not positive: if flags & NEGATEALL: @@ -725,7 +726,8 @@ for pattern in iter_patterns(patterns): pattern = util.norm_pattern(pattern, not is_unix, bool(flags & RAWCHARS)) count = 0 - for count, expanded in enumerate(expand(pattern, flags, current_limit), 1): + for expanded in expand(pattern, flags, current_limit): + count += 1 total += 1 if 0 < limit < total: raise PatternLimitException("Pattern limit exceeded the limit of {:d}".format(limit)) @@ -739,8 +741,8 @@ current_limit -= count if current_limit < 1: current_limit = 1 - except bracex.ExpansionLimitException: - raise PatternLimitException("Pattern limit exceeded the limit of {:d}".format(limit)) + except bracex.ExpansionLimitException as e: + raise PatternLimitException("Pattern limit exceeded the limit of {:d}".format(limit)) from e if negative and not positive: if flags & NEGATEALL: @@ -817,17 +819,17 @@ if c in ('^', '-', '['): c = next(i) - while c != ']': - if c == '\\': - # Handle escapes - try: + try: + while c != ']': + if c == '\\': + # Handle escapes self._references(i, True) - except PathNameException: - raise StopIteration - elif c == '/': - if self.pathname: - raise StopIteration - c = next(i) + elif c == '/': + if self.pathname: + raise StopIteration + c = next(i) + except PathNameException as e: + raise StopIteration from e def _references(self, i: util.StringIter, sequence: bool = False) -> None: """Handle references.""" @@ -1128,8 +1130,8 @@ value = self._references(i, True) except DotException: value = re.escape(next(i)) - except PathNameException: - raise StopIteration + except PathNameException as e: + raise StopIteration from e elif c == '/': if self.pathname: raise StopIteration @@ -1218,6 +1220,7 @@ is_previous = False if self.after_start and self.pathname and self.nodotdir: + index = 0 try: index = i.index while True: @@ -1237,16 +1240,16 @@ is_current = False is_previous = False raise StopIteration - except DotException: + except DotException as e: if is_current: is_previous = True is_current = False c = next(i) else: is_previous = False - raise StopIteration - except PathNameException: - raise StopIteration + raise StopIteration from e + except PathNameException as e: + raise StopIteration from e elif c == '/': raise StopIteration else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/wcmatch/fnmatch.py new/wcmatch-8.5.1/wcmatch/fnmatch.py --- old/wcmatch-8.5/wcmatch/fnmatch.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/wcmatch/fnmatch.py 2020-02-02 01:00:00.000000000 +0100 @@ -103,7 +103,7 @@ for filename in filenames: if obj.match(filename): - matches.append(filename) + matches.append(filename) # noqa: PERF401 return matches diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/wcmatch/glob.py new/wcmatch-8.5.1/wcmatch/glob.py --- old/wcmatch-8.5/wcmatch/glob.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/wcmatch/glob.py 2020-02-02 01:00:00.000000000 +0100 @@ -137,6 +137,7 @@ is "magic", etc.: `["pattern", is_magic, is_globstar, dir_only, is_drive]`. Example: + ------- `"**/this/is_literal/*magic?/@(magic|part)"` Would become: @@ -207,8 +208,8 @@ # Handle escapes try: self._references(i, True) - except _wcparse.PathNameException: - raise StopIteration + except _wcparse.PathNameException as e: + raise StopIteration from e elif c == '/': raise StopIteration c = next(i) @@ -451,7 +452,7 @@ self.re_no_dir = cast(Pattern[AnyStr], _wcparse.RE_WIN_NO_DIR[ptype]) temp = os.fspath(root_dir) if root_dir is not None else self.current - if not isinstance(temp, type(pats[0])): + if not isinstance(temp, bytes if ptype else str): raise TypeError( 'Pattern and root_dir should be of the same type, not {} and {}'.format( type(pats[0]), type(temp) @@ -473,7 +474,8 @@ for p in patterns: p = util.norm_pattern(p, not self.unix, self.raw_chars) count = 0 - for count, expanded in enumerate(_wcparse.expand(p, self.flags, self.current_limit), 1): + for expanded in _wcparse.expand(p, self.flags, self.current_limit): + count += 1 total += 1 if 0 < self.limit < total: raise _wcparse.PatternLimitException( @@ -493,10 +495,10 @@ self.current_limit -= count if self.current_limit < 1: self.current_limit = 1 - except bracex.ExpansionLimitException: + except bracex.ExpansionLimitException as e: raise _wcparse.PatternLimitException( "Pattern limit exceeded the limit of {:d}".format(self.limit) - ) + ) from e def _parse_patterns(self, patterns: Sequence[AnyStr], force_negate: bool = False) -> None: """Parse patterns.""" @@ -638,7 +640,7 @@ is_link = False if (not dir_only or is_dir): yield f.name, is_dir, hidden, is_link # type: ignore[misc] - except OSError: # pragma: no cover + except OSError: # pragma: no cover # noqa: PERF203 pass finally: if fd is not None: @@ -760,7 +762,7 @@ results = [] matcher = self._get_matcher(curdir) files = list(self._iter(None, dir_only, False)) - for file, is_dir, hidden, is_link in files: + for file, is_dir, _hidden, _is_link in files: if file not in self.specials and (matcher is None or matcher(file)): results.append((file, is_dir)) else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/wcmatch/posix.py new/wcmatch-8.5.1/wcmatch/posix.py --- old/wcmatch-8.5/wcmatch/posix.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/wcmatch/posix.py 2020-02-02 01:00:00.000000000 +0100 @@ -72,5 +72,5 @@ return ascii_posix_properties[value] else: return unicode_posix_properties[value] - except Exception: # pragma: no cover - raise ValueError("'{} is not a valid posix property".format(value)) + except Exception as e: # pragma: no cover + raise ValueError("'{} is not a valid posix property".format(value)) from e diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/wcmatch/util.py new/wcmatch-8.5.1/wcmatch/util.py --- old/wcmatch-8.5/wcmatch/util.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/wcmatch/util.py 2020-02-02 01:00:00.000000000 +0100 @@ -186,8 +186,8 @@ try: char = self._string[self._index] self._index += 1 - except IndexError: # pragma: no cover - raise StopIteration + except IndexError as e: # pragma: no cover + raise StopIteration from e return char @@ -195,7 +195,7 @@ class Immutable: """Immutable.""" - __slots__: tuple[Any, ...] = tuple() + __slots__: tuple[Any, ...] = () def __init__(self, **kwargs: Any) -> None: """Initialize.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-8.5/wcmatch/wcmatch.py new/wcmatch-8.5.1/wcmatch/wcmatch.py --- old/wcmatch-8.5/wcmatch/wcmatch.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-8.5.1/wcmatch/wcmatch.py 2020-02-02 01:00:00.000000000 +0100 @@ -159,7 +159,7 @@ if self.folder_exclude_check is None: if not folder_exclude_pattern: - self.folder_exclude_check = _wcmatch.WcRegexp(tuple()) + self.folder_exclude_check = _wcmatch.WcRegexp(()) else: self.folder_exclude_check = self._compile_wildcard(folder_exclude_pattern, self.dir_pathname)
