Hi. We have never provided a default 'python' utility with our packages and for good reasons. That said, I would really like if we could provide a default symlink to the default major versions of python. That is: python2 and python3. The rational behind this is that a lot of upstreams have "fixed" their hardcoded shebangs from #!/usr/bin/python... to #!/usr/bin/env python2 or #!/usr/bin/env python3. This would allow us to drop lots of patches, substitutions and MODPY_ADJ_FILES from our ports tree and make things easier for us in general.
People willing to use another version as the default major are pretty much on their own but that's already the case today since we have substituting everything anyway. I am putting this into a bulk right now... What do you guys think? Index: Makefile.inc =================================================================== RCS file: /cvs/ports/lang/python/Makefile.inc,v retrieving revision 1.123 diff -u -p -u -p -r1.123 Makefile.inc --- Makefile.inc 16 Jul 2017 19:18:59 -0000 1.123 +++ Makefile.inc 2 Nov 2017 13:49:47 -0000 @@ -167,6 +167,12 @@ post-install: ${INSTALL_DATA} ${FILESDIR}/CHANGES.OpenBSD \ ${PREFIX}/share/doc/python${VERSION}/CHANGES.OpenBSD +# add a link to the *default* python versions +.if ${VERSION} == "2.7" || ${VERSION} == "3.6" + cd ${PREFIX} && ln -sf python${VERSION} python${VERSION:R} +.endif + + TEST_TARGET= test TEST_FLAGS= "EXTRATESTOPTS=-w" # Some regress tests write to $HOME Index: 2.7/Makefile =================================================================== RCS file: /cvs/ports/lang/python/2.7/Makefile,v retrieving revision 1.53 diff -u -p -u -p -r1.53 Makefile --- 2.7/Makefile 20 Sep 2017 18:44:48 -0000 1.53 +++ 2.7/Makefile 2 Nov 2017 13:49:47 -0000 @@ -9,6 +9,7 @@ VERSION = 2.7 PATCHLEVEL = .14 SHARED_LIBS = python2.7 0.0 VERSION_SPEC = >=2.7,<2.8 +REVISION = 0 CONFIGURE_ARGS += --with-ensurepip=no Index: 2.7/pkg/PLIST-main =================================================================== RCS file: /cvs/ports/lang/python/2.7/pkg/PLIST-main,v retrieving revision 1.20 diff -u -p -u -p -r1.20 PLIST-main --- 2.7/pkg/PLIST-main 20 Sep 2017 18:44:48 -0000 1.20 +++ 2.7/pkg/PLIST-main 2 Nov 2017 13:49:47 -0000 @@ -14,6 +14,7 @@ bin/pydoc2.7 @comment bin/python-config @comment bin/python2 @comment bin/python2-config +bin/python2 @bin bin/python2.7 bin/python2.7-2to3 bin/python2.7-config Index: 3.6/Makefile =================================================================== RCS file: /cvs/ports/lang/python/3.6/Makefile,v retrieving revision 1.6 diff -u -p -u -p -r1.6 Makefile --- 3.6/Makefile 15 Oct 2017 16:31:45 -0000 1.6 +++ 3.6/Makefile 2 Nov 2017 13:49:47 -0000 @@ -9,6 +9,7 @@ VERSION = 3.6 PATCHLEVEL = .3 SHARED_LIBS = python3.6m 0.0 VERSION_SPEC = >=3.6,<3.7 +REVISION = 0 CONFIGURE_ARGS += --with-ensurepip=no Index: 3.6/pkg/PLIST-main =================================================================== RCS file: /cvs/ports/lang/python/3.6/pkg/PLIST-main,v retrieving revision 1.4 diff -u -p -u -p -r1.4 PLIST-main --- 3.6/pkg/PLIST-main 15 Oct 2017 16:31:45 -0000 1.4 +++ 3.6/pkg/PLIST-main 2 Nov 2017 13:49:47 -0000 @@ -10,6 +10,7 @@ bin/2to3-3.6 bin/pydoc3.6 @comment @bin bin/python3 @comment bin/python3-config +bin/python3 @bin bin/python3.6 bin/python3.6-config @bin bin/python3.6m -- Antoine