summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Alexander Kapshuna <kapsh@kap.sh> 2020-10-06 23:36:38 +0300
committerAvatar Heiko Becker <heirecka@exherbo.org> 2020-10-15 22:41:02 +0200
commitf50dfa914aab3733289bd5b098e7a697ef6b7514 (patch)
tree0cb0dd50d3781cda904e6565a9c88e04ba6134ec
parent913a9126ea2aa08464a725e453ef79b2af62fedf (diff)
downloadarbor-f50dfa914aab3733289bd5b098e7a697ef6b7514.tar.gz
arbor-f50dfa914aab3733289bd5b098e7a697ef6b7514.tar.xz
python: add 3.9.0
-rw-r--r--exlibs/python.exlib2
-rw-r--r--metadata/options/descriptions/python_abis.conf3
-rw-r--r--metadata/repository_mask.conf7
-rw-r--r--packages/dev-lang/python/files/3.9/Respect-PYTHON_DISABLE_MODULES-in-setup.py.patch24
-rw-r--r--packages/dev-lang/python/files/3.9/distutils-compiler-name.patch16
-rw-r--r--packages/dev-lang/python/files/3.9/use-localhost-for-tests.patch60
-rw-r--r--packages/dev-lang/python/python-3.9.0.exheres-092
-rw-r--r--profiles/make.defaults3
8 files changed, 203 insertions, 4 deletions
diff --git a/exlibs/python.exlib b/exlibs/python.exlib
index 8066fe627..d556ec096 100644
--- a/exlibs/python.exlib
+++ b/exlibs/python.exlib
@@ -225,7 +225,7 @@ case ${PYTHON_EXLIB_API} in
# PYTHON_AVAILABLE_ABIS below need to be in sync with
# MULTIBUILD_PYTHON_ABIS_TARGETS in profiles/make.defaults.
- PYTHON_AVAILABLE_ABIS="2.7 3.6 3.7 3.8"
+ PYTHON_AVAILABLE_ABIS="2.7 3.6 3.7 3.8 3.9"
if [[ ${PYTHON_BLACKLIST} == none ]]; then
PYTHON_FILTERED_ABIS="${PYTHON_AVAILABLE_ABIS}"
diff --git a/metadata/options/descriptions/python_abis.conf b/metadata/options/descriptions/python_abis.conf
index 761257f9a..d01816cf4 100644
--- a/metadata/options/descriptions/python_abis.conf
+++ b/metadata/options/descriptions/python_abis.conf
@@ -1,6 +1,5 @@
2.7 - Use Python ABI 2.7
-3.4 - Use Python ABI 3.4
-3.5 - Use Python ABI 3.5
3.6 - Use Python ABI 3.6
3.7 - Use Python ABI 3.7
3.8 - Use Python ABI 3.8
+3.9 - Use Python ABI 3.9
diff --git a/metadata/repository_mask.conf b/metadata/repository_mask.conf
index 8f091fdf1..b655b7df9 100644
--- a/metadata/repository_mask.conf
+++ b/metadata/repository_mask.conf
@@ -1016,6 +1016,13 @@ media-gfx/graphviz[<2.42.1] [[
*description = [ CVE-2020-10663, CVE-2020-10933 ]
]]
+dev-lang/python:3.9 [[
+ author = [ Alexander Kapshuna <kapsh@kap.sh> ]
+ date = [ 06 Oct 2020 ]
+ token = testing
+ description = [ Might break some packages ]
+]]
+
dev-libs/libpcap[<1.9.1] [[
author = [ Heiko Becker <heirecka@exherbo.org> ]
date = [ 06 Oct 2019 ]
diff --git a/packages/dev-lang/python/files/3.9/Respect-PYTHON_DISABLE_MODULES-in-setup.py.patch b/packages/dev-lang/python/files/3.9/Respect-PYTHON_DISABLE_MODULES-in-setup.py.patch
new file mode 100644
index 000000000..f41c23091
--- /dev/null
+++ b/packages/dev-lang/python/files/3.9/Respect-PYTHON_DISABLE_MODULES-in-setup.py.patch
@@ -0,0 +1,24 @@
+From e74f260e0595b41ed72a4c87228351efa11473f5 Mon Sep 17 00:00:00 2001
+From: Paul Seidler <sepek@exherbo.org>
+Date: Tue, 29 Nov 2011 21:59:28 +0100
+Subject: [PATCH 2/3] Respect PYTHON_DISABLE_MODULES in setup.py
+
+Based on patch by Ali Polatel, from Gentoo
+Upstream: no
+---
+ setup.py | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 6cbbec9e12..b2dd529756 100644
+--- a/setup.py
++++ b/setup.py
+@@ -24,7 +24,7 @@ from distutils.spawn import find_executable
+ TEST_EXTENSIONS = True
+
+ # This global variable is used to hold the list of modules to be disabled.
+-DISABLED_MODULE_LIST = []
++DISABLED_MODULE_LIST = os.environ.get("PYTHON_DISABLE_MODULES", "").split()
+
+
+ def get_platform():
diff --git a/packages/dev-lang/python/files/3.9/distutils-compiler-name.patch b/packages/dev-lang/python/files/3.9/distutils-compiler-name.patch
new file mode 100644
index 000000000..5a6142631
--- /dev/null
+++ b/packages/dev-lang/python/files/3.9/distutils-compiler-name.patch
@@ -0,0 +1,16 @@
+Source: written by Calvin Walton <calvin.walton@kepstin.ca>
+Upstream: http://bugs.python.org/issue25229
+Reason: distutils checks for 'gcc' in compiler name, but Exherbo uses 'cc'
+
+diff -ru Python-3.4.3.orig/Lib/distutils/unixccompiler.py Python-3.4.3/Lib/distutils/unixccompiler.py
+--- Python-3.4.3.orig/Lib/distutils/unixccompiler.py 2015-09-24 17:47:51.326840548 -0400
++++ Python-3.4.3/Lib/distutils/unixccompiler.py 2015-09-24 17:48:44.777604734 -0400
+@@ -232,7 +232,7 @@
+ elif sys.platform[:7] == "irix646" or sys.platform[:6] == "osf1V5":
+ return ["-rpath", dir]
+ else:
+- if self._is_gcc(compiler):
++ if sys.platform[:5] == "linux" or self._is_gcc(compiler):
+ # gcc on non-GNU systems does not need -Wl, but can
+ # use it anyway. Since distutils has always passed in
+ # -Wl whenever gcc was used in the past it is probably
diff --git a/packages/dev-lang/python/files/3.9/use-localhost-for-tests.patch b/packages/dev-lang/python/files/3.9/use-localhost-for-tests.patch
new file mode 100644
index 000000000..2df24e68f
--- /dev/null
+++ b/packages/dev-lang/python/files/3.9/use-localhost-for-tests.patch
@@ -0,0 +1,60 @@
+From d252f48d1ab46eeb1b0c455b13d6eeb93e2c470d Mon Sep 17 00:00:00 2001
+From: Paul Seidler <sepek@exherbo.org>
+Date: Sun, 27 Nov 2011 14:09:36 +0100
+Subject: [PATCH] use localhost for tests
+
+Upstream: no
+Updated for 3.9
+---
+diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
+index ed125893d6..f5758b5ead 100644
+--- a/Lib/test/test_httplib.py
++++ b/Lib/test/test_httplib.py
+@@ -1500,7 +1500,7 @@ class SourceAddressTest(TestCase):
+
+ def testHTTPConnectionSourceAddress(self):
+ self.conn = client.HTTPConnection(HOST, self.port,
+- source_address=('', self.source_port))
++ source_address=('localhost', self.source_port))
+ self.conn.connect()
+ self.assertEqual(self.conn.sock.getsockname()[1], self.source_port)
+
+diff --git a/Lib/test/test_largefile.py b/Lib/test/test_largefile.py
+index a99b4ba89a..5402535282 100644
+--- a/Lib/test/test_largefile.py
++++ b/Lib/test/test_largefile.py
+@@ -221,7 +221,7 @@ class TestSocketSendfile(LargeFileTest, unittest.TestCase):
+ @skip_no_disk_space(TESTFN, size * 2.5)
+ def test_it(self):
+ port = socket_helper.find_unused_port()
+- with socket.create_server(("", port)) as sock:
++ with socket.create_server(("localhost", port)) as sock:
+ self.tcp_server(sock)
+ with socket.create_connection(("127.0.0.1", port)) as client:
+ with open(TESTFN, 'rb') as f:
+diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
+index 5d496c6687..532647614a 100644
+--- a/Lib/test/test_ssl.py
++++ b/Lib/test/test_ssl.py
+@@ -584,10 +584,10 @@ class BasicSocketTests(unittest.TestCase):
+ self.assertRaises(OSError, ss.recvfrom, 1)
+ self.assertRaises(OSError, ss.recvfrom_into, bytearray(b'x'), 1)
+ self.assertRaises(OSError, ss.send, b'x')
+- self.assertRaises(OSError, ss.sendto, b'x', ('0.0.0.0', 0))
++ self.assertRaises(OSError, ss.sendto, b'x', ('localhost', 0))
+ self.assertRaises(NotImplementedError, ss.dup)
+ self.assertRaises(NotImplementedError, ss.sendmsg,
+- [b'x'], (), 0, ('0.0.0.0', 0))
++ [b'x'], (), 0, ('localhost', 0))
+ self.assertRaises(NotImplementedError, ss.recvmsg, 100)
+ self.assertRaises(NotImplementedError, ss.recvmsg_into,
+ [bytearray(100)])
+@@ -2625,7 +2625,7 @@ class AsyncoreEchoServer(threading.Thread):
+ def __init__(self, certfile):
+ self.certfile = certfile
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+- self.port = socket_helper.bind_port(sock, '')
++ self.port = socket_helper.bind_port(sock)
+ asyncore.dispatcher.__init__(self, sock)
+ self.listen(5)
+
diff --git a/packages/dev-lang/python/python-3.9.0.exheres-0 b/packages/dev-lang/python/python-3.9.0.exheres-0
new file mode 100644
index 000000000..c9d1fad8d
--- /dev/null
+++ b/packages/dev-lang/python/python-3.9.0.exheres-0
@@ -0,0 +1,92 @@
+# Copyright 2009, 2010 Ingmar Vanhassel
+# Distributed under the terms of the GNU General Public License v2
+
+require python-build
+
+PLATFORMS="~amd64 ~arm ~armv7 ~armv8 ~x86"
+
+DEPENDENCIES+="
+ build+run:
+ app-arch/xz
+"
+
+src_test() {
+ local DISABLE_TESTS
+ DISABLE_TESTS=(
+ # Has problems with path resolution
+ test_distutils
+
+ # Never-ending threads running under gdb
+ test_gdb
+
+ # Run forever sometimes (sandboxing issue?)
+ test_multiprocessing_fork
+ test_multiprocessing_forkserver
+ test_multiprocessing_spawn
+
+ # Seems to hang
+ test_socket
+
+ # Fail in CI environment
+ test_asyncore
+ test_posix
+
+ # Want access to DNS
+ test_robotparser
+ test_smtpnet
+ test_ssl
+ test_timeout
+ test_urllib
+ test_urllibnet
+ test_urllib2
+ test_urllib2_localnet
+ test_urllib2net
+
+ # Want to bind to 0.0.0.0/::
+ # TODO: check which of these tests actually fall in this category
+ test_asyncio
+ test_ctypes
+ test_fcntl
+ test_float
+ test_ftplib
+ test_httplib
+ test_normalization
+ test_os
+ test_pathlib
+ test_pydoc
+ test_pyexpat
+ test_site
+ test_sqlite
+
+ # Downloads data from the Internet
+ test_unicodedata
+ )
+
+ # for argparse test_help_with_metavar
+ local COLUMNS=80
+
+ local ALLOW_NETWORK allowed_item
+ ALLOW_NETWORK=(
+ # for test_socketserver
+ "unix:${TEMP%/}"'/unix_socket.*'
+ # for test_sysconfig
+ "unix:${TEMP%/}"/'tmp*'
+ # for test_logging
+ "unix:${TEMP%/}"'/test_logging_*.sock'
+ # for test_asyncore
+ "unix:${PWD%/}"'/build/test_python_*/@test_*_tmp'
+ # for test_concurrent_futures
+ "unix-abstract:listener-*-*"
+ )
+
+ for allowed_item in "${ALLOW_NETWORK[@]}"; do
+ esandbox allow_net ${allowed_item}
+ done
+
+ python-build_src_test
+
+ for allowed_item in "${ALLOW_NETWORK[@]}"; do
+ esandbox disallow_net ${allowed_item}
+ done
+}
+
diff --git a/profiles/make.defaults b/profiles/make.defaults
index 33b8e742f..653ecb42f 100644
--- a/profiles/make.defaults
+++ b/profiles/make.defaults
@@ -25,9 +25,10 @@ MULTIBUILD_LUA_ABIS_5_1_PROFILE_LUA="lua5.1"
# MULTIBUILD_PYTHON_ABIS_TARGETS below need to be in sync with
# PYTHON_AVAILABLE_ABIS in exlibs/python.exlib.
-MULTIBUILD_PYTHON_ABIS_TARGETS="2.7 3.6 3.7 3.8"
+MULTIBUILD_PYTHON_ABIS_TARGETS="2.7 3.6 3.7 3.8 3.9"
MULTIBUILD_PYTHON_ABIS_LOCKED_VARS="PYTHON"
MULTIBUILD_PYTHON_ABIS_REQUIRED_VARS="PYTHON"
+MULTIBUILD_PYTHON_ABIS_3_9_PROFILE_PYTHON="python3.9"
MULTIBUILD_PYTHON_ABIS_3_8_PROFILE_PYTHON="python3.8"
MULTIBUILD_PYTHON_ABIS_3_7_PROFILE_PYTHON="python3.7"
MULTIBUILD_PYTHON_ABIS_3_6_PROFILE_PYTHON="python3.6"