From 50783fe7b92642a0eca14b57d3296d8f97a6256eeb23a0ba028f1f6b047a64f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 16 Jun 2025 14:24:08 +0000 Subject: [PATCH] - Convert to libalternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-autoflake?expand=0&rev=31 --- .gitattributes | 23 ++++++ .gitignore | 1 + autoflake-2.2.1.tar.gz | 3 + autoflake-2.3.1.tar.gz | 3 + python-autoflake.changes | 156 +++++++++++++++++++++++++++++++++++++++ python-autoflake.spec | 82 ++++++++++++++++++++ support-python312.patch | 20 +++++ 7 files changed, 288 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 autoflake-2.2.1.tar.gz create mode 100644 autoflake-2.3.1.tar.gz create mode 100644 python-autoflake.changes create mode 100644 python-autoflake.spec create mode 100644 support-python312.patch 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/autoflake-2.2.1.tar.gz b/autoflake-2.2.1.tar.gz new file mode 100644 index 0000000..92a6cae --- /dev/null +++ b/autoflake-2.2.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62b7b6449a692c3c9b0c916919bbc21648da7281e8506bcf8d3f8280e431ebc1 +size 27377 diff --git a/autoflake-2.3.1.tar.gz b/autoflake-2.3.1.tar.gz new file mode 100644 index 0000000..25937a6 --- /dev/null +++ b/autoflake-2.3.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c98b75dc5b0a86459c4f01a1d32ac7eb4338ec4317a4469515ff1e687ecd909e +size 27642 diff --git a/python-autoflake.changes b/python-autoflake.changes new file mode 100644 index 0000000..dd03e92 --- /dev/null +++ b/python-autoflake.changes @@ -0,0 +1,156 @@ +------------------------------------------------------------------- +Mon Jun 16 14:23:53 UTC 2025 - Markéta Machová + +- Convert to libalternatives + +------------------------------------------------------------------- +Fri Nov 8 08:48:43 UTC 2024 - John Paul Adrian Glaubitz + +- Update to 2.3.1 + * Update pre-commit config + * github/workflows/main: use pre-commit/action + * Always set encoding when reading setup.cfg +- from version 2.3.0 + * readme: add note about customizing args in pre-commit + * Add Python 3.12 to CI + * Update pre-commit config + * Add support for passing the .toml config in the arguments + * Add support of ignore comment on the top of the file +- Drop support-python312.patch, merged upstream + +------------------------------------------------------------------- +Wed Aug 14 14:48:53 UTC 2024 - Dirk Müller + +- switch to modern python on sle15 + +------------------------------------------------------------------- +Tue Feb 6 18:28:40 UTC 2024 - Daniel Garcia + +- Add upstream support-python312.patch gh#PyCQA/autoflake#280 + +------------------------------------------------------------------- +Thu Dec 14 09:15:04 UTC 2023 - Petr Gajdos + +- update to 2.2.1: + * Add type annotations and validate with pyright + * Remove test_fuzz_pypi + * Revert "Support .toml configuration format with --config flag + * Support .toml configuration format with --config flag + * Fix a typo in a link to pre-commit + * Update standard_paths so it only checks existing directories + * Upgrade minimum version of pyflakes + * Add upper limit to pyflake's version <3.0 to support handling + of python 2.x + * fix: Ignore pass multiple lines after docstring with flag + * Fixed multiprocessing issue on win64 with more than 60 cores + * Fix default value for `--imports` + * Use regular dictionary instead of defaultdict + * Properly consider options from config file and flags + * Update merge_configuration_file to prefer values from flags + * Unified output to stdout when using --check + * add config-file option + * Fix Namespace check + * Add --check-diff flag which combines check and diff + * Use black for formatting code + * Migrate to tomli + * PEP 621: Migrate to pyproject.toml + * Add option to keep pass statements + +------------------------------------------------------------------- +Mon Jul 31 18:49:08 UTC 2023 - Matej Cepl + +- Remove upstreamed patch rm_assert_failing_310.patch. + +------------------------------------------------------------------- +Mon Sep 12 08:00:46 UTC 2022 - Dirk Müller + +- reenable build for python38, issue got fixed in current release + +------------------------------------------------------------------- +Fri Sep 9 16:07:50 UTC 2022 - Yogalakshmi Arunachalam + +- Update to v1.5.3 + * test_autoflake: use os.linesep in assertion + * Make sure messages use os.linesep + * test_autoflake: add a test for #129 + * autoflake: propagate the exit status instead of calling sys.exit + * Renamed the head branch + * Remove Makefile and reference to travis.yml + +- Update to v1.5.2 + * Remove usage of deprecated distutils module + * Also add support for removing RHS of unused variables. + * Use the new sysconfig module instead of distutils + * added option to remove RHS also when removing unused variables (#92) + +------------------------------------------------------------------- +Sun Aug 28 10:41:19 UTC 2022 - Ben Greiner + +- Update to v1.5.1 + * support for reading configuration from setup.cfg and + pyproject.toml + * new flag `--quiet` + * drop support for old versions of Python (<3.7) + * support for reading contents from stdin (prints the output to + stdout, ideal for integration with editors) + * support for parallel execution with `--jobs` +- Skip building Python 3.8: gh#PyCQA/autoflake#100 + +------------------------------------------------------------------- +Wed Feb 23 14:04:15 UTC 2022 - Matej Cepl + +- Skip failing test for Python 3.10 (gh#PyCQA/autoflake#104) + +------------------------------------------------------------------- +Mon Aug 31 04:16:47 UTC 2020 - Steve Kowalik + +- Update to 1.4: + * No upstream changelog +- Switch from setup.py test to pytest + +------------------------------------------------------------------- +Fri Sep 13 11:32:10 UTC 2019 - Tomáš Chvátal + +- Update to 1.3.1: + * no upstream changelog + +------------------------------------------------------------------- +Thu May 16 17:27:05 UTC 2019 - Meera Belur + +- Update to v1.3 + + No changes were provided + +------------------------------------------------------------------- +Sun Feb 10 13:50:19 UTC 2019 - John Vandenberg + +- Update to v1.2 + + Have `standard_paths` look in both platform-specific and + platform-independent directories + (replaces fix_standard_paths.patch) + + Add LICENSE + + Drop Python 3.3 +- Remove unnecessary build dependency %pythons +- Remove unused build dependency 'coverage' + +------------------------------------------------------------------- +Wed Dec 5 01:54:31 UTC 2018 - Jan Engelhardt + +- Use noun phrase in summary. + +------------------------------------------------------------------- +Tue Dec 4 12:45:50 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Wed May 9 18:33:29 UTC 2018 - toddrme2178@gmail.com + +- Add license file +- Use license tag + +------------------------------------------------------------------- +Fri Oct 20 16:13:14 UTC 2017 - toddrme2178@gmail.com + +- initial version +- Add fix_standard_paths.patch + * Fix for https://github.com/myint/autoflake/issues/32 diff --git a/python-autoflake.spec b/python-autoflake.spec new file mode 100644 index 0000000..39c9d1e --- /dev/null +++ b/python-autoflake.spec @@ -0,0 +1,82 @@ +# +# spec file for package python-autoflake +# +# Copyright (c) 2025 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/ +# + + +%bcond_without libalternatives +%{?sle15_python_module_pythons} +Name: python-autoflake +Version: 2.3.1 +Release: 0 +Summary: Program to removes unused Python imports and variables +License: MIT +URL: https://github.com/myint/autoflake +Source: https://files.pythonhosted.org/packages/source/a/autoflake/autoflake-%{version}.tar.gz +BuildRequires: %{python_module base >= 3.7} +BuildRequires: %{python_module hatchling} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pyflakes >= 3.0.0} +BuildRequires: %{python_module wheel} +BuildRequires: alts +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: alts +Requires: python-pyflakes >= 3.0.0 +Requires: python-tomli +BuildArch: noarch +%python_subpackages + +%description +Autoflake removes unused imports and unused variables from Python +code. It makes use of pyflakes to do this. + +By default, autoflake only removes unused imports for modules that +are part of the standard library. (Other modules may have side +effects that make them unsafe to remove automatically.) Removal of +unused variables is also disabled by default. + +autoflake also removes useless pass statements. + +%prep +%autosetup -p1 -n autoflake-%{version} +sed -i '1{/env python/d}' autoflake.py +chmod -x autoflake.py + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand rm %{buildroot}%{$python_sitelib}/{LICENSE,README.md,test*.py,__pycache__/test*.pyc} +%python_clone -a %{buildroot}%{_bindir}/autoflake +%fdupes %{buildroot}%{$python_sitelib} + +%check +export LANG=en_US.UTF-8 +%pyunittest -v test_autoflake + +%pre +%python_libalternatives_reset_alternative autoflake + +%files %{python_files} +%doc AUTHORS.rst README.md +%license LICENSE +%python_alternative %{_bindir}/autoflake +%{python_sitelib}/autoflake.py* +%pycache_only %{python_sitelib}/__pycache__/autoflake*.pyc +%{python_sitelib}/autoflake-%{version}*-info + +%changelog diff --git a/support-python312.patch b/support-python312.patch new file mode 100644 index 0000000..d6f440a --- /dev/null +++ b/support-python312.patch @@ -0,0 +1,20 @@ +Index: autoflake-2.2.1/test_autoflake.py +=================================================================== +--- autoflake-2.2.1.orig/test_autoflake.py ++++ autoflake-2.2.1/test_autoflake.py +@@ -928,6 +928,7 @@ StrictVersion('1.0.0') + from distutils.version import LooseVersion, StrictVersion + StrictVersion('1.0.0') + """, ++ remove_all_unused_imports=True, + ), + ) + +@@ -941,6 +942,7 @@ version('1.0.0') + from distutils.version import LooseVersion, StrictVersion as version + version('1.0.0') + """, ++ remove_all_unused_imports=True, + ), + ) +