pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/python



Module Name:    pkgsrc
Committed By:   wiz
Date:           Wed Jan 12 08:34:34 UTC 2022

Modified Files:
        pkgsrc/lang/python: egg.mk extension.mk

Log Message:
python: update comments for *.mk

Also, remove PY_NO_EGG support, unused


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 pkgsrc/lang/python/egg.mk
cvs rdiff -u -r1.58 -r1.59 pkgsrc/lang/python/extension.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/python/egg.mk
diff -u pkgsrc/lang/python/egg.mk:1.34 pkgsrc/lang/python/egg.mk:1.35
--- pkgsrc/lang/python/egg.mk:1.34      Sun Jan  9 11:58:15 2022
+++ pkgsrc/lang/python/egg.mk   Wed Jan 12 08:34:34 2022
@@ -1,4 +1,4 @@
-# $NetBSD: egg.mk,v 1.34 2022/01/09 11:58:15 wiz Exp $
+# $NetBSD: egg.mk,v 1.35 2022/01/12 08:34:34 wiz Exp $
 #
 # Common logic to handle Python Eggs
 #
@@ -6,8 +6,9 @@
 .include "../../lang/python/pyversion.mk"
 
 # This file should be included to package python "distributions" which
-# use setuptools to create an egg.  Some distributions use distutils,
-# which creates an egg-info file; those should use distutils.mk
+# use setuptools to create an egg.
+#
+# For wheel (*.whl) support, look at wheel.mk.
 
 EGG_NAME?=     ${DISTNAME:C/-([^0-9])/_\1/g}
 EGG_INFODIR?=  ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info
@@ -15,16 +16,15 @@ EGG_INFODIR?=       ${EGG_NAME}-py${PYVERSSUFF
 PYDISTUTILSPKG=        yes
 PY_PATCHPLIST= yes
 
-# True eggs always have an egg-info directory, and thus there is no
-# PLIST conditional (as in distutils.mk for old versions of python).
-# Note that we substitute EGG_INFODIR rather than EGG_FILE, because
-# the egg information in an egg comprises multiple files in an
+# True eggs always have an egg-info directory egg.mk can also
+# be used for distutils packages, in which case there will be no
 # egg-info directory.
 
-# The PLIST substitution of EGG_NAME is not necessary. However, it
-# is convenient. See lang/ruby/gem.mk and PLIST files for ruby gem
-# packages to understand other examples of this feature in non-python
-# packages.
+# Please note that some packages do not provide this directory
+# with the last setuptools version that supports python 2.7.
+# In this case, the ${EGG_INFODIR} lines in the PLIST need to
+# be prefixed with ${PLIST.py3x} - please always test with both
+# python 2.7 and the current python 3.x default!
 
 PLIST_SUBST+=  EGG_NAME=${EGG_NAME}-py${PYVERSSUFFIX}
 PLIST_SUBST+=  EGG_INFODIR=${EGG_INFODIR}
@@ -37,10 +37,8 @@ PRINT_PLIST_AWK+=    { gsub(/${PYVERSSUFFIX
 
 USE_PKG_RESOURCES?=    no
 
-# py-setuptools depends on a couple py-* packages that need to be installed
-# beforehand. Of course, those can not be built and installed using py-setuptools
-# itself; so use the setuptools version included with python itself for installing
-# them.
+# py-setuptools needs to be bootstrapped from python itself, without using
+# py-setuptools.
 BOOTSTRAP_SETUPTOOLS?= no
 .if ${BOOTSTRAP_SETUPTOOLS} == "yes"
 TOOL_DEPENDS+=         ${PYPKGPREFIX}-expat-[0-9]*:../../textproc/py-expat

Index: pkgsrc/lang/python/extension.mk
diff -u pkgsrc/lang/python/extension.mk:1.58 pkgsrc/lang/python/extension.mk:1.59
--- pkgsrc/lang/python/extension.mk:1.58        Fri Aug 28 00:47:57 2020
+++ pkgsrc/lang/python/extension.mk     Wed Jan 12 08:34:34 2022
@@ -1,15 +1,12 @@
-# $NetBSD: extension.mk,v 1.58 2020/08/28 00:47:57 gutteridge Exp $
+# $NetBSD: extension.mk,v 1.59 2022/01/12 08:34:34 wiz Exp $
 
 .include "../../lang/python/pyversion.mk"
 
-# Packages that are a non-egg distutils extension should set
-# PYDISTUTILSPKG=YES and include this mk file.
-
 # This mk fragment is included to handle packages that create
 # extensions to python, which by definition are those that place files
 # in ${PYSITELIB}.  Extensions can be implemented via setuptools as
-# eggs (see egg.mk), via distutils (confusing, with an egg-info file,
-# even though they are not eggs), or via more ad hoc methods.
+# eggs (see egg.mk), via wheels (see wheel.mk), or via more ad hoc
+# methods.
 
 .if defined(PYDISTUTILSPKG)
 .include "../../mk/bsd.prefs.mk"
@@ -49,18 +46,6 @@ do-test:
 
 .endif
 
-# PY_NO_EGG suppress the installation of the egg info file (and
-# therefore its inclusion in the package).  Python practice is be to
-# use these files to let 'require' verify that python distributions
-# are present, and therefore the default value of PY_NO_EGG=yes causes
-# pkgsrc not to conform to python norms.  The reason for this behavior
-# appears to be that creating egg info files was new in Python 2.5.
-PY_NO_EGG?=            yes
-.if !empty(PY_NO_EGG:M[yY][eE][sS])
-# see python*/patches/patch-Lib_distutils_command_install.py
-INSTALL_ENV+=          PKGSRC_PYTHON_NO_EGG=defined
-.endif
-
 .if defined(PY_PATCHPLIST)
 PLIST_SUBST+=  PYINC=${PYINC} PYLIB=${PYLIB} PYSITELIB=${PYSITELIB}
 PLIST_SUBST+=  PYVERSSUFFIX=${PYVERSSUFFIX}
@@ -69,7 +54,7 @@ PLIST_SUBST+= PYVERSSUFFIX=${PYVERSSUFFI
 # mostly for ALTERNATIVES files
 FILES_SUBST+=  PYVERSSUFFIX=${PYVERSSUFFIX}
 
-# prepare Python>=3.2 bytecode file location change
+# Python>=3.2 bytecode file location change
 # http://www.python.org/dev/peps/pep-3147/
 .if empty(_PYTHON_VERSION:M2?)
 PLIST_AWK+=            -f ${PKGSRCDIR}/lang/python/plist-python.awk
@@ -80,6 +65,10 @@ EARLY_PRINT_PLIST_AWK+=      gsub(/opt-1\.pyc
 EARLY_PRINT_PLIST_AWK+=        gsub(/\.cpython-${_PYTHON_VERSION}/, "")}
 .endif
 
+# For running tests before installation of the package,
+# this is sometimes needed; or setting
+# TEST_ENV+=   PYTHONPATH=${WRKSRC}/build/lib
+
 DISTUTILS_BUILDDIR_IN_TEST_ENV?=       no
 
 .if ${DISTUTILS_BUILDDIR_IN_TEST_ENV} == "yes"



Home | Main Index | Thread Index | Old Index