From 31d65d4c7263885d7bf8edca9502da6d44c41003 Mon Sep 17 00:00:00 2001 From: MementoMoriCheng <1003350679@qq.com> Date: Mon, 24 May 2021 14:35:07 +0800 Subject: [PATCH] fix python2 dependency and check licence --- python-dns.spec | 23 ++++++++++++++++++----- typing.py | 15 +++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 typing.py diff --git a/python-dns.spec b/python-dns.spec index 9358cf6..32e8844 100644 --- a/python-dns.spec +++ b/python-dns.spec @@ -14,10 +14,11 @@ messages, names, and records. Name: python-dns Summary: %{sum} Version: 1.16.0 -Release: 1 -License: MIT +Release: 2 +License: ISC URL: http://www.dnspython.org/ -Source0: http://www.dnspython.org/kits/%{version}/dnspython-%{version}.tar.gz +Source0: http://www.dnspython.org/kits/%{version}/dnspython-%{version}.tar.gz +Source1: typing.py BuildArch: noarch Patch0: unicode_label_escapify.patch @@ -62,8 +63,14 @@ find examples -type f | xargs chmod a-x %py3_install %check -%{__python2} setup.py test -%{__python3} setup.py test +%if %{with python2} + cp %{SOURCE1} . + %{__python2} setup.py test + rm typing.py{,?} +%endif +%if %{with python3} + %{__python3} setup.py test +%endif %files -n python2-dns %doc LICENSE @@ -79,6 +86,12 @@ find examples -type f | xargs chmod a-x %doc examples %changelog +* Mon May 24 2021 chengshaowei - 1.16.0-2 +- Type:NA +- ID:NA +- SUG:NA +- DESC:fix python2 dependency + * Mon Jan 18 2021 jinzhimin - 1.16.0-1 - update to 1.16.0 diff --git a/typing.py b/typing.py new file mode 100644 index 0000000..be23520 --- /dev/null +++ b/typing.py @@ -0,0 +1,15 @@ +Set = Dict = None + + +def cast(type, obj): + """ + A no-op typing module for import compatibility + This avoids the build dependency on python2-typing + Args: + type: + obj: + + Returns: + + """ + return obj -- Gitee