pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang What?s New In Python 3.6



details:   https://anonhg.NetBSD.org/pkgsrc/rev/65ef1e365d25
branches:  trunk
changeset: 356494:65ef1e365d25
user:      adam <adam%pkgsrc.org@localhost>
date:      Sun Jan 01 14:34:26 2017 +0000

description:
What?s New In Python 3.6

Summary ? Release highlights
New syntax features:

PEP 498, formatted string literals.
PEP 515, underscores in numeric literals.
PEP 526, syntax for variable annotations.
PEP 525, asynchronous generators.
PEP 530: asynchronous comprehensions.
New library modules:

secrets: PEP 506 ? Adding A Secrets Module To The Standard Library.
CPython implementation improvements:

The dict type has been reimplemented to use a more compact representation based on a proposal by Raymond Hettinger and similar to the PyPy dict implementation. This resulted in dictionaries using 20% 
to 25% less memory when compared to Python 3.5.
Customization of class creation has been simplified with the new protocol.
The class attribute definition order is now preserved.
The order of elements in **kwargs now corresponds to the order in which keyword arguments were passed to the function.
DTrace and SystemTap probing support has been added.
The new PYTHONMALLOC environment variable can now be used to debug the interpreter memory allocation and access errors.
Significant improvements in the standard library:

The asyncio module has received new features, significant usability and performance improvements, and a fair amount of bug fixes. Starting with Python 3.6 the asyncio module is no longer provisional 
and its API is considered stable.
A new file system path protocol has been implemented to support path-like objects. All standard library functions operating on paths have been updated to work with the new protocol.
The datetime module has gained support for Local Time Disambiguation.
The typing module received a number of improvements and is no longer provisional.
The tracemalloc module has been significantly reworked and is now used to provide better output for ResourceWarning as well as provide better diagnostics for memory allocation errors. See the 
PYTHONMALLOC section for more information.
Security improvements:

The new secrets module has been added to simplify the generation of cryptographically strong pseudo-random numbers suitable for managing secrets such as account authentication, tokens, and similar.
On Linux, os.urandom() now blocks until the system urandom entropy pool is initialized to increase the security. See the PEP 524 for the rationale.
The hashlib and ssl modules now support OpenSSL 1.1.0.
The default settings and feature set of the ssl module have been improved.
The hashlib module received support for the BLAKE2, SHA-3 and SHAKE hash algorithms and the scrypt() key derivation function.

diffstat:

 lang/Makefile                                                |     3 +-
 lang/python/pyversion.mk                                     |    12 +-
 lang/python/srcdist.mk                                       |     4 +-
 lang/python36/ALTERNATIVES                                   |     4 +
 lang/python36/DESCR                                          |    16 +
 lang/python36/Makefile                                       |   174 +
 lang/python36/PLIST                                          |  5147 ++++++++++
 lang/python36/PLIST.Darwin                                   |     2 +
 lang/python36/PLIST.FreeBSD                                  |     2 +
 lang/python36/PLIST.IRIX                                     |    66 +
 lang/python36/PLIST.Linux                                    |    11 +
 lang/python36/PLIST.SunOS                                    |    13 +
 lang/python36/buildlink3.mk                                  |    24 +
 lang/python36/dist.mk                                        |     8 +
 lang/python36/distinfo                                       |    18 +
 lang/python36/options.mk                                     |    28 +
 lang/python36/patches/patch-Include_py__curses.h             |    30 +
 lang/python36/patches/patch-Lib_distutils_command_install.py |    12 +
 lang/python36/patches/patch-Lib_distutils_sysconfig.py       |    18 +
 lang/python36/patches/patch-Lib_distutils_unixccompiler.py   |    31 +
 lang/python36/patches/patch-Lib_sysconfig.py                 |    18 +
 lang/python36/patches/patch-Makefile.pre.in                  |    76 +
 lang/python36/patches/patch-Modules___cursesmodule.c         |    89 +
 lang/python36/patches/patch-Modules_makesetup                |    15 +
 lang/python36/patches/patch-Modules_nismodule.c              |    16 +
 lang/python36/patches/patch-Python_thread__pthread.h         |    14 +
 lang/python36/patches/patch-configure                        |   113 +
 lang/python36/patches/patch-setup.py                         |   140 +
 28 files changed, 6095 insertions(+), 9 deletions(-)

diffs (truncated from 6264 to 300 lines):

