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

wide-midnight-78598

02/03/2022, 4:46 PM
I'm following the instructions here (https://www.pantsbuild.org/docs/running-pants-from-sources#running-pants-from-sources-in-other-repos), I've curled the pants_from_sources, made it executable, ran it, and I have a mainline pants repo in a sibling repo - but regardless of anything I do (including trying other pants tags), I always get
ValueError: not enough values to unpack (expected 1, got 0)
for parse_requirements (full stacktrace in thread). Can that
pants_from_sources
be run (to test) without editing? Or do I need to fill out the backend_packages, pythonpath, and plugins for it to work?
Copy code
Exception caught: (pants.engine.internals.scheduler.ExecutionError)
  File "/Users/sj/Developer/oss/pants/src/python/pants/bin/pants_loader.py", line 119, in <module>
    main()
  File "/Users/sj/Developer/oss/pants/src/python/pants/bin/pants_loader.py", line 115, in main
    PantsLoader.main()
  File "/Users/sj/Developer/oss/pants/src/python/pants/bin/pants_loader.py", line 111, in main
    cls.run_default_entrypoint()
  File "/Users/sj/Developer/oss/pants/src/python/pants/bin/pants_loader.py", line 93, in run_default_entrypoint
    exit_code = runner.run(start_time)
  File "/Users/sj/Developer/oss/pants/src/python/pants/bin/pants_runner.py", line 97, in run
    runner = LocalPantsRunner.create(
  File "/Users/sj/Developer/oss/pants/src/python/pants/bin/local_pants_runner.py", line 118, in create
    build_config, options = options_initializer.build_config_and_options(
  File "/Users/sj/Developer/oss/pants/src/python/pants/init/options_initializer.py", line 107, in build_config_and_options
    build_config = _initialize_build_configuration(
  File "/Users/sj/Developer/oss/pants/src/python/pants/init/options_initializer.py", line 47, in _initialize_build_configuration
    working_set = plugin_resolver.resolve(options_bootstrapper, env)
  File "/Users/sj/Developer/oss/pants/src/python/pants/init/plugin_resolver.py", line 123, in resolve
    for resolved_plugin_location in self._resolve_plugins(options_bootstrapper, env):
  File "/Users/sj/Developer/oss/pants/src/python/pants/init/plugin_resolver.py", line 146, in _resolve_plugins
    session.product_request(ResolvedPluginDistributions, [self._request])[0],
  File "/Users/sj/Developer/oss/pants/src/python/pants/engine/internals/scheduler.py", line 564, in product_request
    self._raise_on_error([t for _, t in throws])
  File "/Users/sj/Developer/oss/pants/src/python/pants/engine/internals/scheduler.py", line 499, in _raise_on_error
    raise ExecutionError(

Exception message: 1 Exception encountered:

Engine traceback:
  in select
  in pants.init.plugin_resolver.resolve_plugins
  in pants.backend.python.util_rules.pex.create_venv_pex (pants_plugins.pex)
  in pants.backend.python.util_rules.pex.build_pex (pants_plugins.pex)
  in pants.engine.process.fallible_to_exec_result_or_raise
Traceback (most recent call last):
  File "/Users/sj/Developer/oss/pants/src/python/pants/engine/process.py", line 282, in fallible_to_exec_result_or_raise
    raise ProcessExecutionFailure(
pants.engine.process.ProcessExecutionFailure: Process 'Resolving plugins: ' failed with exit code 1.
stdout:

stderr:
Traceback (most recent call last):
  File "/Users/sj/.cache/pants/named_caches/pex_root/unzipped_pexes/43e6213d762a85cdfe3a5ba8fae598cdd810eb99/.bootstrap/pex/pex.py", line 476, in execute
    exit_value = self._wrap_coverage(self._wrap_profiling, self._execute)
  File "/Users/sj/.cache/pants/named_caches/pex_root/unzipped_pexes/43e6213d762a85cdfe3a5ba8fae598cdd810eb99/.bootstrap/pex/pex.py", line 401, in _wrap_coverage
    return runner(*args)
  File "/Users/sj/.cache/pants/named_caches/pex_root/unzipped_pexes/43e6213d762a85cdfe3a5ba8fae598cdd810eb99/.bootstrap/pex/pex.py", line 432, in _wrap_profiling
    return runner(*args)
  File "/Users/sj/.cache/pants/named_caches/pex_root/unzipped_pexes/43e6213d762a85cdfe3a5ba8fae598cdd810eb99/.bootstrap/pex/pex.py", line 532, in _execute
    return self.execute_entry(self._pex_info.entry_point)
  File "/Users/sj/.cache/pants/named_caches/pex_root/unzipped_pexes/43e6213d762a85cdfe3a5ba8fae598cdd810eb99/.bootstrap/pex/pex.py", line 668, in execute_entry
    return self.execute_pkg_resources(entry_point)
  File "/Users/sj/.cache/pants/named_caches/pex_root/unzipped_pexes/43e6213d762a85cdfe3a5ba8fae598cdd810eb99/.bootstrap/pex/pex.py", line 700, in execute_pkg_resources
    return runner()
  File "/Users/sj/.cache/pants/named_caches/pex_root/installed_wheels/f5f24693b0e9ee59a7c54d4d4dcd46e0714353cc/pex-2.1.61-py2.py3-none-any.whl/pex/bin/pex.py", line 683, in main
    do_main(
  File "/Users/sj/.cache/pants/named_caches/pex_root/installed_wheels/f5f24693b0e9ee59a7c54d4d4dcd46e0714353cc/pex-2.1.61-py2.py3-none-any.whl/pex/bin/pex.py", line 704, in do_main
    pex_builder = build_pex(
  File "/Users/sj/.cache/pants/named_caches/pex_root/installed_wheels/f5f24693b0e9ee59a7c54d4d4dcd46e0714353cc/pex-2.1.61-py2.py3-none-any.whl/pex/bin/pex.py", line 593, in build_pex
    result = resolve(
  File "/Users/sj/.cache/pants/named_caches/pex_root/installed_wheels/f5f24693b0e9ee59a7c54d4d4dcd46e0714353cc/pex-2.1.61-py2.py3-none-any.whl/pex/resolver.py", line 907, in resolve
    direct_requirements = _parse_reqs(requirements, requirement_files, network_configuration)
  File "/Users/sj/.cache/pants/named_caches/pex_root/installed_wheels/f5f24693b0e9ee59a7c54d4d4dcd46e0714353cc/pex-2.1.61-py2.py3-none-any.whl/pex/resolver.py", line 793, in _parse_reqs
    return requirement_configuration.parse_requirements(network_configuration=network_configuration)
  File "/Users/sj/.cache/pants/named_caches/pex_root/installed_wheels/f5f24693b0e9ee59a7c54d4d4dcd46e0714353cc/pex-2.1.61-py2.py3-none-any.whl/pex/resolve/requirement_configuration.py", line 29, in parse_requirements
    parsed_requirements.extend(parse_requirement_strings(self.requirements))
  File "/Users/sj/.cache/pants/named_caches/pex_root/installed_wheels/f5f24693b0e9ee59a7c54d4d4dcd46e0714353cc/pex-2.1.61-py2.py3-none-any.whl/pex/requirements.py", line 646, in parse_requirement_strings
    yield _parse_requirement_line(
  File "/Users/sj/.cache/pants/named_caches/pex_root/installed_wheels/f5f24693b0e9ee59a7c54d4d4dcd46e0714353cc/pex-2.1.61-py2.py3-none-any.whl/pex/requirements.py", line 498, in _parse_requirement_line
    return PyPIRequirement(line, Requirement.parse(processed_text), editable=editable)
  File "/Users/sj/.cache/pants/named_caches/pex_root/installed_wheels/f5f24693b0e9ee59a7c54d4d4dcd46e0714353cc/pex-2.1.61-py2.py3-none-any.whl/pex/vendor/_vendored/setuptools/pkg_resources/__init__.py", line 3180, in parse
    req, = parse_requirements(s)
ValueError: not enough values to unpack (expected 1, got 0)
p

polite-garden-50641

02/03/2022, 4:47 PM
can you create a GH issue w/ full stack trace of the exceptions ? seems like a bug in pex... or something.
e

enough-analyst-54434

02/03/2022, 4:50 PM
'Resolving plugins ' and no plugins listed. Looks like a funky config / option.
b

bitter-ability-32190

02/03/2022, 4:51 PM
./pants_from_soruces
doesn't play nicely with
plugins
I had this issue prior
I think you have to duplicate the plugins in the source of
./pants_from_sources
w

wide-midnight-78598

02/03/2022, 4:53 PM
@enough-analyst-54434 I didn't touch the pants_from_sources file after I curled it - I wanted to let it compile and run blank before I started messing around.
@bitter-ability-32190 can you throw down an example? Not sure what you mean
b

bitter-ability-32190

02/03/2022, 4:55 PM
open up
./pants_from_sources
in an editor, there should be a place for you to duplicate your plugins
w

wide-midnight-78598

02/03/2022, 4:56 PM
ah, i see what you mean - from my toml
So, what I ended up doing, which appears to be working is just commenting out backend_packages, pythonpath, and plugins 🤷
w

witty-crayon-22786

02/03/2022, 6:31 PM
yea, the example
pants_from_sources
needs cleanup… you can delete almost everything in there
unfortunately it’s been copy-pastad a few times
the bulk of the “run from sources” logic is actually in the
pantsbuild/pants
pants
script, and it supports being used relatively as
../pants
… so the thing that you put in an adjacent repo is mostly just a shorthand i think
i’ll open a PR to clean up the one linked there.