NAME
python-module
—
lang/python port module
DESCRIPTION
This manual page documents the behavior of setting
MODULE=lang/python
in the
ports(7) tree.
Sets MODPY_VERSION
,
MODPY_BIN
, MODPY_INCDIR
,
MODPY_LIBDIR
, MODPY_SITEPKG
,
MODPY_SETUP
, MODPY_TEST_DIR
,
MODPY_TEST_LOCALE
,
MODPY_WANTLIB
,
MODPY_LIB_DEPENDS
,
MODPY_RUN_DEPENDS
,
MODPY_TEST_DEPENDS
,
MODPY_BUILD_DEPENDS
, and
MODPY_ADJ_FILES
. Appends to
RUN_DEPENDS
unless
MODPY_RUNDEP
is set to No. Appends to
BUILD_DEPENDS
unless
MODPY_BUILDDEP
is set to No or
NO_BUILD
is set to Yes. Appends to
TEST_DEPENDS
if MODPY_PYTEST
is set to Yes unless MODPY_TESTDEP
is set to No.
Appends MODPY_TEST_LOCALE
to
TEST_ENV
. Changes to the directory specified in
MODPY_TEST_DIR
, by default WRKSRC, before running
tests. MODPY_VERSION
is the default version used by
all python modules. Ports which use the setuptools module should set
MODPY_SETUPTOOLS
to Yes. Ports which use the pytest
module should set MODPY_PYTEST
to Yes. Arguments can
be passed to pytest during test
with
MODPY_PYTEST_ARGS
. All ports that generate egg-info
files should set MODPY_EGG_VERSION
to the version
string used by the
setup
()
function in the port's setup.py. Arguments can be
passed to setup.py during configure
with
MODPY_SETUP_ARGS
. Extra arguments to the build and
install commands can be passed via
MODPY_DISTUTILS_BUILDARGS
and
MODPY_DISTUTILS_INSTALLARGS
. If any files have a
python shebang line which needs to be replaced using MODPY_BIN, list them in
MODPY_ADJ_FILES
. These are prefixed with WRKSRC and
replaced automatically at the end of pre-configure
.
Also affects CATEGORIES
,
MAKE_ENV
, CONFIGURE_ENV
, and
SUBST_VARS
. May affect the
test
target. If MODPY_PI
is
set to Yes it will set HOMEPAGE
and
MASTER_SITES
. The subdirectory can be overridden
with MODPY_PI_DIR
.
Python 2.x places .pyc files in the same directory as the
associated .py file. Python 3.x places these in a separate __pycache__
directory and uses an additional suffix. In some cases, an ABI tag is also
used for names of compiled extensions. The python module defines variables
to allow a single PLIST to be used for both versions. Generate or update the
PLIST using the python3 FLAVOR
, then edit it to
prefix any lines creating MODPY_PYCACHE
directories
with MODPY_COMMENT
. As python2 and python3 packages
should permit being installed together, it may be necessary to suffix names
of common binaries or directories, or split common files into a subpackage.
If updating the PLIST without using the python3 flavor, take care not to
remove ${MODPY_PYCACHE}, ${MODPY_PYC_MAGIC_TAG}, or ${MODPY_ABI_TAG}
variables from the PLIST.