Bug 256150 - lang/python310: Interpreted object-oriented programming language
Summary: lang/python310: Interpreted object-oriented programming language
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dmitry Marakasov
URL: https://reviews.freebsd.org/D30475
Keywords: feature, needs-qa
Depends on:
Blocks:
 
Reported: 2021-05-25 14:26 UTC by Dmitry Marakasov
Modified: 2021-07-23 13:46 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback? (python)


Attachments
Patch (512.72 KB, patch)
2021-05-25 14:26 UTC, Dmitry Marakasov
no flags Details | Diff
Patch (1.28 KB, patch)
2021-05-26 16:20 UTC, Dmitry Marakasov
no flags Details | Diff
Patch (512.72 KB, patch)
2021-05-26 16:21 UTC, Dmitry Marakasov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Marakasov freebsd_committer 2021-05-25 14:26:32 UTC
Created attachment 225249 [details]
Patch

Add lang/python310 at version 3.10.0b1

Changes to python39 are minimal (plus some removed patches which were already upstreamed):

--- python39/Makefile	2021-05-25 16:55:44.272237000 +0300
+++ python310/Makefile	2021-05-25 16:58:41.519315000 +0300
@@ -3,13 +3,13 @@
 PORTNAME=	python
 DISTVERSION=	${PYTHON_DISTVERSION}
 CATEGORIES=	lang python
-MASTER_SITES=	PYTHON/ftp/python/${DISTVERSION}
+MASTER_SITES=	PYTHON/ftp/python/3.10.0
 PKGNAMESUFFIX=	${PYTHON_SUFFIX}
 DISTNAME=	Python-${DISTVERSION}
 DIST_SUBDIR=	python
 
 MAINTAINER=	python@FreeBSD.org
-COMMENT=	Interpreted object-oriented programming language
+COMMENT=	Interpreted object-oriented programming language (beta version)
 
 LICENSE=	PSFL
 
@@ -46,7 +46,7 @@
 PLIST_SUB=		ABI=${ABIFLAGS} \
 			XY=${PYTHON_SUFFIX} \
 			XYDOT=${PYTHON_VER} \
-			XYZDOT=${DISTVERSION} \
+			XYZDOT=${DISTVERSION:C/[a-z].*//} \
 			OSMAJOR=${OSVERSION:C/([0-9]*)[0-9]{5}/\1/}		# For plat-freebsd* in pkg-plist. https://bugs.python.org/issue19554
 
 OPTIONS_DEFINE=		DEBUG IPV6 LIBFFI LIBMPDEC NLS PYMALLOC
@@ -116,6 +116,12 @@
 DISABLED_EXTENSIONS+=	nis
 .else
 PLIST_SUB+=	NO_NIS=""
+.endif
+
+.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1200000
+PLIST_SUB+=	NEWOPENSSL="@comment "
+.else
+PLIST_SUB+=	NEWOPENSSL=""
 .endif
 
 post-patch:
diff -ruN python39/Makefile.version python310/Makefile.version
--- python39/Makefile.version	2021-05-25 16:55:44.272304000 +0300
+++ python310/Makefile.version	2021-05-25 16:58:40.856247000 +0300
@@ -2,4 +2,4 @@
 
 # Do not forget to update python documentation (lang/python-doc-*)
 # Run "make -C lang/python-doc-html makesum"
-PYTHON_DISTVERSION=	3.9.5
+PYTHON_DISTVERSION=	3.10.0b1
Comment 1 Dmitry Marakasov freebsd_committer 2021-05-26 16:20:09 UTC
Created attachment 225282 [details]
Patch
Comment 2 Dmitry Marakasov freebsd_committer 2021-05-26 16:21:01 UTC
Created attachment 225285 [details]
Patch
Comment 3 commit-hook freebsd_committer 2021-07-14 20:19:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=930c93129234e5ed3f67be1b8795a5a20e2745db

commit 930c93129234e5ed3f67be1b8795a5a20e2745db
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2021-04-08 22:31:49 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2021-07-14 20:14:55 +0000

    lang/python310: add python 3.10.0.beta4

    PR:             256150
    Approved by:    maintainer timeout (python@, 1 month)
    Differential Revision:  https://reviews.freebsd.org/D30475

 Mk/Uses/python.mk                                  |    2 +-
 Mk/bsd.default-versions.mk                         |    4 +-
 lang/Makefile                                      |    1 +
 lang/python310/Makefile (new)                      |  159 +
 lang/python310/Makefile.version (new)              |    5 +
 lang/python310/distinfo (new)                      |    3 +
 ...tch-Lib_distutils_command_install__lib.py (new) |   41 +
 ...Lib_distutils_tests_test__install__lib.py (new) |   33 +
 lang/python310/files/patch-Makefile.pre.in (new)   |   65 +
 .../files/patch-Misc__python-config.sh.in (new)    |   11 +
 lang/python310/files/pkg-message.in (new)          |   12 +
 lang/python310/pkg-descr (new)                     |    4 +
 lang/python310/pkg-plist (new)                     | 7480 ++++++++++++++++++++
 13 files changed, 7817 insertions(+), 3 deletions(-)
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-17 02:47:08 UTC
^Triage: Assign the committer that resolved

py-numpy fails (pkg-fallout) for python310, several of:

numpy/core/src/multiarray/scalartypes.c.src:3244:81: error: too few arguments to function call, expected 2, have 1
    return _Py_HashDouble(npy_half_to_double(((PyHalfScalarObject *)obj)->obval));
Comment 5 Dmitry Marakasov freebsd_committer 2021-07-19 17:18:39 UTC
This PR relates to python 3.10 import. Issues with ports failing with 3.10 may be addressed in separate PRs.
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-21 07:45:00 UTC
(In reply to Dmitry Marakasov from comment #5)

Dmitry this is a new failure *due* to the import of the port. Just set numpy to USES=python:-3.9 or add BROKEN for it.
Comment 7 Thierry Thomas freebsd_committer 2021-07-21 07:51:54 UTC
(In reply to Kubilay Kocak from comment #6)

What about upgrading py-numpy?

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251626
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-21 08:02:30 UTC
(In reply to Thierry Thomas from comment #7)

The key is that people take responsibility for their changes. Everyone's all happy being motivated to push their changes through (even in the absence of review), but not the follow-up. That's not how things work.

In the absence of of a numpy update (which I don't believe Dimitry should need to take responsibility for), BROKEN or -3.9.
Comment 9 Dmitry Marakasov freebsd_committer 2021-07-23 13:46:15 UTC
(In reply to Kubilay Kocak from comment #6)
> Dmitry this is a new failure *due* to the import of the port. Just set numpy to USES=python:-3.9 or add BROKEN for it.

Would you please explain where and how you've experienced this failure, as AFAIK we don't build packages for non-default python flavors.

Regardless, keeping supported python version range up to date is port maintainer's responsibility (I'd be happy to join python@ which I already volunteered for on irc and/or maillist without any response, and help take care of it). A lot of packages are expected to fail with new (and especially beta) python version, and it should not be a show stopper for python import as long as it's not used by default.