Changeset View
Changeset View
Standalone View
Standalone View
head/Mk/Uses/python.mk
Show All 16 Lines | |||||
# * -<maximum-version> | # * -<maximum-version> | ||||
# | # | ||||
# Examples: | # Examples: | ||||
# | # | ||||
# USES=python:2.7 # Supports Python 2.7 Only | # USES=python:2.7 # Supports Python 2.7 Only | ||||
# USES=python:3.6+ # Supports Python 3.6 or later | # USES=python:3.6+ # Supports Python 3.6 or later | ||||
# USES=python:3.6-3.9 # Supports Python 3.6 to 3.9 | # USES=python:3.6-3.9 # Supports Python 3.6 to 3.9 | ||||
# USES=python:-3.8 # Supports Python up to 3.8 | # USES=python:-3.8 # Supports Python up to 3.8 | ||||
# USES=python # Supports any/all Python versions | # USES=python # Supports 3.6+ | ||||
# | # | ||||
# NOTE: <version-spec> should be as specific as possible, matching the versions | # NOTE: <version-spec> should be as specific as possible, matching the versions | ||||
# upstream declares support for, without being incorrect. In particular, | # upstream declares support for, without being incorrect. In particular, | ||||
# USES=python *without* a <version-spec> means any and all past or future | # USES=python *without* a <version-spec> means 3.6+, | ||||
# versions, including unreleased versions, which is probably incorrect. | # including unreleased versions, which is probably incorrect. | ||||
# | # | ||||
# Not specifying a <version-spec> should only be used when a more specific | # Not specifying a <version-spec> should only be used when a more specific | ||||
# <version-spec> cannot be specified due to syntax limitations, for | # <version-spec> cannot be specified due to syntax limitations, for | ||||
# example: 2.7,3.4-3.6, but even in this case, X.Y+ (2.7+), or -X.Y (-3.6) | # example: 2.7,3.4-3.6, but even in this case, X.Y+ (2.7+), or -X.Y (-3.6) | ||||
# is preferred and likely more correct. | # is preferred and likely more correct. | ||||
# | # | ||||
# patch Python is needed at patch time. Adds dependency to PATCH_DEPENDS. | # patch Python is needed at patch time. Adds dependency to PATCH_DEPENDS. | ||||
# build Python is needed at build time. Adds dependency to BUILD_DEPENDS. | # build Python is needed at build time. Adds dependency to BUILD_DEPENDS. | ||||
▲ Show 20 Lines • Show All 289 Lines • ▼ Show 20 Lines | |||||
DEV_WARNING+= "lang/python27 reached End of Life and will be removed on 2020-12-31, consider converting to a modern version of python" | DEV_WARNING+= "lang/python27 reached End of Life and will be removed on 2020-12-31, consider converting to a modern version of python" | ||||
.elif ${_PYTHON_ARGS} == 2 | .elif ${_PYTHON_ARGS} == 2 | ||||
DEV_ERROR+= "USES=python:2 is no longer supported, use USES=python:2.7" | DEV_ERROR+= "USES=python:2 is no longer supported, use USES=python:2.7" | ||||
.elif ${_PYTHON_ARGS} == 3 | .elif ${_PYTHON_ARGS} == 3 | ||||
DEV_ERROR+= "USES=python:3 is no longer supported, use USES=python:3.6+ or an appropriate version range" | DEV_ERROR+= "USES=python:3 is no longer supported, use USES=python:3.6+ or an appropriate version range" | ||||
.endif # ${_PYTHON_ARGS} == 2.7 | .endif # ${_PYTHON_ARGS} == 2.7 | ||||
_PYTHON_VERSION:= ${PYTHON_DEFAULT} | _PYTHON_VERSION:= ${PYTHON_DEFAULT} | ||||
.if empty(_PYTHON_ARGS) | |||||
_PYTHON_ARGS= 3.6+ | |||||
.endif | |||||
# Validate Python version whether it meets the version restriction. | # Validate Python version whether it meets the version restriction. | ||||
_PYTHON_VERSION_CHECK:= ${_PYTHON_ARGS:C/^([1-9]\.[0-9])$/\1-\1/} | _PYTHON_VERSION_CHECK:= ${_PYTHON_ARGS:C/^([1-9]\.[0-9])$/\1-\1/} | ||||
_PYTHON_VERSION_MINIMUM_TMP:= ${_PYTHON_VERSION_CHECK:C/([1-9]\.[0-9])[-+].*/\1/} | _PYTHON_VERSION_MINIMUM_TMP:= ${_PYTHON_VERSION_CHECK:C/([1-9]\.[0-9])[-+].*/\1/} | ||||
_PYTHON_VERSION_MINIMUM:= ${_PYTHON_VERSION_MINIMUM_TMP:M[1-9].[0-9]} | _PYTHON_VERSION_MINIMUM:= ${_PYTHON_VERSION_MINIMUM_TMP:M[1-9].[0-9]} | ||||
_PYTHON_VERSION_MAXIMUM_TMP:= ${_PYTHON_VERSION_CHECK:C/.*-([1-9]\.[0-9])/\1/} | _PYTHON_VERSION_MAXIMUM_TMP:= ${_PYTHON_VERSION_CHECK:C/.*-([1-9]\.[0-9])/\1/} | ||||
_PYTHON_VERSION_MAXIMUM:= ${_PYTHON_VERSION_MAXIMUM_TMP:M[1-9].[0-9]} | _PYTHON_VERSION_MAXIMUM:= ${_PYTHON_VERSION_MAXIMUM_TMP:M[1-9].[0-9]} | ||||
▲ Show 20 Lines • Show All 385 Lines • Show Last 20 Lines |