Created attachment 211464 [details] new port www/py-gdown New port www/py-gdown python module and cli cmd to download files from google drive. This handles the "unable to scan" warning on larger files that cause wget/curl to fail.
gdown depends on "requests[socks]" , the "requests" packages extras_require=socks[...] dependency list [1]. When declaring dependencies for packages that declare dependencies on package[extras] form, the port must depend on those dependencies directly [2] requests[socks] is currently defined in requests setup.py [3] as: extras_require { 'socks': ['PySocks>=1.5.6, !=1.5.7'], } If, in fact, "socks" functionality in gdown is *not* compulsory, but instead OPTIONAL, then gdown should list and declare the socks dependency in extras_require (optional dependencies), not install_requires (compulsory dependencies) gdown, could for example do: install_requires = requests (compulsory base requests functionality) extras_require = requests[socks], or directly on pysocks (optional socks support) [1] gdown:setup.py: install_requires=['filelock', 'requests[socks]', 'six', 'tqdm'], [2] https://wiki.freebsd.org/Python/PortsPolicy#Transitive_Dependencies [3] requests:setup.py:extras_requite = { ... , 'socks': ['PySocks>=1.5.6, !=1.5.7'], ... }
I just thought requests[socks] was part of www/py-requests. py-requests depends on py-urllib3 which optionally depends on py-pysocks, and is on by default. gdown passes any proxy options to requests through `sess.proxies = {...}` then the call to `sess.get()` is in a try block which catches proxy errors. That should leave a nice failed message if trying to use a proxy with SOCKS disabled/unavailable in py-urllib3. https://github.com/wkentaro/gdown/blob/master/gdown/download.py#L66 So as gdown doesn't directly rely on or call py-pysocks, does that count as needing to be listed as an optional port dependency? It does mean the projects setup.py could use some adjustment.
What other transitive dependencies are is not related in the sense that whatever is declared and configured as dependencies in a setup.py *must be* satisfied, otherwise run time errors will occur (prior to even using/importing that functionality) If a package fails gracefully if a dependency is not available, whether as an error message ("foo functionality requires installing package: foo"), just continues in the absence of a module, or otherwise fallback to an alternative method, then yes, it is effectively optional (more precisely; not *compulsory*), and should be declared elsewhere (not in install_requires)
Created attachment 211494 [details] new port www/py-gdown add patch to move socks from install_requires to extras_require
Added to repo in bfd638fbb3b3bacc4cc9548ffe8cffbc51d13c27 not using this PR as base Sorry for the wait Best regards, Daniel
^Triage: Assign to committer that resolved (OBE)