https://pantsbuild.org/ logo
i

incalculable-hydrogen-44003

08/22/2022, 9:18 PM
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

enough-analyst-54434

08/22/2022, 9:20 PM
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

incalculable-hydrogen-44003

08/22/2022, 9:23 PM
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

enough-analyst-54434

08/22/2022, 9:24 PM
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

incalculable-hydrogen-44003

08/22/2022, 9:26 PM
It's not an s3 style url. Just regular https link
trying to figure out the format you are referring to
e

enough-analyst-54434

08/22/2022, 9:27 PM
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

incalculable-hydrogen-44003

08/22/2022, 9:28 PM
ok. let me try it
e

enough-analyst-54434

08/22/2022, 9:30 PM
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

incalculable-hydrogen-44003

08/22/2022, 9:39 PM
@enough-analyst-54434 That worked! Thank you so much!
❤️ 1
e

enough-analyst-54434

08/22/2022, 9:40 PM
Excellent. You're welcome.
h

hundreds-father-404

08/22/2022, 9:47 PM
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

enough-analyst-54434

08/22/2022, 10:03 PM
The thing that got in the way here is Pants is more restrictive than the underlying tool(s) when parsing requirements.
2 Views