Hi guys. We are currently evaluating Pants. We are...
# general
i
Hi guys. We are currently evaluating Pants. We are having issues adding a .whl dependency that is a simple url to an s3 bucket. The url is listed in the requirements.txt, but pants throws an error saying it can't find the file location when trying to build. Is there a special way to do this?
e
Are you using a direct reference? https://peps.python.org/pep-0440/#direct-references Although Pex and Pip understand a simple URL to a wheel, Pants does not IIRC.
If you are using the direct reference format, can you provide a complete command line + output redacted as necessary? The Pants version too please!
i
Hi. The organization that publishes the library only allows hosts their code in an s3 bucket, so we can only fetch it via url
e
You can, but you need to use the format above:
projectname @ url
not just
url
Are you doing that?
Wait, is this an https URL backed by s3? None of Pants / Pex / Pip understand s3:// style URLs.
i
It's not an s3 style url. Just regular https link
trying to figure out the format you are referring to
e
Yeah, so if the project name is "super-secret" (The wheel name), then you need to be repetitive for Pants and say "super-secret @ https://.....super-secret-....whl"
That
project @ url
format is called a "direct reference" and its explained more in the PEP I linked above,
i
ok. let me try it
e
If that works, the relevant docs are here: https://www.pantsbuild.org/docs/python-third-party-dependencies#version-control-and-local-requirements The normal https URL case is a bit obscured - the examples are for git and file urls.
i
@enough-analyst-54434 That worked! Thank you so much!
❤️ 1
e
Excellent. You're welcome.
h
Btw this PR might be worth tracking. It makes support for local requirements more ergonomic in some cases for Pants 2.14+ https://github.com/pantsbuild/pants/pull/16584. And rewrites the docs for local requirements to better explain them
e
The thing that got in the way here is Pants is more restrictive than the underlying tool(s) when parsing requirements.