From 7f2236999c844052b71a1fd4faaffd81e839adc6aaecf150e7cdc597b5ece0cc Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 29 Oct 2024 21:40:51 +0000 Subject: [PATCH] - update to 3.16.0: * Drop Python 3.8 support. * Support Python 3.13. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8-comprehensions?expand=0&rev=34 --- .gitattributes | 23 ++ .gitignore | 1 + flake8-comprehensions-3.15.0-gh.tar.gz | 3 + flake8-comprehensions-3.16.0-gh.tar.gz | 3 + ...8-comprehensions-pr559-notnormalized.patch | 12 + python-flake8-comprehensions.changes | 210 ++++++++++++++++++ python-flake8-comprehensions.spec | 68 ++++++ 7 files changed, 320 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 flake8-comprehensions-3.15.0-gh.tar.gz create mode 100644 flake8-comprehensions-3.16.0-gh.tar.gz create mode 100644 flake8-comprehensions-pr559-notnormalized.patch create mode 100644 python-flake8-comprehensions.changes create mode 100644 python-flake8-comprehensions.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/flake8-comprehensions-3.15.0-gh.tar.gz b/flake8-comprehensions-3.15.0-gh.tar.gz new file mode 100644 index 0000000..aefe97a --- /dev/null +++ b/flake8-comprehensions-3.15.0-gh.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7734b118f44d51376930cc503d0cfba634db1303058c19f42c33148b97c90ef +size 16215 diff --git a/flake8-comprehensions-3.16.0-gh.tar.gz b/flake8-comprehensions-3.16.0-gh.tar.gz new file mode 100644 index 0000000..d883305 --- /dev/null +++ b/flake8-comprehensions-3.16.0-gh.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2934ea029e25aae8bced31cb9956635d95ceb249d265f9c2bd7dc17c46a5339b +size 16557 diff --git a/flake8-comprehensions-pr559-notnormalized.patch b/flake8-comprehensions-pr559-notnormalized.patch new file mode 100644 index 0000000..8d57073 --- /dev/null +++ b/flake8-comprehensions-pr559-notnormalized.patch @@ -0,0 +1,12 @@ +diff -ur flake8-comprehensions-3.14.0.orig/tests/test_flake8_comprehensions.py flake8-comprehensions-3.14.0/tests/test_flake8_comprehensions.py +--- flake8-comprehensions-3.14.0.orig/tests/test_flake8_comprehensions.py 2024-02-27 20:40:03.434499715 +0100 ++++ flake8-comprehensions-3.14.0/tests/test_flake8_comprehensions.py 2024-02-27 20:40:14.791498740 +0100 +@@ -22,7 +22,7 @@ + + def test_version(flake8_path): + result = flake8_path.run_flake8(["--version"]) +- version_regex = r"flake8-comprehensions:( )*" + version("flake8-comprehensions") ++ version_regex = r"flake8[-_]comprehensions:( )*" + version("flake8-comprehensions") + unwrapped = "".join(result.out_lines) + assert re.search(version_regex, unwrapped) + diff --git a/python-flake8-comprehensions.changes b/python-flake8-comprehensions.changes new file mode 100644 index 0000000..446a618 --- /dev/null +++ b/python-flake8-comprehensions.changes @@ -0,0 +1,210 @@ +------------------------------------------------------------------- +Tue Oct 29 21:40:39 UTC 2024 - Dirk Müller + +- update to 3.16.0: + * Drop Python 3.8 support. + * Support Python 3.13. + +------------------------------------------------------------------- +Wed Aug 14 15:15:25 UTC 2024 - Dirk Müller + +- switch to modern python on sle15 + +------------------------------------------------------------------- +Mon Jul 1 07:37:44 UTC 2024 - Dirk Müller + +- update to 3.15.0: + * Add rule C420 to check for dict comprehensions with constant + values, encouraging replacement with dict.fromkeys(). + +------------------------------------------------------------------- +Tue Feb 27 19:41:44 UTC 2024 - Ben Greiner + +- Add flake8-comprehensions-pr559-notnormalized.patch + gh#adamchainz/flake8-comprehensions#559 + +------------------------------------------------------------------- +Tue Jul 11 13:33:29 UTC 2023 - Dirk Müller + +- update to 3.14.0: + * Drop Python 3.7 support. + +------------------------------------------------------------------- +Tue Jun 20 16:18:26 UTC 2023 - Dirk Müller + +- update to 3.13.0: + * Support Python 3.12. + +------------------------------------------------------------------- +Thu May 4 23:19:48 UTC 2023 - Dirk Müller + +- drop unmaintained and unused pytest-flake8dir + +------------------------------------------------------------------- +Thu Apr 13 12:27:04 UTC 2023 - Dirk Müller + +- update to 3.12.0: + * Add rule C418 to check for calls passing a dict literal or + dict comprehension to ``dict()``. + * Add rule C419 to check for calls passing a list comprehension + to ``any()``/``all()``. + +------------------------------------------------------------------- +Tue Mar 21 15:37:43 UTC 2023 - Dirk Müller + +- update to 3.11.1: + * Fix false positives in C406 “unnecessary dict literal”. + * Expand C416 to ``dict`` comprehensions. + +------------------------------------------------------------------- +Thu Mar 9 09:48:27 UTC 2023 - Daniel Garcia + +- Update to 3.10.1 + * Fix false positive in rules C402 and C404 for dict() calls with + keyword arguments. +- 3.10.0 (2022-05-19) + * Add rule C417 which recommends rewriting use of map() with lambda + to an equivalent generator expression or comprehension. +- 3.9.0 (2022-05-11) + * Support Python 3.11. +- 3.8.0 (2022-01-10) + * Drop Python 3.6 support. + * Remove upper bound on Flake8 version. +- 3.7.0 (2021-10-11) + * Support Flake8 4. +- 3.6.1 (2021-08-16) + * Fix type hint for tree argument. +- 3.6.0 (2021-08-13) + * Add type hints. +- 3.5.0 (2021-05-10) + * Support Python 3.10. + * Stop distributing tests to reduce package size. Tests are not + intended to be run outside of the tox setup in the repository. + Repackagers can use GitHub's tarballs per tag. + +------------------------------------------------------------------- +Fri Mar 19 08:36:26 UTC 2021 - Matej Cepl + +- Don't skip test_C416_fail_1_list, because it has been fixed in + python-pytest-flake8dir. + +------------------------------------------------------------------- +Thu Mar 18 12:59:11 UTC 2021 - Matej Cepl + +- Update to 3.4.0: + - Remove rules C407 (Unnecessary comprehension + - can take a generator) and C412 (Unnecessary + comprehension - 'in' can take a generator). + Both rules recommended increasing laziness, which is not + always desirable and can lead to subtle bugs. Also, a fully + exhausted generator is slower than an equivalent + comprehension, so the advice did not always improve + performance. + - Drop Python 3.5 support. + - Support Python 3.9. + - Move license from ISC to MIT License. + - Partially reverted the change to C408 to make it apply again + to when dict is called with keyword arguments, e.g. dict(a=1, + b=2) will be flagged to be rewritten in the literal form + {"a": 1, "b": 2} +- Skip test test_C416_fail_1_list + (gh#adamchainz/flake8-comprehensions#313). + +------------------------------------------------------------------- +Sat Jul 11 18:38:19 UTC 2020 - Arun Persaud + +- update to version 3.2.3: + * Made C408 only apply when no arguments are passed to + dict/list/tuple. + +------------------------------------------------------------------- +Sun Feb 9 16:53:49 UTC 2020 - Arun Persaud + +- specfile: + * update copyright year + +- update to version 3.2.2: + * Remove check for dict comprehensions in rule C407 as it would also + change the results for certain builtins such as sum(). + +- changes from version 3.2.1: + * Remove check for set comprehensions in rule C407 as it would + change the results for certain builtins such as sum(). + +- changes from version 3.2.0: + * Add filter and map to rule C407. + * Check for dict and set comprehensions in rules C407 and C412. + +------------------------------------------------------------------- +Sat Dec 7 17:47:28 UTC 2019 - Arun Persaud + +- specfile: + * be more specific in %files section + +- update to version 3.1.4: + * Remove the tuple/unpacking check from C416 to prevent false + positives where the type of the iterable is changed from some + iterable to a tuple. + +- changes from version 3.1.3: + * Ensure the fix for false positives in C416 rule for asynchronous + comprehensions runs on Python 3.6 too. + +- changes from version 3.1.2: + * Fix false positives in C416 rule for list comprehensions returning + tuples. + +- changes from version 3.1.1: + * Fix false positives in C416 rule for asynchronous comprehensions. + +- changes from version 3.1.0: + * Update Python support to 3.5-3.8. + * Fix false positives for C404 for list comprehensions not directly + creating tuples. + * Add C413 rule that checks for unnecessary use of list() or + reversed() around sorted(). + * Add C414 rule that checks for unnecessary use of the following: + + list(), reversed(), sorted(), or tuple() within set or sorted() + + list() or tuple() within list() or tuple() + + set() within set + * Add C415 rule that checks for unnecessary reversal of an iterable + via subscript within reversed(), set(), or sorted(). + * Add C416 rule that checks for unnecessary list or set + comprehensions that can be rewritten using list() or set(). + +- changes from version 3.0.1: + * Fix version display on flake8 --version (removing dependency on + cached-property). Thanks to Jon Dufresne. + +- changes from version 3.0.0: + * Update Flake8 support to 3.0+ only. 3.0.0 was released in 2016 and + the plugin hasn't been tested with it since. + +- changes from version 2.3.0: + * Converted setuptools metadata to configuration file. This meant + removing the __version__ attribute from the package. If you want + to inspect the installed version, use + importlib.metadata.version("flake8-comprehensions") (docs / + backport). + * Add dependencies on cached-property and importlib-metadata. + * Fix false negatives in C407 for cases when enumerate and sum() are + passed more than one argument. + +------------------------------------------------------------------- +Fri Sep 13 07:29:08 UTC 2019 - Tomáš Chvátal + +- Update to 2.2.0: + * Update Python support to 3.5-3.7, as 3.4 has reached its end of life. + * C412 rule that complains about using list comprehension with in. + +------------------------------------------------------------------- +Sat Aug 3 06:40:13 UTC 2019 - Tomáš Chvátal + +- Format with spec-cleaner +- Switch to github tarball +- Run tests + +------------------------------------------------------------------- +Mon Jul 15 21:57:07 UTC 2019 - Andreas Färber + +- Initial (v2.1.0) diff --git a/python-flake8-comprehensions.spec b/python-flake8-comprehensions.spec new file mode 100644 index 0000000..ec6cfec --- /dev/null +++ b/python-flake8-comprehensions.spec @@ -0,0 +1,68 @@ +# +# spec file for package python-flake8-comprehensions +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-flake8-comprehensions +Version: 3.16.0 +Release: 0 +Summary: A flake8 plugin to help you write better list/set/dict comprehensions +License: ISC +Group: Development/Languages/Python +URL: https://github.com/adamchainz/flake8-comprehensions +Source: https://github.com/adamchainz/flake8-comprehensions/archive/%{version}.tar.gz#/flake8-comprehensions-%{version}-gh.tar.gz +# PATCH-FIX-UPSTREAM flake8-comprehensions-pr559-notnormalized.patch gh#adamchainz/flake8-comprehensions#559 +Patch0: flake8-comprehensions-pr559-notnormalized.patch +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-flake8 +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module flake8} +BuildRequires: %{python_module pytest-flake8-path} +BuildRequires: %{python_module pytest-randomly} +BuildRequires: %{python_module pytest-xdist} +BuildRequires: %{python_module pytest} +# /SECTION +%python_subpackages + +%description +A flake8 plugin that helps you write better list/set/dict comprehensions. + +%prep +%autosetup -p1 -n flake8-comprehensions-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest %{?jobs: -n %jobs} + +%files %{python_files} +%license LICENSE +%doc README.rst +%{python_sitelib}/flake8_comprehensions +%{python_sitelib}/flake8_comprehensions-%{version}.dist-info + +%changelog