pkgsrc/lang/python310/Makefile
adam c4ef660135 python310 py310-html-docs: updated to 3.10.6
Python 3.10.6 final
Release date: 2022-08-01

Security
gh-87389: http.server: Fix an open redirection vulnerability in the HTTP server when an URI path starts with //. Vulnerability discovered, and initial fix proposed, by Hamza Avvan.
gh-92888: Fix memoryview use after free when accessing the backing buffer in certain cases.
Core and Builtins
gh-95355: _PyPegen_Parser_New now properly detects token memory allocation errors. Patch by Honglin Zhu.
gh-94938: Fix error detection in some builtin functions when keyword argument name is an instance of a str subclass with overloaded __eq__ and __hash__. Previously it could cause SystemError or other undesired behavior.
gh-94949: ast.parse() will no longer parse parenthesized context managers when passed feature_version less than (3, 9). Patch by Shantanu Jain.
gh-94947: ast.parse() will no longer parse assignment expressions when passed feature_version less than (3, 8). Patch by Shantanu Jain.
gh-94869: Fix the column offsets for some expressions in multi-line f-strings ast nodes. Patch by Pablo Galindo.
gh-91153: Fix an issue where a bytearray item assignment could crash if it’s resized by the new value’s __index__() method.
gh-94329: Compile and run code with unpacking of extremely large sequences (1000s of elements). Such code failed to compile. It now compiles and runs correctly.
gh-94360: Fixed a tokenizer crash when reading encoded files with syntax errors from stdin with non utf-8 encoded text. Patch by Pablo Galindo
gh-94192: Fix error for dictionary literals with invalid expression as value.
gh-93964: Strengthened compiler overflow checks to prevent crashes when compiling very large source files.
gh-93671: Fix some exponential backtrace case happening with deeply nested sequence patterns in match statements. Patch by Pablo Galindo
gh-93021: Fix the __text_signature__ for __get__() methods implemented in C. Patch by Jelle Zijlstra.
gh-92930: Fixed a crash in _pickle.c from mutating collections during __reduce__ or persistent_id.
gh-92914: Always round the allocated size for lists up to the nearest even number.
gh-92858: Improve error message for some suites with syntax error before ‘:’
Library
gh-95339: Update bundled pip to 22.2.1.

gh-95045: Fix GC crash when deallocating _lsprof.Profiler by untracking it before calling any callbacks. Patch by Kumar Aditya.

gh-95087: Fix IndexError in parsing invalid date in the email module.

gh-95199: Upgrade bundled setuptools to 63.2.0.

gh-95194: Upgrade bundled pip to 22.2.

gh-93899: Fix check for existence of os.EFD_CLOEXEC, os.EFD_NONBLOCK and os.EFD_SEMAPHORE flags on older kernel versions where these flags are not present. Patch by Kumar Aditya.

gh-95166: Fix concurrent.futures.Executor.map() to cancel the currently waiting on future on an error - e.g. TimeoutError or KeyboardInterrupt.

gh-93157: Fix fileinput module didn’t support errors option when inplace is true.

gh-94821: Fix binding of unix socket to empty address on Linux to use an available address from the abstract namespace, instead of “0”.

gh-94736: Fix crash when deallocating an instance of a subclass of _multiprocessing.SemLock. Patch by Kumar Aditya.

gh-94637: SSLContext.set_default_verify_paths() now releases the GIL around SSL_CTX_set_default_verify_paths call. The function call performs I/O and CPU intensive work.

gh-94510: Re-entrant calls to sys.setprofile() and sys.settrace() now raise RuntimeError. Patch by Pablo Galindo.

gh-92336: Fix bug where linecache.getline() fails on bad files with UnicodeDecodeError or SyntaxError. It now returns an empty string as per the documentation.

gh-89988: Fix memory leak in pickle.Pickler when looking up dispatch_table. Patch by Kumar Aditya.

gh-94254: Fixed types of struct module to be immutable. Patch by Kumar Aditya.

