curved-hydrogen-24259
03/19/2024, 10:28 AMpants tailor :: I get KeyError: 'Version'. More details in the threadcurved-hydrogen-24259
03/19/2024, 10:30 AM...
"/Users/ed/Library/Caches/nce/b53192ff83dd22c11f093268f09503786fcdeb806b34ecf4d2e519c915578288/bindings/venvs/2.19.1/lib/python3.9/site-packages/pants/backend/go/util_rules/third_party_pkg.py", line 235, in analyze_module_dependencies
version = mod_json["Replace"]["Version"]
KeyError: 'Version'curved-hydrogen-24259
03/19/2024, 10:33 AMReplace key is present, but it doesn't check for version:
for mod_json in ijson.items(mod_list_result.stdout, "", multiple_values=True):
# Skip the first-party module being analyzed.
if "Main" in mod_json and mod_json["Main"]:
continue
if "Replace" in mod_json:
# TODO: Reject local file path replacements? Gazelle does.
name = mod_json["Replace"]["Path"]
version = mod_json["Replace"]["Version"]
else:
name = mod_json["Path"]
version = mod_json["Version"]
I wonder if issue could be as simple that code assumes replace in go module has version? It is not mandatory as per https://go.dev/doc/modules/gomod-ref#replacecurved-hydrogen-24259
03/19/2024, 11:30 AMcurved-hydrogen-24259
03/19/2024, 12:49 PMmod_json["Replace"].get("Version")
doesn't help, because None is not valid version identifier. Empty string (using .get("") doesn't help either)curved-hydrogen-24259
03/19/2024, 1:05 PMpants tailor :: doesn't complain anything đ¤
Edit2: issue still remains, if I remove all buildfiles and use pants tailor :: to generate those, it succeeds. But if I then run pants tailor :: then it fails with
cannot use relative path ../<reponame>@latestcurved-hydrogen-24259
03/19/2024, 2:11 PMreplace or
⢠we should find people willing to work on Go part
not enough familiar with Pants, so not sure where to start if I'd want to fix it. Sad in a way that relative paths are not allowed, as to me it seems like it is one reason why people create monorepos; to avoid versioning, because as long as you deploy all linked projects together in a monorepo, you don't need internal versioning of partshappy-kitchen-89482
03/19/2024, 8:59 PMcurved-hydrogen-24259
03/20/2024, 9:25 AMhappy-kitchen-89482
03/21/2024, 1:28 AMhappy-kitchen-89482
03/21/2024, 1:28 AMhappy-fireman-53949
08/22/2024, 6:38 PMfast-nail-55400
08/22/2024, 6:51 PMhappy-kitchen-89482
08/22/2024, 7:05 PMhappy-kitchen-89482
08/22/2024, 7:07 PMhappy-fireman-53949
08/22/2024, 7:10 PMhappy-kitchen-89482
08/22/2024, 11:24 PMhappy-fireman-53949
08/22/2024, 11:27 PMhappy-kitchen-89482
08/23/2024, 6:52 PMcurved-hydrogen-24259
08/26/2024, 3:23 PM@curved-hydrogen-24259 any interest still in tackling this?Sorry wouldn't be able to now, as it's quite unfamiliar with the details and would take too much time for me to even figure out how đ Thanks for asking though