jolly-midnight-72759
05/24/2020, 3:23 PMThe value of the dependencies field is a list of addresses of other targets. If code in target A directly depends on code in target B (e.g., by importing a symbol from B) then A should declare a dependency on B. There is no need to declare indirect dependencies (that is, transitive dependencies of your direct dependencies).I think it would be helpful to mention that there are two types of dependencies: 3rdparty and other monorepo target.
jolly-midnight-72759
05/24/2020, 3:24 PMjolly-midnight-72759
05/24/2020, 3:25 PMhundreds-father-404
05/24/2020, 3:51 PMdependencies. You can explicitly add any others youād likejolly-midnight-72759
05/24/2020, 3:54 PM*.yaml etc).jolly-midnight-72759
05/24/2020, 3:55 PMsetup.py.hundreds-father-404
05/24/2020, 3:55 PMhundreds-father-404
05/24/2020, 3:55 PMAlthough, I would imagine pants would follow the same learning lessons ofWhat do you mean?.setup.py
jolly-midnight-72759
05/25/2020, 1:48 AMsetup.py (from setuptools) to the pant's BUILD files. Both define the following metadata:
⢠name
⢠packages or source code
⢠package_data or resources
⢠install_requires or dependencies (what you are proposing to automate)
⢠python_requires or compatibilityjolly-midnight-72759
05/25/2020, 1:53 AMdescription
⢠version
⢠packages
⢠etc
And because these are not useful to pex, pants doesn't need these.jolly-midnight-72759
05/25/2020, 1:54 AMBUILD files. (Then again maybe not.) They are serving different purposes, but there are a lot of parallel evolution going on.jolly-midnight-72759
05/25/2020, 1:57 AMscripts option, which I don't think is useful to pants because of the power of 111.jolly-midnight-72759
05/25/2020, 2:01 AMfind_packages, which isn't needed because, source can be filled by using the 111 pattern and file names conventions.jolly-midnight-72759
05/25/2020, 2:04 AMdependencies field is to imitate the find_packages but with a find_dependencies method. This method could be the default for when dependencies is missing from the BUILD file, or it can be added from the list of dependencies for when a project wants to explicitly declare some dependencies. When a project wants no automatic discovery, then find_dependencies can be excluded.jolly-midnight-72759
05/25/2020, 2:15 PMhundreds-father-404
05/27/2020, 3:14 PMsetup.py to a BUILD file. At a high level, itās a fair comparison. They both exist for metadata about some of your code.
field is to imitate theĀ find_packagesĀ but with aĀ find_dependenciesĀ methodAre you envisioning the user explicitly typing
find_dependencies? Instead, the plan is that Pants will automatically do it no matter what (if you have the backend registered). If you explicitly specified everything, Pants will have nothing to add. If you explicitly specified 3/5 imports, then Pants will fill in the rest, etchundreds-father-404
05/27/2020, 3:14 PMjolly-midnight-72759
05/27/2020, 3:59 PMsetup.py requires people to type it explicitly. After thinking about it, it doesn't make sense for BUILD to require that. BUT it would be good to be able to turn the automatic find dependency off Just in Caseā¢.hundreds-father-404
05/27/2020, 4:01 PM./pants dependencies project/app.pyjolly-midnight-72759
05/27/2020, 4:03 PM