gh-94245: Fix pickling and copying of typing.Tuple[()].

gh-94207: Made _struct.Struct GC-tracked in order to fix a reference leak in the _struct module.

gh-94101: Manual instantiation of ssl.SSLSession objects is no longer allowed as it lead to misconfigured instances that crashed the interpreter when attributes where accessed on them.

gh-84753: inspect.iscoroutinefunction(), inspect.isgeneratorfunction(), and inspect.isasyncgenfunction() now properly return True for duck-typed function-like objects like instances of unittest.mock.AsyncMock.

This makes inspect.iscoroutinefunction() consistent with the behavior of asyncio.iscoroutinefunction(). Patch by Mehdi ABAAKOUK.

gh-83499: Fix double closing of file description in tempfile.

gh-79512: Fixed names and __module__ value of weakref classes ReferenceType, ProxyType, CallableProxyType. It makes them pickleable.

gh-90494: copy.copy() and copy.deepcopy() now always raise a TypeError if __reduce__() returns a tuple with length 6 instead of silently ignore the 6th item or produce incorrect result.

gh-90549: Fix a multiprocessing bug where a global named resource (such as a semaphore) could leak when a child process is spawned (as opposed to forked).

gh-79579: sqlite3 now correctly detects DML queries with leading comments. Patch by Erlend E. Aasland.

gh-93421: Update sqlite3.Cursor.rowcount when a DML statement has run to completion. This fixes the row count for SQL queries like UPDATE ... RETURNING. Patch by Erlend E. Aasland.

gh-91810: Suppress writing an XML declaration in open files in ElementTree.write() with encoding='unicode' and xml_declaration=None.

gh-93353: Fix the importlib.resources.as_file() context manager to remove the temporary file if destroyed late during Python finalization: keep a local reference to the os.remove() function. Patch by Victor Stinner.

gh-83658: Make multiprocessing.Pool raise an exception if maxtasksperchild is not None or a positive int.

gh-74696: shutil.make_archive() no longer temporarily changes the current working directory during creation of standard .zip or tar archives.

gh-91577: Move imports in SharedMemory methods to module level so that they can be executed late in python finalization.

bpo-47231: Fixed an issue with inconsistent trailing slashes in tarfile longname directories.

bpo-46755: In QueueHandler, clear stack_info from LogRecord to prevent stack trace from being written twice.

bpo-46053: Fix OSS audio support on NetBSD.

bpo-46197: Fix ensurepip environment isolation for subprocess running pip.

bpo-45924: Fix asyncio incorrect traceback when future’s exception is raised multiple times. Patch by Kumar Aditya.

bpo-34828: sqlite3.Connection.iterdump() now handles databases that use AUTOINCREMENT in one or more tables.
Documentation
gh-94321: Document the PEP 246 style protocol type sqlite3.PrepareProtocol.
gh-86128: Document a limitation in ThreadPoolExecutor where its exit handler is executed before any handlers in atexit.
gh-61162: Clarify sqlite3 behavior when Using the connection as a context manager.
gh-87260: Align sqlite3 argument specs with the actual implementation.
gh-86986: The minimum Sphinx version required to build the documentation is now 3.2.
gh-88831: Augmented documentation of asyncio.create_task(). Clarified the need to keep strong references to tasks and added a code snippet detailing how to to this.
bpo-47161: Document that pathlib.PurePath does not collapse initial double slashes because they denote UNC paths.
Tests
gh-95280: Fix problem with test_ssl test_get_ciphers on systems that require perfect forward secrecy (PFS) ciphers.

gh-95212: Make multiprocessing test case test_shared_memory_recreate parallel-safe.

gh-91330: Added more tests for dataclasses to cover behavior with data descriptor-based fields.

# Write your Misc/NEWS entry below. It should be a simple ReST paragraph. # Don’t start with “- Issue #<n>: ” or “- gh-issue-<n>: ” or that sort of stuff. ###########################################################################

