curved-television-6568
08/30/2021, 1:27 PMdjango
, which in turns comes with a bunch of optional dependencies based on what “extras” I install it with. Say I from django.db.mongo import MongoClient
just to make something up, and that part of django imports mongo. Then mongo
will be another 3rd party lib we depend on. Is this also inferred?
Thing is, I have an issue getting our imports to infer our dependencies properly.. and try to narrow down what could be the cause for it.happy-kitchen-89482
08/30/2021, 3:30 PMwitty-crayon-22786
08/30/2021, 4:00 PMwitty-crayon-22786
08/30/2021, 4:00 PMhundreds-father-404
08/30/2021, 4:42 PM/pants dependencies --type=3rdparty path/to/app.py
to see the top-level requirement strings depends upon by the filecurved-television-6568
08/30/2021, 5:08 PM--type=3rdparty
came out empty.. although, with --transitive
I get a list of 3rdparty libs..curved-television-6568
08/30/2021, 5:08 PMhundreds-father-404
08/30/2021, 5:10 PMextras
.
The only way I know to confirm is find the target name, like //:requests
, then make sure something depends on it, e.g. by adding //:requests
to the dependencies
field of a target. Then run ./pants dependencies --type=3rdparty
curved-television-6568
08/30/2021, 5:11 PMcurved-television-6568
08/30/2021, 5:21 PM$ ./pants dependencies --transitive --type=3rdparty tests:tests0
backoff<2.0.0,>=1.11.1
cachetools<5.0.0,>=4.2.2
flasgger<0.10.0,>=0.9.5
flask-cors<4.0.0,>=3.0.10
flask<3.0.0,>=2.0.1
gevent<22.0.0,>=21.8.0
memorised==1.1.0
requests<3.0.0,>=2.26.0
svs-configuration<4.0.0,>=3.3.2
svs-logging<3.0.0,>=2.0.0
svs-stats<3.0.0,>=2.0.2
svs-utils[default,testutils]<5.0.0,>=4.24.2
However, in svs-utils
there is a dep for another svs lib for the testutils
extra, which isn’t included in the venv when running pytest..
$ ./pants test tests/auth_test.py
19:20:12.08 [INFO] Completed: Building pytest.pex with 2 requirements: pytest-cov>=2.10.1,<2.12, pytest>=6.0.1,<6.3
19:20:12.09 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
....
no, wait, now I hade another lib missing, which is a test plugin, which is expected, so perhaps this was a caching issue, that I got an old venv after fixing a missing extra on my dep.hundreds-father-404
08/30/2021, 5:29 PMcurved-television-6568
08/30/2021, 7:12 PMcurved-television-6568
08/30/2021, 7:13 PMcurved-television-6568
08/31/2021, 2:27 PM