<html><head><style>* {font-family:Menlo,Arial}</style></head><body style="word-wrap:break-word;line-break:after-white-space"><div id="bloop_customfont" style="font-family:Menlo,Arial;font-size:13px;margin:0px;line-height:auto">Hi,</div><div><br></div><div>I’m trying to create a port for TensorFlow and I have already accumulated quite a number of doubts in just a couple of hours I've been working on it.</div><div><br></div><div>First of all, I realised (late) that TensorFlow (and some of its dependencies) is built as a wheel package (a .whl file), and as such it gets uploaded to the Python Package Index: ​<a href="https://pypi.python.org/pypi/tensorflow/1.4.1">https://pypi.python.org/pypi/tensorflow/1.4.1</a>.  whl files are meant to be installed with pip, so my current port file does the following:</div><div><br></div><div><div>  if {${name} ne ${subport}} {</div><div><br></div><div>    build {</div><div>    }</div><div><br></div><div>    destroot.cmd        pip-${python.branch}</div><div>    destroot.pre_args</div><div>    destroot.args       \</div><div>        install \</div><div>        --no-cache-dir \</div><div>        --no-dependencies \</div><div>        --target ${destroot}${python.pkgd} \</div><div>        ${worksrcpath}/${distname}${extract.suffix}</div><div>    destroot.post_args</div><div><br></div><div>    livecheck.type      none</div><div>  }</div></div><div><br></div><div>You can see the PR here: <a href="https://github.com/macports/macports-ports/pull/1131">https://github.com/macports/macports-ports/pull/1131</a></div><div><br></div><div>The port apparently work, but I'd like to submit this port for review for the following reasons:</div><div><br></div><div>  * I'm not sure we should install a whl file this way, invoking `pip`.</div><div><br></div><div>  * I had to redefine `master_sites` and `checksums` for each version of Phyton.</div><div><br></div><div>  * I had to redefine the `extract` properties to skip extraction and just copy the downloaded file into `${worksrcpath}`:</div><div><br></div><div>      extract.suffix      .whl</div><div><div>      extract.cmd         cp</div><div>      extract.pre_args</div><div>      extract.post_args   ${worksrcpath}</div><div>      extract.mkdir       yes</div></div><div><br></div><div>  * Is there a better idiom to refer to the currently-installed `pip`?</div><div><br></div><div>      destroot.cmd        pip-${python.branch}</div><div><br></div><div>  * Is there a better idiom to refer to the Python site packages directory in the staging area?</div><div><br></div><div>      ${destroot}${python.pkgd}</div><div><br></div><div>Finally, I'm wondering whether this is a good idea at all.  I've grep-ed the ports and I saw no other whl file installed this way.</div><div><br></div><div>If you can have a look at the PR I will appreciate any feedback and insight.</div><div><br></div><div>Cheers,</div><div>-- </div><div>Enrico</div></body></html>