*UPD*: in fact is was a typo in the requirements f...
# general
f
UPD: in fact is was a typo in the requirements file. After fixing it it works as expected. Initial question: Another question: I have a directory structure like:
Copy code
├── README.md
├── pants
├── pants.toml
└── projectdir
    ├── BUILD
    ├── requirements.txt
    └── tool
        ├── BUILD
        ├── __main__.py
        └── backend.py
projectdir/requirements.txt
specify dependenceis, used in
projectdir/tool/backend.py
The
projectbuild/BUILD
has
Copy code
python_requirements(
    name="reqs",
)
That should parse requireements.txt. But if query the dependencies from
projectdir/tool/backend.py
it’s nothing there.
./pants dependencies --transitive projectdir/tool/backend.py
I’ve create very simple repo that demonstrates it. https://github.com/golovasteek/pants_sample_project How do I ensure that dependencies in the
projectdir/tool
are properly inferred with respect to
projectdir/requirements.txt
?
1
h
Hi, Disclaimer: I’m a new Pants user myself and still in the early agers of adopting Pants. I’ve cloned the repo, ran
pants dependencies --transitive projectdir/tool/backend.py
and got:
Copy code
13:30:58.53 [INFO] Initializing scheduler...
13:30:58.81 [INFO] Scheduler initialized.
projectdir/requirements.txt:reqs
projectdir:reqs#requests
If you get a different result, what is it? If it’s the same, what did you expect to happen differently?
f
As I already mentioned in the post. The issue was the typo in the requirements.txt file. (It is already fixed, but you can see it in the first commit). And since there was no error message or even waning, I was misled and thought it just doesn’t pick up the dependencies.
Currently it work as expected.
e
Apparently the
dependencies
goal doesn't warn, but other goals should by default IIUC: https://www.pantsbuild.org/docs/reference-python-infer#unowned_dependency_behavior