gh-94208: test_ssl is now checking for supported TLS version and protocols in more tests.

gh-93951: In test_bdb.StateTestCase.test_skip, avoid including auxiliary importers.

gh-93957: Provide nicer error reporting from subprocesses in test_venv.EnsurePipTest.test_with_pip.

gh-57539: Increase calendar test coverage for calendar.LocaleTextCalendar.formatweekday().

gh-92886: Fixing tests that fail when running with optimizations (-O) in test_zipimport.py

bpo-47016: Create a GitHub Actions workflow for verifying bundled pip and setuptools. Patch by Illia Volochii and Adam Turner.
Build
gh-94841: Fix the possible performance regression of PyObject_Free() compiled with MSVC version 1932.
bpo-45816: Python now supports building with Visual Studio 2022 (MSVC v143, VS Version 17.0). Patch by Jeremiah Vivian.
Windows
gh-90844: Allow virtual environments to correctly launch when they have spaces in the path.
gh-92841: asyncio no longer throws RuntimeError: Event loop is closed on interpreter exit after asynchronous socket activity. Patch by Oleg Iarygin.
bpo-42658: Support native Windows case-insensitive path comparisons by using LCMapStringEx instead of str.lower() in ntpath.normcase(). Add LCMapStringEx to the _winapi module.
IDLE
gh-95511: Fix the Shell context menu copy-with-prompts bug of copying an extra line when one selects whole lines.
gh-95471: In the Edit menu, move Select All and add a new separator.
gh-95411: Enable using IDLE’s module browser with .pyw files.
gh-89610: Add .pyi as a recognized extension for IDLE on macOS. This allows opening stub files by double clicking on them in the Finder.
Tools/Demos
gh-94538: Fix Argument Clinic output to custom file destinations. Patch by Erlend E. Aasland.
gh-94430: Allow parameters named module and self with custom C names in Argument Clinic. Patch by Erlend E. Aasland
C API
gh-94930: Fix SystemError raised when PyArg_ParseTupleAndKeywords() is used with # in (...) but without PY_SSIZE_T_CLEAN defined.
gh-94864: Fix PyArg_Parse* with deprecated format units “u” and “Z”. It returned 1 (success) when warnings are turned into exceptions.
2022-08-02 18:27:22 +00:00

236 lines
8.3 KiB
Makefile

