1
0

4 Commits

3 changed files with 61 additions and 21 deletions

View File

@@ -1,3 +1,14 @@
-------------------------------------------------------------------
Tue Apr 8 17:37:51 UTC 2025 - Ben Greiner <code@bnavigator.de>
- Fix dependencies
-------------------------------------------------------------------
Fri Jan 10 15:47:50 UTC 2025 - Nico Krapp <nico.krapp@suse.com>
- migrate to pyproject macros
- add remove-six.patch to drop dependency on python-six
-------------------------------------------------------------------
Sun Jun 23 14:36:07 UTC 2024 - Luigi Baldoni <aloisio@gmx.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-guessit
#
# Copyright (c) 2024 SUSE LLC
# 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
@@ -17,7 +17,9 @@
%if 0%{?suse_version} > 1500
%define with_tests 1
%bcond_without test
%else
%bcond_with test
%endif
Name: python-guessit
Version: 3.8.0
@@ -27,26 +29,32 @@ License: LGPL-3.0-only
Group: Development/Languages/Python
URL: https://github.com/wackou/guessit
Source0: https://files.pythonhosted.org/packages/source/g/guessit/guessit-%{version}.tar.gz
# PATCH-FIX-UPSTREAM remove-six.patch
Patch0: remove-six.patch
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module babelfish >= 0.6.0}
BuildRequires: %{python_module importlib_resources}
%if 0%{?with_tests}
BuildRequires: %{python_module importlib_resources if %python-base < 3.9}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module python-dateutil}
BuildRequires: %{python_module rebulk >= 3.2.0}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-babelfish >= 0.6.0
Requires: python-python-dateutil
Requires: python-rebulk >= 3.2.0
%if %{?python_version_nodots} < 39
Requires: python-importlib_resources
%endif
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module pytest >= 5}
BuildRequires: %{python_module pytest-benchmark}
BuildRequires: %{python_module pytest-mock >= 3.3.1}
%endif
BuildRequires: %{python_module python-dateutil}
BuildRequires: %{python_module rebulk >= 3.2.0}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-babelfish >= 0.6.0
Requires: python-importlib-resources
Requires: python-python-dateutil
Requires: python-rebulk >= 3.2.0
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%python_subpackages
%description
@@ -57,7 +65,7 @@ a video using its filename only. This matcher works with both movies
and TV shows episodes.
%prep
%autosetup -n guessit-%{version}
%autosetup -p1 -n guessit-%{version}
# Remove shebang from non-executable files
for i in {'audio_codec','bit_rate','bonus','cd','container','country','crc','date','edition','episodes','episode_title','film','__init__','language','mimetype','other','part','release_group','screen_size','size','source','streaming_service','title','type','video_codec','website'}; do
sed -i -e "1d" "guessit/rules/properties/$i.py"
@@ -72,14 +80,14 @@ done
sed -i 's:.pytest-runner.::' setup.py
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/guessit
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if 0%{?with_tests}
%if %{with test}
%check
%pytest
%endif
@@ -95,6 +103,6 @@ sed -i 's:.pytest-runner.::' setup.py
%license LICENSE
%python_alternative %{_bindir}/guessit
%{python_sitelib}/guessit
%{python_sitelib}/guessit-%{version}-py%{python_version}.egg-info
%{python_sitelib}/guessit-%{version}.dist-info
%changelog

21
remove-six.patch Normal file
View File

@@ -0,0 +1,21 @@
Index: guessit-3.8.0/guessit/jsonutils.py
===================================================================
--- guessit-3.8.0.orig/guessit/jsonutils.py
+++ guessit-3.8.0/guessit/jsonutils.py
@@ -4,7 +4,6 @@ JSON Utils
"""
import json
-from six import text_type
from rebulk.match import Match
class GuessitEncoder(json.JSONEncoder):
@@ -16,6 +15,6 @@ class GuessitEncoder(json.JSONEncoder):
if isinstance(o, Match):
return o.advanced
if hasattr(o, 'name'): # Babelfish languages/countries long name
- return text_type(o.name)
+ return str(o.name)
# pragma: no cover
- return text_type(o)
+ return str(o)