In BUILD files, is there a way to take an explicit...
# general
w
In BUILD files, is there a way to take an explicit dependency on something like "uvicorn[standard]" - or would I need to individually add each dep?
r
It should work as long as you are defining the dependency using
python_requirement(s)
.
w
Yeah, no dice unfortunately.
Requirements:
Copy code
fastapi
firebase-admin
jinja2
sendgrid
sqlalchemy
uvicorn[standard]
Trying to use
//:reqs#uvicorn[standard]
Copy code
ValueError: The explicit dependency `//:reqs#uvicorn[standard]` of the target at `backend/apigateway:apigateway` does not provide enough address parameters to identify which parametrization of the dependency target should be used.
Target `//:reqs` can be addressed as:
  * //:reqs
  * //:reqs#fastapi
  * //:reqs#firebase-admin
  * //:reqs#jinja2
  * //:reqs#sendgrid
  * //:reqs#sqlalchemy
  * //:reqs#uvicorn
  * //requirements.txt:reqs
p
Have you tried
//:reqs#uvicorn
? I believe the extra is implicit - if the requirements.txt specifies an extra, then anything that uses that package will depend on that package with the extra.
The
uvicorn[standard]
line in your requirements file is basically like defining:
Copy code
python_requirement(name="uvicorn", requirement="uvicorn[standard]")
w
So, that's what I had hoped - but I'm getting strange results. I see in stack traces a couple times that I'm using
uvloop
as expected, but other times, it's
asyncio
- really bizarre stuff. I'm putting dollars to doughnuts that I've got some bad caching in this pipeline somewhere