14
0

Accepting request 1091254 from home:pgajdos:python

- do not require six
- added patches
  7a664a50cb
  + python-user_agent-no-six.patch

OBS-URL: https://build.opensuse.org/request/show/1091254
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-user_agent?expand=0&rev=16
This commit is contained in:
2023-06-07 17:05:34 +00:00
committed by Git OBS Bridge
parent 32c9dc8656
commit 0ce9577a8d
3 changed files with 83 additions and 6 deletions

View File

@@ -0,0 +1,69 @@
Index: user_agent-0.1.10/setup.py
===================================================================
--- user_agent-0.1.10.orig/setup.py
+++ user_agent-0.1.10/setup.py
@@ -24,7 +24,6 @@ setup(
# Package files
packages=['user_agent'],
include_package_data=True,
- install_requires=['six'],
entry_points={
'console_scripts': [
'ua = user_agent.cli:script_ua',
@@ -33,7 +32,6 @@ setup(
# Topics
classifiers=[
'Programming Language :: Python',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
Index: user_agent-0.1.10/test/user_agent.py
===================================================================
--- user_agent-0.1.10.orig/test/user_agent.py
+++ user_agent-0.1.10/test/user_agent.py
@@ -7,7 +7,6 @@ import json
from datetime import datetime
from copy import deepcopy
-import six
import pytest
import user_agent.base
@@ -134,7 +133,7 @@ def test_data_integrity():
for _ in range(50):
nav = generate_navigator()
for _, val in nav.items():
- assert val is None or isinstance(val, six.string_types)
+ assert val is None or isinstance(val, str)
def test_ua_script_simple():
Index: user_agent-0.1.10/user_agent.egg-info/requires.txt
===================================================================
--- user_agent-0.1.10.orig/user_agent.egg-info/requires.txt
+++ user_agent-0.1.10/user_agent.egg-info/requires.txt
@@ -1 +0,0 @@
-six
Index: user_agent-0.1.10/user_agent/base.py
===================================================================
--- user_agent-0.1.10.orig/user_agent/base.py
+++ user_agent-0.1.10/user_agent/base.py
@@ -38,8 +38,6 @@ from random import SystemRandom
from datetime import datetime, timedelta
from itertools import product
-import six
-
from .warning import warn
# pylint: disable=unused-import
from .device import SMARTPHONE_DEV_IDS, TABLET_DEV_IDS
@@ -408,7 +406,7 @@ def get_option_choices(opt_name, opt_val
"""
choices = []
- if isinstance(opt_value, six.string_types):
+ if isinstance(opt_value, str):
choices = [opt_value]
elif isinstance(opt_value, (list, tuple)):
choices = list(opt_value)

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Jun 6 13:51:11 UTC 2023 - pgajdos@suse.com
- do not require six
- added patches
https://github.com/lorien/user_agent/commit/7a664a50cb1633a355a56594e255583a821176ba
+ python-user_agent-no-six.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Oct 11 16:46:07 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com> Tue Oct 11 16:46:07 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-user_agent # spec file for package python-user_agent
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2023 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,6 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-user_agent Name: python-user_agent
Version: 0.1.10 Version: 0.1.10
Release: 0 Release: 0
@@ -25,11 +24,11 @@ License: MIT
Group: Development/Languages/Python Group: Development/Languages/Python
URL: https://github.com/lorien/user_agent URL: https://github.com/lorien/user_agent
Source: https://files.pythonhosted.org/packages/source/u/user_agent/user_agent-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/u/user_agent/user_agent-%{version}.tar.gz
# https://github.com/lorien/user_agent/commit/7a664a50cb1633a355a56594e255583a821176ba
Patch0: python-user_agent-no-six.patch
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-six
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun):update-alternatives Requires(postun):update-alternatives
BuildArch: noarch BuildArch: noarch
@@ -42,7 +41,7 @@ BuildRequires: %{python_module pytest}
This module generates random, valid web user agents. This module generates random, valid web user agents.
%prep %prep
%setup -q -n user_agent-%{version} %autosetup -p1 -n user_agent-%{version}
%build %build
%python_build %python_build
@@ -65,6 +64,7 @@ This module generates random, valid web user agents.
%files %{python_files} %files %{python_files}
%license LICENSE %license LICENSE
%python_alternative %{_bindir}/ua %python_alternative %{_bindir}/ua
%{python_sitelib}/* %{python_sitelib}/user_agent
%{python_sitelib}/user_agent-*.egg-info
%changelog %changelog