Compare commits
4 Commits
Author | SHA256 | Date | |
---|---|---|---|
f4d256b436 | |||
7f05206a56 | |||
e9a5085166 | |||
140ee6c1dd |
41
0001-Don-t-use-codecs.open-on-Python-3.patch
Normal file
41
0001-Don-t-use-codecs.open-on-Python-3.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
From ec2d19f90818ea608076dfbb1cb7951ac0b7372d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||
Date: Wed, 28 May 2025 16:53:31 +0200
|
||||
Subject: [PATCH] Don't use codecs.open on Python 3
|
||||
|
||||
This is to avoid:
|
||||
|
||||
DeprecationWarnings: codecs.open() is deprecated. Use open() instead.
|
||||
---
|
||||
tests/test_emojis.py | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/test_emojis.py b/tests/test_emojis.py
|
||||
index 4f88e23..088ee5e 100644
|
||||
--- a/tests/test_emojis.py
|
||||
+++ b/tests/test_emojis.py
|
||||
@@ -1,6 +1,5 @@
|
||||
# std imports
|
||||
import os
|
||||
-import codecs
|
||||
|
||||
# 3rd party
|
||||
import pytest
|
||||
@@ -11,6 +10,8 @@
|
||||
except NameError:
|
||||
# python 3
|
||||
unichr = chr
|
||||
+else:
|
||||
+ from codecs import open
|
||||
|
||||
# some tests cannot be done on some builds of python, where the internal
|
||||
# unicode structure is limited to 0x10000 for memory conservation,
|
||||
@@ -146,7 +147,7 @@ def test_longer_emoji_zwj_sequence():
|
||||
|
||||
|
||||
def read_sequences_from_file(filename):
|
||||
- fp = codecs.open(os.path.join(os.path.dirname(__file__), filename), 'r', encoding='utf-8')
|
||||
+ fp = open(os.path.join(os.path.dirname(__file__), filename), 'r', encoding='utf-8')
|
||||
lines = [line.strip()
|
||||
for line in fp.readlines()
|
||||
if not line.startswith('#') and line.strip()]
|
@@ -1,3 +1,15 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 5 11:56:57 UTC 2025 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- add 0001-Don-t-use-codecs.open-on-Python-3.patch to fix
|
||||
deprecations for python 3.14
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 13 02:43:13 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Switch to pyproject macros.
|
||||
- No more greedy globs in %files.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Jan 6 13:09:08 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-wcwidth
|
||||
#
|
||||
# Copyright (c) 2024 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
|
||||
@@ -24,8 +24,11 @@ Summary: Number of Terminal column cells of wide-character codes
|
||||
License: MIT
|
||||
URL: https://github.com/jquast/wcwidth
|
||||
Source: https://github.com/jquast/wcwidth/archive/%{version}.tar.gz#/wcwidth-%{version}.tar.gz
|
||||
Patch1: https://github.com/jquast/wcwidth/commit/ec2d19f90818ea608076dfbb1cb7951ac0b7372d.patch#/0001-Don-t-use-codecs.open-on-Python-3.patch
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildArch: noarch
|
||||
@@ -54,10 +57,10 @@ sed -i 's/--cov[-=a-z]*//g' tox.ini
|
||||
sed -i 's/looponfailroots.*//' tox.ini
|
||||
|
||||
%build
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
@@ -66,6 +69,7 @@ sed -i 's/looponfailroots.*//' tox.ini
|
||||
%files %{python_files}
|
||||
%license LICENSE
|
||||
%doc docs/intro.rst
|
||||
%{python_sitelib}/*
|
||||
%{python_sitelib}/wcwidth
|
||||
%{python_sitelib}/wcwidth-%{version}.dist-info
|
||||
|
||||
%changelog
|
||||
|
Reference in New Issue
Block a user