diff -r c49b18ec28c3 -r 65ef1e365d25 lang/Makefile
--- a/lang/Makefile     Sun Jan 01 14:07:19 2017 +0000
+++ b/lang/Makefile     Sun Jan 01 14:34:26 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.448 2016/12/30 22:27:04 alnsn Exp $
+# $NetBSD: Makefile,v 1.449 2017/01/01 14:34:26 adam Exp $
 #
 
 COMMENT=       Programming languages
@@ -184,6 +184,7 @@
 SUBDIR+=       python27
 SUBDIR+=       python34
 SUBDIR+=       python35
+SUBDIR+=       python36
 SUBDIR+=       qore
 SUBDIR+=       racket
 SUBDIR+=       racket-textual
diff -r c49b18ec28c3 -r 65ef1e365d25 lang/python/pyversion.mk
--- a/lang/python/pyversion.mk  Sun Jan 01 14:07:19 2017 +0000
+++ b/lang/python/pyversion.mk  Sun Jan 01 14:34:26 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: pyversion.mk,v 1.122 2016/07/09 13:03:53 wiz Exp $
+# $NetBSD: pyversion.mk,v 1.123 2017/01/01 14:34:26 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 34 35
+#      Possible values: 27 34 35 36
 #      Default: 27
 #
 # === Infrastructure variables ===
@@ -27,13 +27,13 @@
 #      order of the entries matters, since earlier entries are
 #      preferred over later ones.
 #
-#      Possible values: 35 34 27
-#      Default: 35 34 27
+#      Possible values: 36 35 34 27
+#      Default: 36 35 34 27
 #
 # PYTHON_VERSIONS_INCOMPATIBLE
 #      The Python versions that are NOT acceptable for the package.
 #
-#      Possible values: 27 34 35
+#      Possible values: 27 34 35 36
 #      Default: (empty)
 #
 # PYTHON_FOR_BUILD_ONLY
@@ -85,7 +85,7 @@
 BUILD_DEFS_EFFECTS+=   PYPACKAGE
 
 PYTHON_VERSION_DEFAULT?=               27
-PYTHON_VERSIONS_ACCEPTED?=             35 34 27
+PYTHON_VERSIONS_ACCEPTED?=             36 35 34 27
 PYTHON_VERSIONS_INCOMPATIBLE?=         # empty by default
 
 # transform the list into individual variables
diff -r c49b18ec28c3 -r 65ef1e365d25 lang/python/srcdist.mk
--- a/lang/python/srcdist.mk    Sun Jan 01 14:07:19 2017 +0000
+++ b/lang/python/srcdist.mk    Sun Jan 01 14:34:26 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: srcdist.mk,v 1.35 2015/12/05 20:44:22 adam Exp $
+# $NetBSD: srcdist.mk,v 1.36 2017/01/01 14:34:26 adam Exp $
 
 .include "../../lang/python/pyversion.mk"
 
@@ -11,7 +11,7 @@
 # This is used for standard modules shipped with Python but build as
 # separate packages.
 
-.  if ${PYVERSSUFFIX} == "3.5"
+.  if ${PYVERSSUFFIX} == "3.5" || ${PYVERSSUFFIX} == "3.6"
 EXTRACT_ELEMENTS+=     ${PYSUBDIR}/Modules/clinic
 .  endif
 
