[packages/python3] - rel 1; test suite passes now

arekm arekm at pld-linux.org
Fri Jun 29 11:10:47 CEST 2018


commit a2b17ec1268b6111f4d44e4651047edb65e91ddc
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Jun 29 11:10:32 2018 +0200

    - rel 1; test suite passes now

 nonexistent_user.patch | 44 ++++++++++++++++++++++++++++++++++++++++++++
 python3.spec           | 15 ++++++++-------
 2 files changed, 52 insertions(+), 7 deletions(-)
---
diff --git a/python3.spec b/python3.spec
index bd10c09..f8a4644 100644
--- a/python3.spec
+++ b/python3.spec
@@ -19,7 +19,7 @@
 %ifarch x32
 %define		broken_tests_x32	test_time
 %endif
-%define		broken_tests	test_nntplib test_gdb test_site test_ssl %{?broken_tests_x32}
+%define		broken_tests	test_nntplib test_gdb test_site test_distutils test_bdist_rpm test_ssl %{?broken_tests_x32}
 
 %define py_ver		3.7
 %define py_abi		%{py_ver}m
@@ -40,7 +40,7 @@ Summary(tr.UTF-8):	X arayüzlü, yüksek düzeyli, kabuk yorumlayıcı dili
 Summary(uk.UTF-8):	Мова програмування дуже високого рівня з X-інтерфейсом
 Name:		python3
 Version:	%{py_ver}.0
-Release:	0.1
+Release:	1
 Epoch:		1
 License:	PSF
 Group:		Development/Languages/Python
@@ -58,8 +58,9 @@ Patch8:		%{name}-install_prefix.patch
 Patch9:		%{name}-tests_with_pythonpath.patch
 Patch10:	%{name}-bdist_rpm.patch
 Patch11:	%{name}-installcompile.patch
-Patch12:                https://bugs.python.org/file21896/nonexistent_user.patch
-# Patch12-md5:	db706fbe6de467c6e4c97c675eddf29a
+# https://bugs.python.org/file21896/nonexistent_user.patch
+Patch12:        nonexistent_user.patch
+Patch13:	python3-no-randomize-tests.patch
 URL:		https://www.python.org/
 BuildRequires:	autoconf >= 2.65
 BuildRequires:	automake
@@ -97,7 +98,7 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %if %{with verbose_tests}
 %define test_flags -v -x
 %else
-%define test_flags -w -x
+%define test_flags -wW -x
 %endif
 
 %ifarch alpha ia64 ppc64 sparc64 ppc64 %{x8664}
@@ -487,6 +488,7 @@ Moduły testowe dla Pythona.
 %patch10 -p1
 %patch11 -p1
 %patch12 -p1
+%patch13 -p1
 
 %{__rm} -r Modules/expat
 
@@ -552,8 +554,7 @@ export LC_ALL
 binlibdir=`echo build/lib.*`
 # -l and -j don't go together! and -j is brought up by Tools/scripts/run_tests.py
 WITHIN_PYTHON_RPM_BUILD=1 %{__make} test \
-	TESTOPTS="%{test_flags} %{test_list}" \
-	TESTPYTHON="LD_LIBRARY_PATH=`pwd` PYTHONHOME=`pwd` PYTHONPATH=`pwd`/Lib:`pwd`/$binlibdir ./python -tt"
+	TESTOPTS="%{test_flags} %{test_list}"
 %endif
 
 %install
diff --git a/nonexistent_user.patch b/nonexistent_user.patch
new file mode 100644
index 0000000..7a811e7
--- /dev/null
+++ b/nonexistent_user.patch
@@ -0,0 +1,44 @@
+diff --git a/Lib/site.py b/Lib/site.py
+--- a/Lib/site.py
++++ b/Lib/site.py
+@@ -262,7 +266,7 @@ def addusersitepackages(known_paths):
+     # this call will also make sure USER_BASE and USER_SITE are set
+     user_site = getusersitepackages()
+ 
+-    if ENABLE_USER_SITE and os.path.isdir(user_site):
++    if ENABLE_USER_SITE and user_site and os.path.isdir(user_site):
+         addsitedir(user_site, known_paths)
+     return known_paths
+ 
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -170,7 +170,13 @@ def _expand_vars(scheme, vars):
+     for key, value in _INSTALL_SCHEMES[scheme].items():
+         if os.name in ('posix', 'nt'):
+             value = os.path.expanduser(value)
+-        res[key] = os.path.normpath(_subst_vars(value, vars))
++        try:
++            path = _subst_vars(value, vars)
++        except AttributeError:
++            # a substitution variable doesn't exist (eg. '{userbase}'),
++            # don't create the variable
++            continue
++        res[key] = os.path.normpath(path)
+     return res
+ 
+ def _get_default_scheme():
+@@ -488,7 +494,12 @@ def get_config_vars(*args):
+         # Setting 'userbase' is done below the call to the
+         # init function to enable using 'get_config_var' in
+         # the init-function.
+-        _CONFIG_VARS['userbase'] = _getuserbase()
++        try:
++            _CONFIG_VARS['userbase'] = _getuserbase()
++        except KeyError:
++            # catch getpwuid() error: don't create the variable if the user
++            # doesn't exist
++            pass
+ 
+         if 'srcdir' not in _CONFIG_VARS:
+             _CONFIG_VARS['srcdir'] = _PROJECT_BASE
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3.git/commitdiff/a2b17ec1268b6111f4d44e4651047edb65e91ddc



More information about the pld-cvs-commit mailing list