summaryrefslogtreecommitdiff
path: root/lang/python
diff options
context:
space:
mode:
authoradam <adam@pkgsrc.org>2015-12-05 17:12:13 +0000
committeradam <adam@pkgsrc.org>2015-12-05 17:12:13 +0000
commit79e91edb6da5f987ae6b41529a18ddc8d6ebb596 (patch)
tree2e4392e4999e7c8755cb03109b316314e95e6e8d /lang/python
parentaa52d21be9307465da106593cb45e6ac0b753f49 (diff)
downloadpkgsrc-79e91edb6da5f987ae6b41529a18ddc8d6ebb596.tar.gz
What’s New In Python 3.5
New syntax features: * PEP 492, coroutines with async and await syntax. * PEP 465, a new matrix multiplication operator: a @ b. * PEP 448, additional unpacking generalizations. New library modules: * typing: PEP 484 – Type Hints. * zipapp: PEP 441 Improving Python ZIP Application Support. New built-in features: * bytes % args, bytearray % args: PEP 461 – Adding % formatting to bytes and bytearray. * New bytes.hex(), bytearray.hex() and memoryview.hex() methods. (Contributed by Arnon Yaari in issue 9951.) * memoryview now supports tuple indexing (including multi-dimensional). (Contributed by Antoine Pitrou in issue 23632.) * Generators have a new gi_yieldfrom attribute, which returns the object being iterated by yield from expressions. (Contributed by Benno Leslie and Yury Selivanov in issue 24450.) * A new RecursionError exception is now raised when maximum recursion depth is reached. (Contributed by Georg Brandl in issue 19235.) CPython implementation improvements: * When the LC_TYPE locale is the POSIX locale (C locale), sys.stdin and sys.stdout now use the surrogateescape error handler, instead of the strict error handler. (Contributed by Victor Stinner in issue 19977.) * .pyo files are no longer used and have been replaced by a more flexible scheme that includes the optimization level explicitly in .pyc name. (See PEP 488 overview.) * Builtin and extension modules are now initialized in a multi-phase process, which is similar to how Python modules are loaded. (See PEP 489 overview.) Significant improvements in the standard library: * collections.OrderedDict is now implemented in C, which makes it 4 to 100 times faster. * The ssl module gained support for Memory BIO, which decouples SSL protocol handling from network IO. * The new os.scandir() function provides a better and significantly faster way of directory traversal. * functools.lru_cache() has been mostly reimplemented in C, yielding much better performance. * The new subprocess.run() function provides a streamlined way to run subprocesses. * The traceback module has been significantly enhanced for improved performance and developer convenience. Security improvements: * SSLv3 is now disabled throughout the standard library. It can still be enabled by instantiating a ssl.SSLContext manually. (See issue 22638 for more details; this change was backported to CPython 3.4 and 2.7.) * HTTP cookie parsing is now stricter, in order to protect against potential injection attacks. (Contributed by Antoine Pitrou in issue 22796.) Windows improvements: * A new installer for Windows has replaced the old MSI. See Using Python on Windows for more information. * Windows builds now use Microsoft Visual C++ 14.0, and extension modules should use the same.
Diffstat (limited to 'lang/python')
-rw-r--r--lang/python/extension.mk4
-rw-r--r--lang/python/plist-python.awk15
-rw-r--r--lang/python/pyversion.mk12
3 files changed, 16 insertions, 15 deletions
diff --git a/lang/python/extension.mk b/lang/python/extension.mk
index 1cd05a9340f..d1624fa149f 100644
--- a/lang/python/extension.mk
+++ b/lang/python/extension.mk
@@ -1,4 +1,4 @@
-# $NetBSD: extension.mk,v 1.39 2015/04/14 11:40:31 wiz Exp $
+# $NetBSD: extension.mk,v 1.40 2015/12/05 17:12:13 adam Exp $
.include "../../lang/python/pyversion.mk"
@@ -68,7 +68,7 @@ PY_PEP3147?= yes
.endif
.if defined(PY_PEP3147) && !empty(PY_PEP3147:M[yY][eE][sS])
PLIST_AWK+= -f ${PKGSRCDIR}/lang/python/plist-python.awk
-PLIST_AWK_ENV+= PYTHON_SOABI="cpython-${_PYTHON_VERSION}"
+PLIST_AWK_ENV+= PYVERS="${PYVERSSUFFIX:S/.//}"
PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.py[co]$$/ {
PRINT_PLIST_AWK+= gsub(/__pycache__\//, "")
PRINT_PLIST_AWK+= gsub(/\.cpython-${_PYTHON_VERSION}/, "")}
diff --git a/lang/python/plist-python.awk b/lang/python/plist-python.awk
index a2a4159176d..57f700aa988 100644
--- a/lang/python/plist-python.awk
+++ b/lang/python/plist-python.awk
@@ -1,4 +1,4 @@
-# $NetBSD: plist-python.awk,v 1.1 2012/05/13 12:54:54 obache Exp $
+# $NetBSD: plist-python.awk,v 1.2 2015/12/05 17:12:13 adam Exp $
#
# Copyright (c) 2012 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -34,17 +34,18 @@
###
### Certain environment variables must be set prior to running this script:
###
-### PY_SOABI is the python SO ABI.
+### PYVERS
###
BEGIN {
- PYTHON_SOABI = getenv_or_die("PYTHON_SOABI")
+ PYVERS = getenv_or_die("PYVERS")
}
-###
-### For each python bytecode file entry, convert directory and file name
-### using cache sub directory and SOABI.
+### For each python bytecode file entry, convert directory and file name.
###
/^[^@]/ && /[^\/]+\.py[co]$/ {
sub(/[^\/]+\.py[co]$/, "__pycache__/&")
- sub(/\.py[co]$/, "." PYTHON_SOABI "&")
+ sub(/\.py[co]$/, ".cpython-" PYVERS "&")
+ if (PYVERS ~ /^3[5-9]$/ && $0 ~ /\.pyo$/) {
+ sub(/\.pyo$/, ".opt-1.pyc")
+ }
}
diff --git a/lang/python/pyversion.mk b/lang/python/pyversion.mk
index 28320a9ba17..f21fc22ea27 100644
--- a/lang/python/pyversion.mk
+++ b/lang/python/pyversion.mk
@@ -1,4 +1,4 @@
-# $NetBSD: pyversion.mk,v 1.117 2015/04/13 23:12:44 rodent Exp $
+# $NetBSD: pyversion.mk,v 1.118 2015/12/05 17:12:13 adam Exp $
# This file determines which Python version is used as a dependency for
# a package.
@@ -8,7 +8,7 @@
# PYTHON_VERSION_DEFAULT
# The preferred Python version to use.
#
-# Possible values: 27 33 34
+# Possible values: 27 33 34 35
# Default: 27
#
# === Infrastructure variables ===
@@ -27,13 +27,13 @@
# order of the entries matters, since earlier entries are
# preferred over later ones.
#
-# Possible values: 34 33 27
-# Default: 34 33 27
+# Possible values: 35 34 33 27
+# Default: 35 34 33 27
#
# PYTHON_VERSIONS_INCOMPATIBLE
# The Python versions that are NOT acceptable for the package.
#
-# Possible values: 27 33 34
+# Possible values: 27 33 34 35
# Default: (empty)
#
# PYTHON_FOR_BUILD_ONLY
@@ -85,7 +85,7 @@ BUILD_DEFS+= PYTHON_VERSION_DEFAULT
BUILD_DEFS_EFFECTS+= PYPACKAGE
PYTHON_VERSION_DEFAULT?= 27
-PYTHON_VERSIONS_ACCEPTED?= 34 33 27
+PYTHON_VERSIONS_ACCEPTED?= 35 34 33 27
PYTHON_VERSIONS_INCOMPATIBLE?= # empty by default
# transform the list into individual variables