public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-translitcodec] rawhide: Fix F45FTBS + spec cleanup and modernization
@ 2026-08-03 21:53 Filipe Rosset
  0 siblings, 0 replies; only message in thread
From: Filipe Rosset @ 2026-08-03 21:53 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/python-translitcodec
            Branch : rawhide
            Commit : 72e17d251318108eaa71001b060ec9d55a774a03
            Author : Filipe Rosset <rosset.filipe@gmail.com>
            Date   : 2026-07-29T13:05:20-03:00
            Stats  : +69/-9 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-translitcodec/c/72e17d251318108eaa71001b060ec9d55a774a03?branch=rawhide

            Log:
            Fix F45FTBS + spec cleanup and modernization

Resolves: rhbz#2378287
Resolves: rhbz#2414561

---
diff --git a/python-translitcodec.spec b/python-translitcodec.spec
index bcb2e13..7fa2b78 100644
--- a/python-translitcodec.spec
+++ b/python-translitcodec.spec
@@ -8,10 +8,13 @@ Summary:        Unicode to 8-bit charset transliteration codec
 License:        MIT
 URL:            http://pypi.python.org/pypi/translitcodec/
 Source0:        %{pypi_source}
+
+# Fix unknown encoding LookupError with Python 3.15
+# https://github.com/claudep/translitcodec/pull/7
+Patch0:         translitcodec-python315.patch
 BuildArch:      noarch
 
 BuildRequires:  python3-devel
-BuildRequires:  python3dist(setuptools)
 BuildRequires:  python3dist(pytest)
 
 %description
@@ -22,7 +25,6 @@ Best-effort representations using smaller coded character sets
 
 %package -n     python3-%{pypi_name}
 Summary:        %{summary}
-%{?python_provide:%python_provide python3-%{pypi_name}}
 
 %description -n python3-%{pypi_name}
 Best-effort representations using smaller coded character sets
@@ -30,21 +32,23 @@ Best-effort representations using smaller coded character sets
 
 
 %prep
-%autosetup -n %{pypi_name}-%{version}
+%autosetup -p1 -n %{pypi_name}-%{version}
+
+%generate_buildrequires
+%pyproject_buildrequires
 
 %build
-%py3_build
+%pyproject_wheel
 
 %install
-%py3_install
+%pyproject_install
+%pyproject_save_files -l %{pypi_name}
 
 %check
+%pyproject_check_import
 %pytest
 
-%files -n python3-%{pypi_name}
-%license LICENSE
-%{python3_sitelib}/%{pypi_name}
-%{python3_sitelib}/%{pypi_name}-*.egg-info/
+%files -n python3-%{pypi_name} -f %{pyproject_files}
 
 %changelog
 %autochangelog

diff --git a/translitcodec-python315.patch b/translitcodec-python315.patch
new file mode 100644
index 0000000..e8aff9e
--- /dev/null
+++ b/translitcodec-python315.patch
@@ -0,0 +1,56 @@
+--- a/translitcodec/__init__.py
++++ b/translitcodec/__init__.py
+@@ -196,30 +196,32 @@
+     # translit/one
+     # translit/short/ascii
+ 
+-    delim = '/'
+-    if sys.version_info > (3, 9):
++    if encoding.startswith('translit/'):
++        delim = '/'
++    elif encoding.startswith('translit_'):
+         delim = '_'
++    else:
++        return None
+ 
+-    if encoding.startswith('translit' + delim):
+-        parts = encoding.split(delim)
+-        if parts[1] == 'long':
+-            encoder = long_encode
+-        elif parts[1] == 'short':
+-            encoder = short_encode
+-        elif parts[1] == 'one':
+-            encoder = single_encode
+-        else:
+-            return None
++    parts = encoding.split(delim)
++    if parts[1] == 'long':
++        encoder = long_encode
++    elif parts[1] == 'short':
++        encoder = short_encode
++    elif parts[1] == 'one':
++        encoder = single_encode
++    else:
++        return None
+ 
+-        if len(parts) == 2:
+-            pass
+-        elif len(parts) == 3:
+-            byte_enc = parts[2]
+-            byte_encoder = codecs.lookup(byte_enc).encode
+-            encoder = _double_encoding_factory(encoder, byte_encoder, byte_enc)
+-        else:
+-            return None
+-        return codecs.CodecInfo(encoder, no_decode)
++    if len(parts) == 2:
++        pass
++    elif len(parts) == 3:
++        byte_enc = parts[2]
++        byte_encoder = codecs.lookup(byte_enc).encode
++        encoder = _double_encoding_factory(encoder, byte_encoder, byte_enc)
++    else:
++        return None
++    return codecs.CodecInfo(encoder, no_decode)
+     return None
+ 
+ codecs.register(trans_search)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-03 21:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-03 21:53 [rpms/python-translitcodec] rawhide: Fix F45FTBS + spec cleanup and modernization Filipe Rosset

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox