I'm looking for some help debugging packaging depe...
# general
l
I'm looking for some help debugging packaging dependencies with resolves enabled. Details in the thread! 🙏🏻 in advance.
1
I have the following in my pants.toml:
Copy code
[python]
enable_resolves = true
default_resolve = "default"

[python-infer]
string_imports = true
use_rust_parser = true

[python.resolves]
default = "3rdparty/python/default.pex.lock"
I run
pants generate-lockfiles
and I can confirm that
3rdparty/python/default.pex.lock
exists. When I run
pants package ::
I encounter this error for the inferred dependencies.
Copy code
monorepo git:(pants-init-config-with-cp) ✗  pants generate-lockfiles
17:49:09.27 [INFO] Completed: Generate lockfile for default
17:49:09.28 [INFO] Wrote lockfile for the resolve `default` to 3rdparty/python/default.pex.lock
 monorepo git:(pants-init-config-with-cp) ✗  pants dependencies apps/myproject/myapp/myapp/settings.py
//:deps#django
//:deps#django-cors-headers
//:deps#django-filter
//:deps#djangorestframework
//:deps#djangorestframework-camel-case
//:deps#envs
//:deps#pymysql
//:deps#rich
//:deps#ssm-cache
apps/apps/myproject/myapp/myapp/urls.py:src
apps/apps/myproject/myapp/myapp/wsgi.py:src
libraries/mylib/mylib/__init__.py:src
 monorepo git:(pants-init-config-with-cp) ✗  pants package ::                                                                     
17:49:24.27 [ERROR] 1 Exception encountered:

Engine traceback:
  in `package` goal

InvalidFieldException: : Failed to get dependencies for //:deps#django: The file or directory '3rdparty/python/default.pex.lock' does not exist on disk in the workspace, so the address '3rdparty/python/default.pex.lock:_default_lockfile' from the `dependencies` field from the target //:deps#django cannot be resolved.
b
Do you have any file ignore settings that might cover that file (including in .gitignore)?
🙌 1
l
Well would you look at that. Indeed I had a
3rdparty
in my .gitignore. Thank you!
👍 2
c
I think we could augment that error message to suggest it may be excluded by a ignore rule. I know this is in the docs, but wont be the first thing you look for when experiencing this.