https://pantsbuild.org/ logo
#development
Title
# development
r

refined-addition-53644

08/16/2022, 7:42 AM
Hi I am having issues when committing to a local branch which I have branched off from main (commit: c431a00cb9456db3a0699be68d9ba9cd50270103). 🧵
Copy code
* Typechecking
09:42:56.60 [INFO] Starting: Building extra_type_stubs.pex
09:42:56.60 [INFO] Starting: Building mypy.pex from 3rdparty/python/mypy.lock
09:42:56.63 [INFO] Canceled: Building mypy.pex from 3rdparty/python/mypy.lock
09:42:56.64 [INFO] Starting: Building mypy.pex from 3rdparty/python/mypy.lock
09:42:56.70 [INFO] Canceled: Building mypy.pex from 3rdparty/python/mypy.lock
09:42:56.73 [ERROR] 1 Exception encountered:

Engine traceback:
  in select
  in pants.core.goals.check.check
  in pants.backend.python.typecheck.mypy.rules.mypy_typecheck (mypy)
  in pants.backend.python.typecheck.mypy.rules.mypy_typecheck_partition
  in pants.backend.python.util_rules.pex.create_pex
  in pants.backend.python.util_rules.pex_from_targets.create_pex_from_targets
  in pants.backend.python.util_rules.pex_requirements.load_lockfile
Traceback (most recent call last):
  File "/Users/developer/personal/pants/src/python/pants/core/util_rules/lockfile_metadata.py", line 269, in get_metadata
    val = metadata[key]
KeyError: 'only_binary'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/developer/personal/pants/src/python/pants/engine/internals/selectors.py", line 653, in native_engine_generator_send
    res = func.send(arg)
  File "/Users/developer/personal/pants/src/python/pants/backend/python/util_rules/pex_requirements.py", line 194, in load_lockfile
    delimeter=header_delimiter,
  File "/Users/developer/personal/pants/src/python/pants/core/util_rules/lockfile_metadata.py", line 143, in from_lockfile
    return concrete_class._from_json_dict(metadata, lockfile_description, error_suffix)
  File "/Users/developer/personal/pants/src/python/pants/backend/python/util_rules/lockfile_metadata.py", line 233, in _from_json_dict
    only_binary = metadata("only_binary", Set[str], lambda l: set(l))
  File "/Users/developer/personal/pants/src/python/pants/core/util_rules/lockfile_metadata.py", line 272, in get_metadata
    f"Required key `{key}` is not present in metadata header for "
pants.core.util_rules.lockfile_metadata.InvalidLockfileError: Required key `only_binary` is not present in metadata header for the lockfile `3rdparty/python/user_reqs.lock` for `python-default`. To resolve this error, you will need to regenerate the lockfile by running `./pants generate-lockfiles --resolve=python-default`.

09:42:56.78 [INFO] Canceled: Building extra_type_stubs.pex
I haven’t added any new dependency. So I was bit unsure if I should run the
generate-lockfiles
h

happy-kitchen-89482

08/16/2022, 7:56 AM
r

refined-addition-53644

08/16/2022, 8:00 AM
That change is already included. Generating the lockfile locally fixes it but I don’t think that’s the way to go?
h

hundreds-father-404

08/16/2022, 1:58 PM
r

refined-addition-53644

08/16/2022, 2:07 PM
No! Just one extra commit 🙂