https://pantsbuild.org/ logo
#general
Title
# general
c

calm-ambulance-65371

03/03/2021, 10:49 PM
I'm kind of baffled by this error here:
Copy code
Exception: Unmatched glob from the option `--python-setup-requirement-constraints`: "constraints.txt"
Does anyone have incite into this error? It does it both when using the equivalent configuration in pants.toml and when using the mentioned CLI flag
h

hundreds-father-404

03/03/2021, 10:50 PM
Hey Noah! It means that you're telling Pants you have a constraints file at
<build root>/constraints.txt
, but Pants can't find it Do you expect that file to exist?
c

calm-ambulance-65371

03/03/2021, 10:51 PM
it does exist, let me double check for typos though
oh I think I know the issue. The constraints.txt is in the repo root, which isn't a build root
hmm
h

hundreds-father-404

03/03/2021, 10:52 PM
The constraints.txt is in the repo root, which isn't a build root
Wait what do you mean? Build root == repo root, it's where the
./pants
script is located and (normally)
pants.toml
c

calm-ambulance-65371

03/03/2021, 10:52 PM
the error's a little misleading, but I think I understand what's going on now. Thanks @hundreds-father-404
Ah, I'm thinking source root
👍 1
h

hundreds-father-404

03/03/2021, 10:54 PM
Oh yeah, those terms are confusing for sure
c

calm-ambulance-65371

03/03/2021, 10:54 PM
yeah, that file exists, so it's not clear to me why it can't find it
c

calm-ambulance-65371

03/03/2021, 10:56 PM
doh, it's my .gitignore
yup, that was it
h

hundreds-father-404

03/03/2021, 10:58 PM
K, how would this error message have been?
Exception: Unmatched glob from the option `[python-setup].requirement-constraints`: "constraints.txt"
Does that file exist? If so, check if the file is in your
.gitignore
or the global
pants_ignore
option. Refer to https://www.pantsbuild.org/docs/troubleshooting#pants-cannot-find-a-file-in-your-project
c

calm-ambulance-65371

03/03/2021, 10:58 PM
that would have been helpful
just "unmatched glob" could mean it expects a wildcard in the filename or something. Even just having "do the file(s) exist?" would help clarify what the error means
h

hundreds-father-404

03/03/2021, 11:01 PM
just "unmatched glob" could mean it expects a wildcard in the filename or something
Yeah that's correct. This is the same error message for when
sources=["bad_*.py"]
in a BUILD file, for example. So we need to use the term "glob" to be accurate
c

calm-ambulance-65371

03/03/2021, 11:01 PM
Yeah, that makes sense. Just didn't put 2 and 2 together that it meant it couldn't see the file 🙂
h

hundreds-father-404

03/03/2021, 11:13 PM
Cool, I like this rewording a lot. https://github.com/pantsbuild/pants/issues/11629 Only blocker is figuring out how to generate the stable URL to the docs from our Rust code, which is not as trivial as it sounds