Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-eradicate for
openSUSE:Factory checked in at 2025-10-29 21:06:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-eradicate (Old)
and /work/SRC/openSUSE:Factory/.python-eradicate.new.1980 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-eradicate"
Wed Oct 29 21:06:21 2025 rev:8 rq:1314224 version:3.0.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-eradicate/python-eradicate.changes
2025-06-10 09:10:17.411848805 +0200
+++
/work/SRC/openSUSE:Factory/.python-eradicate.new.1980/python-eradicate.changes
2025-10-29 21:07:29.260721526 +0100
@@ -1,0 +2,9 @@
+Wed Oct 29 01:18:17 UTC 2025 - Steve Kowalik <[email protected]>
+
+- Update to 3.0.1:
+ * Fix build with Python 3.14
+ * Adds python3.12 and python3.13 support
+ * Drops python2.7, python3.6, and python3.7, and python3.8 support
+ * Adds custom ignore rules for inline script metadata
+
+-------------------------------------------------------------------
Old:
----
eradicate-2.3.0.tar.gz
New:
----
eradicate-3.0.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-eradicate.spec ++++++
--- /var/tmp/diff_new_pack.nErv15/_old 2025-10-29 21:07:30.824787259 +0100
+++ /var/tmp/diff_new_pack.nErv15/_new 2025-10-29 21:07:30.832787595 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-eradicate
#
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,13 +19,13 @@
%bcond_without libalternatives
%{?sle15_python_module_pythons}
Name: python-eradicate
-Version: 2.3.0
+Version: 3.0.1
Release: 0
Summary: Python utility for removing commented-out code
License: MIT
-Group: Development/Languages/Python
URL: https://github.com/myint/eradicate
Source:
https://files.pythonhosted.org/packages/source/e/eradicate/eradicate-%{version}.tar.gz
+BuildRequires: %{python_module base >= 3.9}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
@@ -65,7 +65,7 @@
%files %{python_files}
%doc README.rst
%python_alternative %{_bindir}/eradicate
-%{python_sitelib}/eradicate.py*
+%{python_sitelib}/eradicate.py
%pycache_only %{python_sitelib}/__pycache__/eradicate*.pyc
-%{python_sitelib}/eradicate-%{version}*-info
+%{python_sitelib}/eradicate-%{version}.dist-info
++++++ eradicate-2.3.0.tar.gz -> eradicate-3.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/eradicate-2.3.0/PKG-INFO new/eradicate-3.0.1/PKG-INFO
--- old/eradicate-2.3.0/PKG-INFO 2023-06-09 08:30:42.625560000 +0200
+++ new/eradicate-3.0.1/PKG-INFO 2025-10-27 08:17:15.563186200 +0100
@@ -1,8 +1,8 @@
-Metadata-Version: 2.1
+Metadata-Version: 2.4
Name: eradicate
-Version: 2.3.0
+Version: 3.0.1
Summary: Removes commented-out code.
-Home-page: https://github.com/myint/eradicate
+Home-page: https://github.com/pycqa/eradicate
Author: Steven Myint
Maintainer: Nikita Sobolev <[email protected]>
License: Expat License
@@ -10,9 +10,17 @@
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Quality Assurance
+Dynamic: author
+Dynamic: classifier
+Dynamic: description
+Dynamic: home-page
+Dynamic: keywords
+Dynamic: license
+Dynamic: maintainer
+Dynamic: summary
=========
eradicate
@@ -93,3 +101,4 @@
There are different tools, plugins, and integrations for ``eradicate`` users:
- `flake8-eradicate <https://github.com/sobolevn/flake8-eradicate>`_ - Flake8
plugin to find commented out or dead code.
+- `databricks-labs-pylint
<https://github.com/databrickslabs/pylint-plugin#eradicate-checker>`_ -
Databricks-specific PyLint plugin, that can also find commented out code.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/eradicate-2.3.0/README.rst
new/eradicate-3.0.1/README.rst
--- old/eradicate-2.3.0/README.rst 2023-06-08 18:50:05.000000000 +0200
+++ new/eradicate-3.0.1/README.rst 2025-10-27 08:05:05.000000000 +0100
@@ -77,3 +77,4 @@
There are different tools, plugins, and integrations for ``eradicate`` users:
- `flake8-eradicate <https://github.com/sobolevn/flake8-eradicate>`_ - Flake8
plugin to find commented out or dead code.
+- `databricks-labs-pylint
<https://github.com/databrickslabs/pylint-plugin#eradicate-checker>`_ -
Databricks-specific PyLint plugin, that can also find commented out code.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/eradicate-2.3.0/eradicate.egg-info/PKG-INFO
new/eradicate-3.0.1/eradicate.egg-info/PKG-INFO
--- old/eradicate-2.3.0/eradicate.egg-info/PKG-INFO 2023-06-09
08:30:42.000000000 +0200
+++ new/eradicate-3.0.1/eradicate.egg-info/PKG-INFO 2025-10-27
08:17:15.000000000 +0100
@@ -1,8 +1,8 @@
-Metadata-Version: 2.1
+Metadata-Version: 2.4
Name: eradicate
-Version: 2.3.0
+Version: 3.0.1
Summary: Removes commented-out code.
-Home-page: https://github.com/myint/eradicate
+Home-page: https://github.com/pycqa/eradicate
Author: Steven Myint
Maintainer: Nikita Sobolev <[email protected]>
License: Expat License
@@ -10,9 +10,17 @@
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Quality Assurance
+Dynamic: author
+Dynamic: classifier
+Dynamic: description
+Dynamic: home-page
+Dynamic: keywords
+Dynamic: license
+Dynamic: maintainer
+Dynamic: summary
=========
eradicate
@@ -93,3 +101,4 @@
There are different tools, plugins, and integrations for ``eradicate`` users:
- `flake8-eradicate <https://github.com/sobolevn/flake8-eradicate>`_ - Flake8
plugin to find commented out or dead code.
+- `databricks-labs-pylint
<https://github.com/databrickslabs/pylint-plugin#eradicate-checker>`_ -
Databricks-specific PyLint plugin, that can also find commented out code.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/eradicate-2.3.0/eradicate.py
new/eradicate-3.0.1/eradicate.py
--- old/eradicate-2.3.0/eradicate.py 2023-06-09 08:24:48.000000000 +0200
+++ new/eradicate-3.0.1/eradicate.py 2025-10-27 08:12:13.000000000 +0100
@@ -21,9 +21,6 @@
"""Removes commented-out Python code."""
-from __future__ import print_function
-from __future__ import unicode_literals
-
import difflib
import io
import os
@@ -31,16 +28,10 @@
import re
import tokenize
-try:
- detect_encoding = tokenize.detect_encoding
-except AttributeError:
- from lib2to3.pgen2 import tokenize as lib2to3_tokenize
- detect_encoding = lib2to3_tokenize.detect_encoding
-
-__version__ = '2.3.0'
+__version__ = '3.0.1'
-class Eradicator(object):
+class Eradicator:
"""Eradicate comments."""
BRACKET_REGEX = re.compile(r'^[()\[\]{}\s]+$')
CODING_COMMENT_REGEX = re.compile(r'.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)')
@@ -51,6 +42,7 @@
PARTIAL_DICTIONARY_REGEX = re.compile(r'^\s*[\'"]\w+[\'"]\s*:.+[,{]\s*$')
PRINT_RETURN_REGEX = re.compile(r'^(print|return)\b\s*')
WITH_STATEMENT_REGEX = re.compile(r"with .+ as [a-zA-Z_][a-zA-Z0-9_]*:$")
+ INLINE_SCRIPT_METADATA = re.compile(r'(?m)^# ///
(?P<type>[a-zA-Z0-9-]+)$\s(?P<content>(^#(| .*)$\s)+)^# ///$')
CODE_INDICATORS = ['(', ')', '[', ']', '{', '}', ':', '=', '%',
'print', 'return', 'break', 'continue', 'import']
@@ -155,8 +147,20 @@
return False
+ def inline_script_metadata_ranges(self, source):
+ """Return a list of ranges of lines of inline script metadata."""
+ return [
+ range(
+ source.count('\n', 0, match.start()),
+ source.count('\n', 0, match.end()) + 1,
+ )
+ for match in self.INLINE_SCRIPT_METADATA.finditer(source)
+ ]
+
+
def commented_out_code_line_numbers(self, source, aggressive=True):
"""Yield line numbers of commented-out code."""
+ inline_script_metadata_ranges =
self.inline_script_metadata_ranges(source)
sio = io.StringIO(source)
try:
for token in tokenize.generate_tokens(sio.readline):
@@ -166,6 +170,7 @@
if (token_type == tokenize.COMMENT and
line.lstrip().startswith('#') and
+ not any(start_row in r for r in
inline_script_metadata_ranges) and
self.comment_contains_code(line, aggressive)):
yield start_row
except (tokenize.TokenError, IndentationError):
@@ -212,7 +217,7 @@
def open_with_encoding(self, filename, encoding, mode='r'):
"""Return opened file with a specific encoding."""
- return io.open(filename, mode=mode, encoding=encoding,
+ return open(filename, mode=mode, encoding=encoding,
newline='') # Preserve line endings
@@ -220,7 +225,7 @@
"""Return file encoding."""
try:
with open(filename, 'rb') as input_file:
- encoding = detect_encoding(input_file.readline)[0]
+ encoding = tokenize.detect_encoding(input_file.readline)[0]
# Check for correctness of encoding.
with self.open_with_encoding(filename, encoding) as input_file:
@@ -286,7 +291,7 @@
while filenames:
name = filenames.pop(0)
if args.recursive and os.path.isdir(name):
- for root, directories, children in os.walk('{}'.format(name)):
+ for root, directories, children in os.walk(f'{name}'):
filenames += [os.path.join(root, f) for f in children
if f.endswith('.py') and
not f.startswith('.')]
@@ -295,8 +300,8 @@
else:
try:
change_or_error = eradicator.fix_file(name, args=args,
standard_out=standard_out) or change_or_error
- except IOError as exception:
- print('{}'.format(exception), file=standard_error)
+ except OSError as exception:
+ print(f'{exception}', file=standard_error)
change_or_error = True
if change_or_error and args.error:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/eradicate-2.3.0/setup.py new/eradicate-3.0.1/setup.py
--- old/eradicate-2.3.0/setup.py 2023-06-08 18:50:05.000000000 +0200
+++ new/eradicate-3.0.1/setup.py 2025-10-27 08:05:05.000000000 +0100
@@ -2,8 +2,6 @@
"""Setup for eradicate."""
-from __future__ import unicode_literals
-
import ast
from setuptools import setup
@@ -13,7 +11,7 @@
with open('eradicate.py') as input_file:
for line in input_file:
if line.startswith('__version__'):
- return ast.parse(line).body[0].value.s
+ return ast.parse(line).body[0].value.value
with open('README.rst') as readme:
@@ -25,12 +23,12 @@
license='Expat License',
author='Steven Myint',
maintainer='Nikita Sobolev <[email protected]>',
- url='https://github.com/myint/eradicate',
+ url='https://github.com/pycqa/eradicate',
classifiers=['Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3 :: Only',
'Topic :: Software Development :: Quality Assurance'],
keywords='clean, format, commented-out code',
py_modules=['eradicate'],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/eradicate-2.3.0/test_eradicate.py
new/eradicate-3.0.1/test_eradicate.py
--- old/eradicate-2.3.0/test_eradicate.py 2023-06-09 08:24:34.000000000
+0200
+++ new/eradicate-3.0.1/test_eradicate.py 2025-10-27 08:05:05.000000000
+0100
@@ -2,18 +2,13 @@
"""Test suite for eradicate."""
-from __future__ import unicode_literals
-
import contextlib
import io
import subprocess
import sys
import tempfile
import unittest
-try: # pragma: no cover
- import mock
-except ModuleNotFoundError: # pragma: no cover
- import unittest.mock as mock
+import unittest.mock as mock
import re
import eradicate
@@ -445,6 +440,42 @@
eradicator.update_whitelist(["foo"], False)
self.assertTrue(eradicator.WHITELIST_REGEX == re.compile("foo",
flags=re.IGNORECASE))
+ def test_inline_script_metadata(self):
+ self.assertEqual(
+ """\
+# /// script
+# requires-python = ">=3.11"
+# dependencies = [
+# "requests<3",
+# "rich",
+# ]
+# ///
+
+import requests
+from rich.pretty import pprint
+
+resp = requests.get("https://peps.python.org/api/peps.json")
+data = resp.json()
+pprint([(k, v["title"]) for k, v in data.items()][:10])
+""",
+ ''.join(eradicate.Eradicator().filter_commented_out_code(
+ """\
+# /// script
+# requires-python = ">=3.11"
+# dependencies = [
+# "requests<3",
+# "rich",
+# ]
+# ///
+
+import requests
+from rich.pretty import pprint
+
+resp = requests.get("https://peps.python.org/api/peps.json")
+data = resp.json()
+pprint([(k, v["title"]) for k, v in data.items()][:10])
+""")))
+
class SystemTests(unittest.TestCase):
@@ -611,11 +642,11 @@
shutil.rmtree(temp_directory)
-class StubFile(object):
+class StubFile:
"""Fake file that ignores everything."""
- def write(*_):
+ def write(self, *_args):
"""Ignore."""