diff -r c49b18ec28c3 -r 65ef1e365d25 lang/python36/ALTERNATIVES
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/python36/ALTERNATIVES        Sun Jan 01 14:34:26 2017 +0000
@@ -0,0 +1,4 @@
+bin/2to3 @PREFIX@/bin/2to3-3.6
+bin/pydoc3 @PREFIX@/bin/pydoc3.6
+bin/python @PREFIX@/bin/python3.6
+bin/python3 @PREFIX@/bin/python3.6
diff -r c49b18ec28c3 -r 65ef1e365d25 lang/python36/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/python36/DESCR       Sun Jan 01 14:34:26 2017 +0000
@@ -0,0 +1,16 @@
+Python is an interpreted, interactive, object-oriented
+programming language that combines remarkable power with
+very clear syntax. For an introduction to programming in
+Python you are referred to the Python Tutorial. The
+Python Library Reference documents built-in and standard
+types, constants, functions and modules. Finally, the
+Python Reference Manual describes the syntax and semantics
+of the core language in (perhaps too) much detail.
+
+Python's basic power can be extended with your own modules
+written in C or C++. On most systems such modules may be
+dynamically loaded. Python is also adaptable as an exten-
+sion language for existing applications. See the internal
+documentation for hints.
+
+This package provides Python version 3.6.x.
diff -r c49b18ec28c3 -r 65ef1e365d25 lang/python36/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/python36/Makefile    Sun Jan 01 14:34:26 2017 +0000
@@ -0,0 +1,174 @@
+# $NetBSD: Makefile,v 1.1 2017/01/01 14:34:27 adam Exp $
+
+.include "dist.mk"
+
+PKGNAME=       python36-${PY_DISTVERSION}
+CATEGORIES=    lang python
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      http://www.python.org/
+COMMENT=       Interpreted, interactive, object-oriented programming language
+LICENSE=       python-software-foundation
+
+CONFLICTS+=    python-[0-9]*
+
+PLIST_AWK+=            -f ${PKGSRCDIR}/lang/python/plist-python.awk
+PLIST_AWK_ENV+=                PYVERS=36
+PRINT_PLIST_AWK+=      /^[^@]/ && /[^\/]+\.pyc$$/ {
+PRINT_PLIST_AWK+=      sub(/__pycache__\//, "")
+PRINT_PLIST_AWK+=      sub(/\.cpython-36/, "")}
+PRINT_PLIST_AWK+=      /^[^@]/ && /[^\/]+\.opt-1.pyc$$/ {
+PRINT_PLIST_AWK+=      sub(/.opt-[12].pyc$$/, ".pyo")}
+
+USE_LANGUAGES=         c c++
+GNU_CONFIGURE=         yes
+CONFIGURE_ARGS+=       --with-threads
+CONFIGURE_ARGS+=       --enable-shared
+CONFIGURE_ARGS+=       OPT=${CFLAGS:M*:Q}
+CONFIGURE_ARGS+=       --with-system-ffi
+CONFIGURE_ARGS+=       --without-pymalloc
+CONFIGURE_ARGS+=       --without-ensurepip
+CONFIGURE_ENV+=                ac_cv_path_mkdir=${TOOLS_PATH.mkdir}
+PKGCONFIG_OVERRIDE+=   Misc/python.pc.in
+
+PTHREAD_OPTS+= require
+.include "../../mk/pthread.buildlink3.mk"
+
+.include "../../mk/bsd.prefs.mk"
+
+# http://bugs.python.org/issue13241
+.if !empty(MACHINE_PLATFORM:MDarwin-10.*)
+PKGSRC_COMPILER=       clang
+PKG_CC=                        clang
+PKG_CXX=               clang++
+.endif
+
+# fdatasync()
+LIBS.SunOS+=           -lrt
+
+PY_VER_SUFFIX=         3.6
+
+.if ${OPSYS} == "Darwin"
+PY_PLATNAME=   ${LOWER_OPSYS}
+USE_TOOLS+=    gmake
+.elif ${OPSYS} == "IRIX"
+PY_PLATNAME=   ${LOWER_OPSYS:C/\..*//}
+.elif ${OPSYS} == "SunOS"
+PY_PLATNAME=   sunos${OS_VERSION:C/\..*//}
+.elif ${OPSYS} == "HPUX"
+PY_PLATNAME=   hp-ux11
+.elif ${OPSYS} == "Linux"
+PY_PLATNAME=   linux
+.else
+PY_PLATNAME=   ${LOWER_OPSYS}${OS_VERSION:C/\..*//}
+.endif
+PLIST_SUBST+=  PY_PLATNAME=${PY_PLATNAME:Q}
+
+# ossaudiodev is only available on x86 for the following platforms
+PLIST_VARS+=   oss
+.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \
+    (${PY_PLATNAME} == "linux" || ${OPSYS} == "FreeBSD")
+PLIST.oss=     yes
+.endif
+
+# For Xcode 5 and up, we need to search the SDK path for headers, otherwise
+# certain modules will not be built.
+.if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include)
+CFLAGS+=               -I${OSX_SDK_PATH:Q}/usr/include
+.endif
+
+PLIST_VARS+=   bsddb dll nis no-nis
+.if ${OPSYS} == "IRIX"
+.  if ${ABI} == "64"
+PLIST.no-nis=  yes
+.  else
+PLIST.nis=     yes
+.  endif
+.else
+.  include "../../mk/bdb.buildlink3.mk"
+MAKE_ENV+=     PY_BDB_TYPE=${BDB_TYPE}
+MAKE_ENV+=     PY_BDB_INCDIRS=${BUILDLINK_INCDIRS.${BDB_TYPE}:S,^,${BDBBASE}/,:Q}
+MAKE_ENV+=     PY_BDB_LIBDIRS=${BDBBASE}/lib
+PLIST.bsddb=   yes
+PLIST.dll=     yes
+.  if ${OPSYS} != "NetBSD" || exists(/usr/bin/ypcat)
+PLIST.nis=     yes
+.  else
+PLIST.no-nis=  yes
+.  endif
+.endif
+
+.if defined(BUILDLINK_TRANSFORM)
+MAKE_ENV+=     PY_BDB_TRANSFORM=${BUILDLINK_TRANSFORM:Q}
+.endif
+
+PLIST_SUBST+=  PY_VER_SUFFIX=${PY_VER_SUFFIX:Q}
+
+PRINT_PLIST_AWK+=      { gsub(/${PY_PLATNAME}/, "$${PY_PLATNAME}") }
+PRINT_PLIST_AWK+=      { gsub(/python${PY_VER_SUFFIX}/, \
+                               "python$${PY_VER_SUFFIX}") }
+
+TEST_TARGET=   test
+INSTALL_TARGET=        altinstall
+
+REPLACE_INTERPRETER+=  py36
+REPLACE.py36.old=      .*python[^ ]*
+REPLACE.py36.new=      ${PREFIX}/bin/python${PY_VER_SUFFIX}
+REPLACE_FILES.py36=    Lib/*.py Lib/*/*.py Lib/*/*/*.py Lib/*/*/*/*.py
+
+SUBST_CLASSES+=                findlib
+SUBST_MESSAGE.findlib= Fixing find_library_file on Darwin.
+SUBST_STAGE.findlib=   pre-configure
+SUBST_FILES.findlib=   Lib/distutils/unixccompiler.py
+SUBST_SED.findlib=     -e 's,/usr/local,${PREFIX},'
+
+# XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib
+# Testing:
+# >>> from ctypes.util import find_library
+# >>> find_library("m")
+# 'libm.so.0'
+# >>> find_library("crypto")
+# 'libcrypto.so.11'
+# >>> find_library("GL")
+# 'libGL.so.2'
+# >>> find_library("curl")
+# 'libcurl.so.4'
+
+SUBST_CLASSES+=                pfindlib
+SUBST_MESSAGE.pfindlib=        Fixing find_library() on POSIX-like (excluding Darwin) systems.
+SUBST_STAGE.pfindlib=  pre-configure
+SUBST_FILES.pfindlib=  Lib/ctypes/util.py
+SUBST_SED.pfindlib=    -e 's!\(-Wl,-t -o\)!${COMPILER_RPATH_FLAG}${PREFIX}/lib -L${PREFIX}/lib \1!'
+
+.include "options.mk"
+
+SUBST_CLASSES+=                sslbase
+SUBST_MESSAGE.sslbase= Fixing OpenSSL base directory to find header file.
+SUBST_STAGE.sslbase=   pre-configure
+SUBST_FILES.sslbase=   setup.py
+SUBST_VARS.sslbase=    SSLBASE
+
+CHECK_INTERPRETER_SKIP=        lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc
+
+# Avoid error: Cannot generate ./Include/opcode.h, python not found !
+post-configure:
+       touch ${WRKSRC}/Include/opcode.h
+
+.if ${OPSYS} == "HPUX"
+post-install:
+       ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython3.6.sl \
+               ${DESTDIR}${PREFIX}/lib/libpython3.6.sl.1.0
+.endif
+
+BUILDLINK_DEPMETHOD.readline=          build
+
+.include "../../archivers/bzip2/buildlink3.mk"
+.include "../../archivers/xz/buildlink3.mk"
+.include "../../devel/gettext-lib/buildlink3.mk"
+.include "../../devel/libffi/buildlink3.mk"
+.include "../../devel/readline/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../security/openssl/buildlink3.mk"
+.include "../../mk/dlopen.buildlink3.mk"
+.include "../../mk/oss.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r c49b18ec28c3 -r 65ef1e365d25 lang/python36/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/python36/PLIST       Sun Jan 01 14:34:26 2017 +0000
@@ -0,0 +1,5147 @@
+@comment $NetBSD: PLIST,v 1.1 2017/01/01 14:34:27 adam Exp $
+bin/2to3-${PY_VER_SUFFIX}
+bin/pydoc${PY_VER_SUFFIX}
+bin/python${PY_VER_SUFFIX}
+bin/python${PY_VER_SUFFIX}-config
+bin/pyvenv-${PY_VER_SUFFIX}
+include/python${PY_VER_SUFFIX}/Python-ast.h
+include/python${PY_VER_SUFFIX}/Python.h
+include/python${PY_VER_SUFFIX}/abstract.h
+include/python${PY_VER_SUFFIX}/accu.h
+include/python${PY_VER_SUFFIX}/asdl.h



Home | Main Index | Thread Index | Old Index