On May 11, 2018, at 21:57, Renee Otten wrote:

> I am trying to understand why in some Python ports the run dependencies are 
> declared using path instead of port statements - is there an 
> advantage/preference for one over the other?
> 
> For example, in the py-spyder-devel Portfile (but also the py-autopep8, which 
> I recently updated) it uses: "depends_lib-append 
> path:${python.pkgd}/pep8:py${python.version}-pep8”, which I changed to 
> "depends_lib-append 
> path:${python.pkgd}/pycodestyle:py${python.version}-codestyle” in the 
> py-autopep8 Portfile. 
> 
> If I understand it correctly form the guide the path statement will look if a 
> specific file is present, if not it will install the port. So, in this case 
> for  pep8/pycodestyle in 
> ${frameworks_dir}/Python.framework/Versions/${python.branch}//lib/python${python.branch}
>  ; that file is present but with the extension .py - is that implicitly 
> assumed or should one provide the extension in the path specification. Also, 
> is there any advantage here of using path instead of just doing: 
> "depends_lib-append port:py${python.version}-pep8” or "depends_lib-append 
> port:py${python.version}-pycodestyle”?

path:-style dependencies are used when more than one port could satisfy the 
dependency. For example, py-spyder-devel is a development version of spyder, 
while py-spyder is the stable version. If another port needs to declare a 
dependency on spyder, it should use a path:-style dependency, so that either 
the stable version or the development version can be used.

Our documentation about this is somewhat lacking. See 
https://trac.macports.org/ticket/14540 for some stuff that should be added to 
the guide about this.

As for why a dependency on pep8 is being written in path:-style, I don't know. 
I don't see a py-pep8-devel port. I don't know if there is another port that 
provides the same files as py-pep8.

If you use a path:-style dependency, you must specify the complete and accurate 
path of the file, including filename extensions. If the path you specify is 
relative (does not begin with a slash), ${prefix} is prepended for you.

Reply via email to