Ehh… this doesn’t make sense to me:
# development
c
Ehh… this doesn’t make sense to me:
Copy code
ValueError: The explicit dependency `3rdparty/python/user_reqs.lock` of the target at `3rdparty/python#pex` does not provide enough address parameters to identify which parametrization of the dependency target should be used.
Target `3rdparty/python:python` can be addressed as:
  * 3rdparty/python:python
  * 3rdparty/python#PyYAML
  * 3rdparty/python#ansicolors
The dependency in question looks like:
Copy code
17:57:27.02 [INFO] stdout: "REQ DEPS: ['3rdparty/python/requirements.txt', '3rdparty/python/user_reqs.lock']"
h
hm, that seems like a bug
🙏 1
c
And is for the
3rdparty/python#pex
target, so it should have all it needs.
yeah, ok, thx then it’s not just me being crazy, I can dig into it see what comes out
(working on the next step after synth targets feature to help shape it and prove its usefulness..)
Ah, I may have a badly named target in there…
👀 1
or the dependency is off, should perhaps be
"3rdparty/python:user_reqs.lock"
… it’s my bad, none the less
in missmatching the target address vs the dependency value
h
3rdparty/python:user_reqs.lock
is this a synthetic target? or it's generated by
3rdparty/python:python
?
c
but the error message wasn’t really being helpful in this case 😛
yeah it’s a synthetic one, why I think I may have generated a bad address for it, it doesn’t look right
Copy code
╰─❯ ./pants peek 3rdparty/python/user_reqs.lock
[
  {
    "address": "3rdparty/python:user_reqs.lock",
    "target_type": "lockfile",
    "dependencies": [],
    "description": null,
    "source_raw": "user_reqs.lock",
    "sources": [
      "3rdparty/python/user_reqs.lock"
    ],
    "tags": null
  }
]
h
ah yeah, then this all is explained. but super confusing. the reason Pants gave that message is
path/to/f.py
is shorthand for
path/to/f.py:to
lmao
c
exactly, when I realized that it went 💡
I think it would help if that address where presented, not the value used verbatim, that would help
h
https://github.com/pantsbuild/pants/issues/12286. I'm unfortunately really unlikely to have time to work on it in 2022 😞 but at least CLI args are fixed now
I think it would help if that address where presented, not the value used verbatim, that would help
or maybe (aka
path/to/f.py:to
)? Because otherwise I could see people being confused why
:to
is showing up but they never typed that anywhere!
maybe that is a good idea actually -- be more explicit about this super confusing shorthand
c
mmm… true… 🤔
yeah I prefer to see the resulting value being used as inferred from what I provided
h
yeah, I think that actually is a really good and not too hard way to mitigate how atrociously confusing https://github.com/pantsbuild/pants/issues/12286 is
👍 1
I can definitely see users thinking "wtf, why are there two ways to refer to this?" But I'd rather that than "what??? Why is this totally unrelated target being mentioned. I literally just said a file name. Boo pants"
c
Well… this was an interesting find. I don’t seem to be able to create a file level atom target in a BUILD file, the same way as when using a target generator:
Copy code
╰─❯ ./pants peek --exclude-defaults src/python/pants/foo::
[
  {
    "address": "src/python/pants/foo:foo",
    "target_type": "python_source",
    "dependencies": [],
    "source_raw": "dummy.py",
    "sources": [
      "src/python/pants/foo/dummy.py"
    ]
  },
  {
    "address": "src/python/pants/foo:other",
    "target_type": "python_source",
    "dependencies": [],
    "source_raw": "other.py",
    "sources": [
      "src/python/pants/foo/other.py"
    ]
  }
]
there’s no way for me to create these two targets in a BUILD file, so they look the same as if I used a single
python_sources
!
in other words, I have too little influence over the target address from the target adaptor..
in this case.. not saying this is required in the general case, but for synthetic targets it would be more or less required, I think.
BUILD:
Copy code
python_source(name="foo", source="dummy.py")
python_source(name="other", source="other.py")
vs the `python_sources()`:
Copy code
╰─❯ ./pants peek --exclude-defaults src/python/pants/foo::
[
  {
    "address": "src/python/pants/foo:foo",
    "target_type": "python_sources",
    "dependencies": [
      "src/python/pants/foo/dummy.py",
      "src/python/pants/foo/other.py"
    ],
    "sources": [
      "src/python/pants/foo/dummy.py",
      "src/python/pants/foo/other.py"
    ]
  },
  {
    "address": "src/python/pants/foo/dummy.py",
    "target_type": "python_source",
    "dependencies": [],
    "source_raw": "dummy.py",
    "sources": [
      "src/python/pants/foo/dummy.py"
    ]
  },
  {
    "address": "src/python/pants/foo/other.py",
    "target_type": "python_source",
    "dependencies": [],
    "source_raw": "other.py",
    "sources": [
      "src/python/pants/foo/other.py"
    ]
  }
]
h
c
yes! it is 🙂