Package: src:bumpversion
Version: 1.0.1-1.2
User: [email protected]
Usertags: python3.15
Tags: patch, ftbfs, forky, sid
Severity: important

Hi!

While rebuilding the python related packages against the Python 3.15rc2 version 
we found that bumpversion fails to build from source [1].

The error is:
E   ModuleNotFoundError: No module named 'sre_constants'

This happens because sre_constants is removed in python 3.15, needs to be 
replaced. I've added a patch to replace sre_constants with re.

I've applied it in the sandbox [2] to verify that bumpversion builds 
successfully, please consider applying the patch to support the upcoming 3.15 
version.

Setting the severity to important for now. Once Python 3.15 is released, it 
will be added to python3-defaults and this bug will become release critical.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4527207/
[2]: https://debusine.debian.net/debian/r-python-python3.15/

--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
Description: Replace sre_constants with re for Python 3.15 compatibility
Author: Maximiliano Curia <[email protected]>
Forwarded: no
---
 bumpversion/cli.py          | 3 +--
 bumpversion/version_part.py | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/bumpversion/cli.py b/bumpversion/cli.py
index b107e10..a8a5c8a 100644
--- a/bumpversion/cli.py
+++ b/bumpversion/cli.py
@@ -6,7 +6,6 @@ import itertools
 import logging
 import os
 import re
-import sre_constants
 import sys
 import warnings
 from configparser import (
@@ -429,7 +428,7 @@ def _setup_versionconfig(known_args, part_configs):
             replace=known_args.replace,
             part_configs=part_configs,
         )
-    except sre_constants.error:
+    except re.error:
         # TODO: use re.error here mayhaps, also: should we log?
         sys.exit(1)
     return version_config
diff --git a/bumpversion/version_part.py b/bumpversion/version_part.py
index fc811f5..289907b 100644
--- a/bumpversion/version_part.py
+++ b/bumpversion/version_part.py
@@ -1,6 +1,5 @@
 import logging
 import re
-import sre_constants
 import string
 
 from bumpversion.exceptions import (
@@ -137,7 +136,7 @@ class VersionConfig:
 
         try:
             self.parse_regex = re.compile(parse, re.VERBOSE)
-        except sre_constants.error as e:
+        except re.error as e:
             # TODO: use re.error here mayhaps
             logger.error("--parse '%s' is not a valid regex", parse)
             raise e

Reply via email to