<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/14c003c6fae79cb7949b6f08ed3420d682ef5598">https://github.com/macports/macports-ports/commit/14c003c6fae79cb7949b6f08ed3420d682ef5598</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 14c003c6fae79cb7949b6f08ed3420d682ef5598
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Tue Dec 1 13:02:58 2020 +1100
<span style='display:block; white-space:pre;color:#404040;'> python portgroup: add experimental PEP 517 mode
</span>---
_resources/port1.0/group/python-1.0.tcl | 85 +++++++++++++++++++++++++++------
1 file changed, 71 insertions(+), 14 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/python-1.0.tcl b/_resources/port1.0/group/python-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index cb8a3e83bdd..3bba6556095 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/python-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/python-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -23,8 +23,6 @@ use_configure no
</span> # we want the default universal variant added despite not using configure
universal_variant yes
<span style='display:block; white-space:pre;background:#ffe0e0;'>-default build.target {build[python_get_defaults jobs_arg]}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> post-extract {
# Prevent setuptools' easy_install from downloading dependencies
set fs [open $env(HOME)/.pydistutils.cfg w+]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -269,7 +267,7 @@ proc python_set_default_version {option action args} {
</span>
options python.branch python.prefix python.bin python.lib python.libdir \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- python.include python.pkgd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ python.include python.pkgd python.pep517
</span> # for pythonXY, python.branch is X.Y
default python.branch {[string range ${python.version} 0 end-1].[string index ${python.version} end]}
default python.prefix {${frameworks_dir}/Python.framework/Versions/${python.branch}}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -278,13 +276,79 @@ default python.lib {${python.prefix}/Python}
</span> default python.pkgd {${python.prefix}/lib/python${python.branch}/site-packages}
default python.libdir {${python.prefix}/lib/python${python.branch}}
default python.include {[python_get_defaults include]}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-default build.cmd {${python.bin} setup.py --no-user-cfg}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-default destroot.cmd {${python.bin} setup.py --no-user-cfg}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-default destroot.destdir {--prefix=${python.prefix} --root=${destroot}}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default build.cmd {[python_get_defaults build_cmd]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default build.target {[python_get_defaults build_target]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default destroot.cmd {[python_get_defaults destroot_cmd]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default destroot.destdir {[python_get_defaults destroot_destdir]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default destroot.target {[python_get_defaults destroot_target]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default python.pep517 no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+option_proc python.pep517 python_set_pep517
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc python_set_pep517 {option action args} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$action ne "set"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global python.pep517 python.version subport name
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$subport ne $name} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[string is true -strict ${python.pep517}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_build-append port:py${python.version}-pep517 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:py${python.version}-python-install \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:py${python.version}-wheel
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_build-delete port:py${python.version}-pep517 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:py${python.version}-python-install \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:py${python.version}-wheel
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span>
proc python_get_defaults {var} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global python.version python.branch python.prefix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global python.version python.branch python.prefix python.bin python.pep517 workpath
</span> switch -- $var {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ binary_suffix {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[string match py-* [option name]]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -${python.branch}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ build_cmd {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${python.pep517}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "${python.bin} -m pep517.build --no-deps --binary --out-dir ${workpath}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "${python.bin} setup.py --no-user-cfg"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ build_target {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global worksrcpath
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${python.pep517}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ${worksrcpath}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return build[python_get_defaults jobs_arg]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ destroot_cmd {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${python.pep517}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "${python.bin} -m install --verbose"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "${python.bin} setup.py --no-user-cfg"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ destroot_destdir {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global destroot
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${python.pep517}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "--destdir ${destroot}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "--prefix=${python.prefix} --root=${destroot}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ destroot_target {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${python.pep517}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [glob -nocomplain -directory ${workpath} *.whl]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return install
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> include {
set inc_dir "${python.prefix}/include/python${python.branch}"
if {[file exists ${inc_dir}]} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -305,13 +369,6 @@ proc python_get_defaults {var} {
</span> }
}
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- binary_suffix {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[string match py-* [option name]]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -${python.branch}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return ""
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span> jobs_arg {
if {${python.version} >= 35 && [option use_parallel_build]} {
return " -j[option build.jobs]"
</pre><pre style='margin:0'>
</pre>