Commit e4a5cc6e authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Upgraded python to 3.9.5

parent af3980fa
all:
tar xf Python-3.8.3.tar.xz
patch -Np1 -d Python-3.8.3 < Python-3.8.3-nntp_test_fix.patch
patch -Np1 -d Python-3.8.3 < Python-3.8.3-sqlite_test_fix.patch
cd Python-3.8.3 && ./configure --build=$(CLFS_TARGET) --prefix=/usr --enable-shared --with-system-expat --with-system-ffi --with-ensurepip=yes --enable-optimizations
$(MAKE) -C Python-3.8.3
tar xf Python-3.9.5.tar.xz
cd Python-3.9.5 && ./configure --build=$(CLFS_TARGET) --prefix=/usr --enable-shared --with-system-expat --with-system-ffi --with-ensurepip=yes --enable-optimizations
$(MAKE) -C Python-3.9.5
if [[ ! "$(BUILD_OPTIONS)" =~ no-tests ]] ; then \
$(MAKE) -C Python-3.8.3 test EXTRATESTOPTS="-j 1 -u all,-urlfetch --timeout=3600" ; \
$(MAKE) -C Python-3.9.5 test EXTRATESTOPTS="-j 1 -u all,-urlfetch --timeout=14400" ; \
fi
$(MAKE) -C Python-3.8.3 install
ln -sfv pip3.8 /usr/bin/pip3
$(MAKE) -C Python-3.9.5 install
ln -sfv pip3.9 /usr/bin/pip3
rm -f $(HOME)/.python_history
rm -rf Python-3.8.3
rm -rf Python-3.9.5
diff -uNr Python-3.8.3/Lib/test/test_nntplib.py Python-3.8.3-nntp_test_fix/Lib/test/test_nntplib.py
--- Python-3.8.3/Lib/test/test_nntplib.py 2020-05-14 03:01:54.000000000 +0930
+++ Python-3.8.3-nntp_test_fix/Lib/test/test_nntplib.py 2021-08-23 18:34:21.547699205 +0930
@@ -82,7 +82,7 @@
desc = self.server.description(self.GROUP_NAME)
_check_desc(desc)
# Another sanity check
- self.assertIn("Python", desc)
+ self.assertIn(self.DESC, desc)
# With a pattern
desc = self.server.description(self.GROUP_PAT)
_check_desc(desc)
@@ -299,6 +299,7 @@
NNTP_HOST = 'news.trigofacile.com'
GROUP_NAME = 'fr.comp.lang.python'
GROUP_PAT = 'fr.comp.lang.*'
+ DESC = 'Python'
NNTP_CLASS = NNTP
@@ -332,8 +333,11 @@
# 400 connections per day are accepted from each IP address."
NNTP_HOST = 'nntp.aioe.org'
- GROUP_NAME = 'comp.lang.python'
- GROUP_PAT = 'comp.lang.*'
+ # bpo-42794: aioe.test is one of the official groups on this server
+ # used for testing: https://news.aioe.org/manual/aioe-hierarchy/
+ GROUP_NAME = 'aioe.test'
+ GROUP_PAT = 'aioe.*'
+ DESC = 'test'
NNTP_CLASS = getattr(nntplib, 'NNTP_SSL', None)
diff -uNr Python-3.8.3/Misc/NEWS.d/next/Tests/2021-01-01-08-52-36.bpo-42794.-7-XGz.rst Python-3.8.3-nntp_test_fix/Misc/NEWS.d/next/Tests/2021-01-01-08-52-36.bpo-42794.-7-XGz.rst
--- Python-3.8.3/Misc/NEWS.d/next/Tests/2021-01-01-08-52-36.bpo-42794.-7-XGz.rst 1970-01-01 09:30:00.000000000 +0930
+++ Python-3.8.3-nntp_test_fix/Misc/NEWS.d/next/Tests/2021-01-01-08-52-36.bpo-42794.-7-XGz.rst 2021-08-23 18:34:21.547699205 +0930
@@ -0,0 +1,2 @@
+Update test_nntplib to use offical group name of news.aioe.org for testing.
+Patch by Dong-hee Na.
diff -uNr Python-3.8.3/Lib/sqlite3/test/userfunctions.py Python-3.8.3-sqlite_test_fix/Lib/sqlite3/test/userfunctions.py
--- Python-3.8.3/Lib/sqlite3/test/userfunctions.py 2020-05-14 03:01:54.000000000 +0930
+++ Python-3.8.3-sqlite_test_fix/Lib/sqlite3/test/userfunctions.py 2021-08-23 17:17:16.812492008 +0930
@@ -1,8 +1,7 @@
-#-*- coding: iso-8859-1 -*-
# pysqlite2/test/userfunctions.py: tests for user-defined functions and
# aggregates.
#
-# Copyright (C) 2005-2007 Gerhard Hring <gh@ghaering.de>
+# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
@@ -158,6 +157,7 @@
self.con.create_function("isblob", 1, func_isblob)
self.con.create_function("islonglong", 1, func_islonglong)
self.con.create_function("spam", -1, func)
+ self.con.execute("create table test(t text)")
def tearDown(self):
self.con.close()
@@ -276,18 +276,36 @@
val = cur.fetchone()[0]
self.assertEqual(val, 2)
+ # Regarding deterministic functions:
+ #
+ # Between 3.8.3 and 3.15.0, deterministic functions were only used to
+ # optimize inner loops, so for those versions we can only test if the
+ # sqlite machinery has factored out a call or not. From 3.15.0 and onward,
+ # deterministic functions were permitted in WHERE clauses of partial
+ # indices, which allows testing based on syntax, iso. the query optimizer.
+ @unittest.skipIf(sqlite.sqlite_version_info < (3, 8, 3), "Requires SQLite 3.8.3 or higher")
def CheckFuncNonDeterministic(self):
mock = unittest.mock.Mock(return_value=None)
- self.con.create_function("deterministic", 0, mock, deterministic=False)
- self.con.execute("select deterministic() = deterministic()")
- self.assertEqual(mock.call_count, 2)
+ self.con.create_function("nondeterministic", 0, mock, deterministic=False)
+ if sqlite.sqlite_version_info < (3, 15, 0):
+ self.con.execute("select nondeterministic() = nondeterministic()")
+ self.assertEqual(mock.call_count, 2)
+ else:
+ with self.assertRaises(sqlite.OperationalError):
+ self.con.execute("create index t on test(t) where nondeterministic() is not null")
- @unittest.skipIf(sqlite.sqlite_version_info < (3, 8, 3), "deterministic parameter not supported")
+ @unittest.skipIf(sqlite.sqlite_version_info < (3, 8, 3), "Requires SQLite 3.8.3 or higher")
def CheckFuncDeterministic(self):
mock = unittest.mock.Mock(return_value=None)
self.con.create_function("deterministic", 0, mock, deterministic=True)
- self.con.execute("select deterministic() = deterministic()")
- self.assertEqual(mock.call_count, 1)
+ if sqlite.sqlite_version_info < (3, 15, 0):
+ self.con.execute("select deterministic() = deterministic()")
+ self.assertEqual(mock.call_count, 1)
+ else:
+ try:
+ self.con.execute("create index t on test(t) where deterministic() is not null")
+ except sqlite.OperationalError:
+ self.fail("Unexpected failure while creating partial index")
@unittest.skipIf(sqlite.sqlite_version_info >= (3, 8, 3), "SQLite < 3.8.3 needed")
def CheckFuncDeterministicNotSupported(self):
<project name="python3">
<target name="cross-python3">
<property name="makedir" value="${builddir}/Python-3.8.3"/>
<property name="makedir" value="${builddir}/Python-3.9.5"/>
<exec executable="tar" failonerror="true">
<arg line="xf packages/python3/Python-3.8.3.tar.xz -C ${builddir}"/>
<arg line="xf packages/python3/Python-3.9.5.tar.xz -C ${builddir}"/>
</exec>
<exec executable="bash" dir="${makedir}" failonerror="true">
<arg line="-c &quot;sed -i '/def add_multiarch_paths/a \ return' setup.py&quot;"/>
......@@ -20,9 +20,9 @@
</target>
<target name="temporary-python3">
<property name="makedir" value="${builddir}/Python-3.8.3"/>
<property name="makedir" value="${builddir}/Python-3.9.5"/>
<exec executable="tar" failonerror="true">
<arg line="xf packages/python3/Python-3.8.3.tar.xz -C ${builddir}"/>
<arg line="xf packages/python3/Python-3.9.5.tar.xz -C ${builddir}"/>
</exec>
<exec executable="bash" dir="${makedir}" failonerror="true">
<arg line="-c &quot;sed -i '/def add_multiarch_paths/a \ return' setup.py&quot;"/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment