Why are most Python dependencies use depends_lib?

Chih-Hsuan Yen yan12125 at gmail.com
Sat Sep 8 06:47:07 UTC 2018

Mojca Miklavec <mojca at macports.org> 於 2018年9月8日 週六 下午1:59寫道:
> On Sat, 8 Sep 2018 at 06:17, Ryan Schmidt wrote:
> > On Sep 7, 2018, at 22:08, Chih-Hsuan Yen wrote:
> >
> > > Thank you both for explanations and reasoning! As depends_run and
> > > depends_lib are practically the same for Python ports, how about
> > > moving all ports to either depends_lib or depends_run gradually?
> > > Having two patterns hurts my eyes :D
> > >
> > > If we are moving to depends_run, just remember to keep non-Python
> > > dependencies in depends_lib for Python packages with C extensions. For
> > > example, in py-openssl, path:lib/libssl.dylib:openssl should be kept
> > > in depends_lib and port:py${python.version}-cryptography and
> > > port:py${python.version}-six can be moved to depends_run.
> >
> > I do not know enough about Python to confirm whether such a mass change would be appropriate. I thought some Python modules are compiled. If one compiled Python module depends on another compiled Python module, probably it does so at build time, not just at runtime; in other words, depends_lib would be correct for that case.

In this case depends_run is still fine. In current implementations of
CPython and PyPy, Python packages are always checked at run-time,
either for pure Python libraries or compiled ones.

> Indeed. While mass change is feasible, it should only be done if we
> test one-by-one port (even if using some scripting to iterate through
> ports), and for each port test whether a port can be compiled and
> installed/destrooted without having a particular dependency available.
> If that is the case, the dependency could be moved to depends_run.
> To me it sounds correct to move dependencies from depends_lib to
> depends_run, but only if they are not needed during build time. I
> would probably not volunteer for that task though since it takes quite
> some time to get this right and there is not so much advantage other
> than consistency.

One-by-one is my preferred way, too. And IMO such changes should be
done by port maintainers as it might require knowledge of internals of
a Python library to do the best decision.

> Mojca


Chih-Hsuan Yen

More information about the macports-dev mailing list