[packages/python-configparser] - rel 4; make it possible to use both: import configparser and from backports import configparser on

arekm arekm at pld-linux.org
Fri Nov 30 10:59:30 CET 2018


commit 02e090dd3a47f9d7c50a71274b8f95a3c81f04fb
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Nov 30 10:59:23 2018 +0100

    - rel 4; make it possible to use both: import configparser and from backports import configparser on python2 without nasty pth hacks

 python-configparser.spec | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/python-configparser.spec b/python-configparser.spec
index e99f996..c970e54 100644
--- a/python-configparser.spec
+++ b/python-configparser.spec
@@ -8,7 +8,7 @@ Summary:	Updated configparser from Python 3.5 to Python 2
 Summary(pl.UTF-8):	Uaktualniony configparser z Pythona 3.5 do Pythona 2
 Name:		python-configparser
 Version:	3.5.0
-Release:	3
+Release:	4
 License:	BSD
 Group:		Libraries/Python
 #Source0Download: https://pypi.python.org/simple/configparser/
@@ -80,15 +80,18 @@ rm -rf $RPM_BUILD_ROOT
 
 %py_postclean
 
-# pth file is only for 'To use on Python 3 import from backports import configparser instead of the built-in version.'
-# so not needed on python2.
+# pth file is for both import versions to work on python2: "import configparser" and "from backports import configparser"
+# but doing that with pth code hacks bereaks other ptyhon-backports packages.
 rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/configparser-%{version}-py*-nspkg.pth
+# so intead of pth hacks we symlink module which is not exactly the same behaviour but is good enough for us
+ln -s ../../configparser.pyc $RPM_BUILD_ROOT%{py_sitescriptdir}/backports/configparser/
+ln -s ../../configparser.pyo $RPM_BUILD_ROOT%{py_sitescriptdir}/backports/configparser/
 %endif
 
 %if %{with python3}
 %py3_install
 
-# See note for python2 and on python3 it is also not needed because there is python-backports.spec infrastructure.
+# See note for python2. On python3 we rely on python-backports.spec infrastructure.
 rm -f $RPM_BUILD_ROOT%{py3_sitescriptdir}/configparser-%{version}-py*-nspkg.pth
 %endif
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-configparser.git/commitdiff/02e090dd3a47f9d7c50a71274b8f95a3c81f04fb



More information about the pld-cvs-commit mailing list