15
0

- Add patch remove-future-requirement.patch, remove future requirement

- Switch to pyproject and autosetup macros

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-passivetotal?expand=0&rev=28
This commit is contained in:
2023-09-12 05:21:24 +00:00
committed by Git OBS Bridge
parent 3e2dcb13db
commit 9943311f04
3 changed files with 95 additions and 11 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Sep 12 05:20:34 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch remove-future-requirement.patch, remove future requirement
- Switch to pyproject and autosetup macros
-------------------------------------------------------------------
Mon Mar 14 21:39:35 UTC 2022 - Sebastian Wagner <sebix+novell.com@sebix.at>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-passivetotal
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,22 +16,21 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name: python-passivetotal
Version: 2.5.9
Release: 0
Summary: Client for the PassiveTotal REST API
License: GPL-2.0-only
Group: Development/Languages/Python
URL: https://passivetotal.readthedocs.org
Source: https://files.pythonhosted.org/packages/source/p/passivetotal/passivetotal-%{version}.tar.gz
Source1: https://github.com/passivetotal/python_api/raw/c2d0c8f4ea3dde4caec01f5401fb6f105f8a2447/LICENSE
Patch0: remove-future-requirement.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-ez_setup
Requires: python-future
Requires: python-python-dateutil
Requires: python-requests
Requires: python-tldextract
@@ -39,8 +38,6 @@ Requires(post): update-alternatives
Requires(postun):update-alternatives
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module ez_setup}
BuildRequires: %{python_module future}
BuildRequires: %{python_module python-dateutil}
BuildRequires: %{python_module requests}
%endif
@@ -57,15 +54,15 @@ services. The library currently provides support for the following services:
- Site actions (tagging, classifying, etc.)
%prep
%setup -q -n passivetotal-%{version}
%autosetup -p1 -n passivetotal-%{version}
sed -i '1s/^#!.*//' passivetotal/*.py passivetotal/*/*.py
cp %{SOURCE1} .
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand rm -r %{buildroot}%{$python_sitelib}/tests
%python_clone -a %{buildroot}%{_bindir}/pt-client
%python_clone -a %{buildroot}%{_bindir}/pt-config
@@ -88,7 +85,7 @@ cp %{SOURCE1} .
%python_alternative %{_bindir}/pt-info
%python_alternative %{_bindir}/pt-config
%python_alternative %{_bindir}/pt-client
%{python_sitelib}/passivetotal-*.egg-info
%{python_sitelib}/passivetotal-{%version}.dist-info
%{python_sitelib}/passivetotal/
%changelog

View File

@@ -0,0 +1,81 @@
Index: passivetotal-2.5.9/passivetotal/response.py
===================================================================
--- passivetotal-2.5.9.orig/passivetotal/response.py
+++ passivetotal-2.5.9/passivetotal/response.py
@@ -4,7 +4,6 @@
__author__ = 'Brandon Dixon (PassiveTotal)'
__version__ = '1.0.0'
-from future.utils import iteritems
import datetime
import json
import logging
@@ -44,7 +43,7 @@ class Response(object):
def _boost_properties(self):
"""Make first-class keys attributes of the object."""
- for key, value in iteritems(self._results):
+ for key, value in self._results.items():
self.logger.debug("Property: %s, %s" % (key, value))
setattr(self, key, value)
@@ -108,4 +107,4 @@ class Response(object):
:return: STIX formatted data
"""
- raise NotImplementedError("Subclass must implement this.")
\ No newline at end of file
+ raise NotImplementedError("Subclass must implement this.")
Index: passivetotal-2.5.9/setup.py
===================================================================
--- passivetotal-2.5.9.orig/setup.py
+++ passivetotal-2.5.9/setup.py
@@ -22,7 +22,7 @@ setup(
author_email="admin@passivetotal.org",
license="GPLv2",
packages=find_packages(),
- install_requires=['requests', 'python-dateutil', 'future', 'tldextract'],
+ install_requires=['requests', 'python-dateutil', 'tldextract'],
long_description=read('README.md'),
long_description_content_type="text/markdown",
classifiers=[],
Index: passivetotal-2.5.9/tests/test_ssl.py
===================================================================
--- passivetotal-2.5.9.orig/tests/test_ssl.py
+++ passivetotal-2.5.9/tests/test_ssl.py
@@ -1,6 +1,5 @@
from unittest.mock import patch
import unittest
-from future.utils import iteritems
from .conf import fake_request
from passivetotal.libs.ssl import SslRequest
@@ -43,7 +42,7 @@ class SslTestCase(unittest.TestCase):
response = self.client.get_ssl_certificate_details(**payload)
wrapped = Response(response)
- for key, value in iteritems(response):
+ for key, value in response.items():
assert (getattr(wrapped, key)) == value
def test_ssl_certificate_search(self):
Index: passivetotal-2.5.9/tests/test_whois.py
===================================================================
--- passivetotal-2.5.9.orig/tests/test_whois.py
+++ passivetotal-2.5.9/tests/test_whois.py
@@ -1,6 +1,5 @@
from unittest.mock import patch
import unittest
-from future.utils import iteritems
from .conf import fake_request
from passivetotal.libs.whois import WhoisRequest
@@ -43,7 +42,7 @@ class WhoisTestCase(unittest.TestCase):
response = self.client.get_whois_details(**payload)
wrapped = Response(response)
- for key, value in iteritems(response):
+ for key, value in response.items():
assert (getattr(wrapped, key)) == value
def test_whois_search(self):