# $NetBSD: Makefile,v 1.15 2022/08/02 18:27:22 adam Exp $
.include "dist.mk"
PKGNAME= python310-${PY_DISTVERSION}
CATEGORIES= lang python
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://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=310
PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.pyc$$/ {
PRINT_PLIST_AWK+= sub(/__pycache__\//, "")
PRINT_PLIST_AWK+= sub(/\.cpython-310/, "")}
PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.opt-1.pyc$$/ {
PRINT_PLIST_AWK+= sub(/.opt-[12].pyc$$/, ".pyo")}
USE_LANGUAGES= c c++
USE_TOOLS+= pkg-config
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --enable-shared
CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl}
CONFIGURE_ARGS+= --with-system-ffi
CONFIGURE_ARGS+= --without-ensurepip
CONFIGURE_ENV+= OPT=${CFLAGS:M*:Q}
CONFIGURE_ENV+= ac_cv_path_mkdir=${TOOLS_PATH.mkdir}
PKGCONFIG_OVERRIDE+= Misc/python.pc.in Misc/python-embed.pc.in
PTHREAD_OPTS+= require
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.prefs.mk"
.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
TOOL_DEPENDS+= ${PKGNAME}:../../${PKGPATH}
# XXX copied from ../../lang/python/pyversion.mk to avoid including it
# XXX should use NATIVE_PREFIX but we don't have that
CONFIGURE_ARGS+= PYTHON_FOR_BUILD=${PREFIX:Q}/bin/python3.10
CONFIGURE_ARGS+= MACHDEP=${PY_PLATNAME}
CONFIGURE_ARGS+= \
_PYTHON_HOST_PLATFORM=${LOWER_OPSYS}-${MACHINE_GNU_ARCH}
CONFIGURE_ARGS+= ac_sys_system=${OPSYS}
. if ${OPSYS} == "OSF1"
CONFIGURE_ARGS+= ac_cv_buggy_getaddrinfo=true
. else
CONFIGURE_ARGS+= ac_cv_buggy_getaddrinfo=false
. endif
CONFIGURE_ARGS.NetBSD+= ac_cv_file__dev_ptmx=yes
CONFIGURE_ARGS.NetBSD+= ac_cv_file__dev_ptc=no
MAKE_ENV+= \
_PYTHON_HOST_PLATFORM=${LOWER_OPSYS}-${MACHINE_GNU_ARCH}
MAKE_ENV+= _PYTHON_PROJECT_BASE=${WRKSRC:Q}
.endif
# http://bugs.python.org/issue13241
.if !empty(MACHINE_PLATFORM:MDarwin-1[12].*)
PKGSRC_COMPILER= clang
PKG_CC= clang
PKG_CXX= clang++
.endif
# Used in socketmodule.c to determine if a sethostname declaration is required
CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=${OPSYS_VERSION}
LIBS.SunOS+= -lrt # fdatasync()
LIBS.SunOS+= -luuid
.if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100
SUBST_CLASSES+= setup
SUBST_MESSAGE.setup= Replacing crypt with crypt_i
SUBST_STAGE.setup= pre-configure
SUBST_FILES.setup= setup.py
SUBST_SED.setup= -e "s,'crypt','crypt_i',"
.endif
PY_VER_SUFFIX= 3.10
.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}
# 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+= nis
.for incdir in ${_OPSYS_INCLUDE_DIRS}
. if (exists(${incdir}/rpc/rpc.h) || exists(${incdir}/tirpc/rpc/rpc.h))
HAVE_RPC_H= yes
. endif
. if (exists(${incdir}/rpcsvc/yp_prot.h) || exists(${incdir}/nsl/rpcsvc/yp_prot.h))
HAVE_YP_PROT_H= yes
. endif
.endfor
.if (${HAVE_RPC_H:Uno} == yes && ${HAVE_YP_PROT_H:Uno} == yes)
PLIST.nis= yes
.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+= python
REPLACE.python.old= .*python[^ ]*
REPLACE.python.new= ${PREFIX}/bin/python${PY_VER_SUFFIX}
REPLACE_FILES.python+= Lib/base64.py
REPLACE_FILES.python+= Lib/cProfile.py
REPLACE_FILES.python+= Lib/cgi.py
REPLACE_FILES.python+= Lib/encodings/rot_13.py
REPLACE_FILES.python+= Lib/idlelib/pyshell.py
REPLACE_FILES.python+= Lib/keyword.py
REPLACE_FILES.python+= Lib/lib2to3/pgen2/token.py
REPLACE_FILES.python+= Lib/lib2to3/tests/data/different_encoding.py
REPLACE_FILES.python+= Lib/lib2to3/tests/data/false_encoding.py
REPLACE_FILES.python+= Lib/lib2to3/tests/pytree_idempotency.py
REPLACE_FILES.python+= Lib/pdb.py
REPLACE_FILES.python+= Lib/platform.py
REPLACE_FILES.python+= Lib/profile.py
REPLACE_FILES.python+= Lib/pydoc.py
REPLACE_FILES.python+= Lib/quopri.py
REPLACE_FILES.python+= Lib/smtpd.py
REPLACE_FILES.python+= Lib/smtplib.py
REPLACE_FILES.python+= Lib/tabnanny.py
REPLACE_FILES.python+= Lib/tarfile.py
REPLACE_FILES.python+= Lib/test/bisect_cmd.py
REPLACE_FILES.python+= Lib/test/crashers/recursive_call.py
REPLACE_FILES.python+= Lib/test/curses_tests.py
REPLACE_FILES.python+= Lib/test/re_tests.py
REPLACE_FILES.python+= Lib/test/regrtest.py
REPLACE_FILES.python+= Lib/timeit.py
REPLACE_FILES.python+= Lib/trace.py
REPLACE_FILES.python+= Lib/turtledemo/__main__.py
REPLACE_FILES.python+= Lib/turtledemo/bytedesign.py
REPLACE_FILES.python+= Lib/turtledemo/clock.py
REPLACE_FILES.python+= Lib/turtledemo/forest.py
REPLACE_FILES.python+= Lib/turtledemo/fractalcurves.py
REPLACE_FILES.python+= Lib/turtledemo/lindenmayer.py
REPLACE_FILES.python+= Lib/turtledemo/minimal_hanoi.py
REPLACE_FILES.python+= Lib/turtledemo/paint.py
REPLACE_FILES.python+= Lib/turtledemo/peace.py
REPLACE_FILES.python+= Lib/turtledemo/penrose.py
REPLACE_FILES.python+= Lib/turtledemo/planet_and_moon.py
REPLACE_FILES.python+= Lib/turtledemo/sorting_animate.py
REPLACE_FILES.python+= Lib/turtledemo/tree.py
REPLACE_FILES.python+= Lib/turtledemo/yinyang.py
REPLACE_FILES.python+= Lib/uu.py
REPLACE_FILES.python+= Lib/webbrowser.py
REPLACE_SH+= Misc/python-config.sh.in
# XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib
# Test: python -c 'from ctypes.util import find_library; print(find_library("ffi"));'
SUBST_CLASSES+= findlib
SUBST_MESSAGE.findlib= Fixing find_library().
SUBST_STAGE.findlib= pre-configure
SUBST_FILES.findlib= Lib/ctypes/macholib/dyld.py
SUBST_FILES.findlib+= Lib/ctypes/util.py
SUBST_FILES.findlib+= Lib/distutils/unixccompiler.py
SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},'
SUBST_SED.findlib+= -e "s!\('-Wl,-t'\)!'${COMPILER_RPATH_FLAG}${PREFIX}/lib', '-L${PREFIX}/lib', \1!"
SUBST_NOOP_OK.findlib= yes
SUBST_CLASSES+= pkgversion
SUBST_STAGE.pkgversion= pre-configure
SUBST_FILES.pkgversion= Lib/lib2to3/pgen2/driver.py
SUBST_VARS.pkgversion= PKGVERSION_NOREV
.include "options.mk"
CHECK_INTERPRETER_SKIP= lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc
CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_z64
CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_zip
CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/header.sh
# contain CONFIGURE_ARGS and CONFIGURE_ENV
CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/_sysconfigdata*
CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/__pycache__/_sysconfigdata*
CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/config-${PY_VER_SUFFIX}/Makefile
# Avoid error: Cannot generate ./Include/opcode.h, python not found !
post-configure:
touch ${WRKSRC}/Include/opcode.h
.if ${OPSYS} == "HPUX"
post-install: hpux-postinstall
.PHONY: hpux-postinstall
hpux-postinstall:
${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython3.10.sl \
${DESTDIR}${PREFIX}/lib/libpython3.10.sl.1.0
.endif
INSTALLATION_DIRS+= lib/python${PY_VER_SUFFIX}/site-packages
pre-install: setuptools-preinstall
.PHONY: setuptools-preinstall
setuptools-preinstall:
${INSTALL_DATA} ${.CURDIR}/../../devel/py-setuptools/files/_distutils_system_mod \
${DESTDIR}${PREFIX}/lib/python${PY_VER_SUFFIX}/site-packages/_distutils_system_mod.py
# needed to make devel/py-readline pick up the correct readline implementation
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/libuuid/buildlink3.mk"
.include "../../devel/readline/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"
.include "../../mk/bdb.buildlink3.mk"
.include "../../mk/dlopen.buildlink3.mk"
.include "../../mk/oss.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"