Hi~ I’m upgrading from pants 1.25.0 to 1.26.0. `./...
# general
f
Hi~ I’m upgrading from pants 1.25.0 to 1.26.0.
./pants --version
works fine, but when I build my binary, I encounter this error:
Copy code
ERROR: Command errored out with exit status 1:
   command: /usr/bin/python2.7 /tmp/tmp35l8p0cf/.deps/pip/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpPhYaZM
       cwd: /tmp/pip-download-Ku1TIN/gevent
  Complete output (10 lines):
  Traceback (most recent call last):
    File "/tmp/tmp35l8p0cf/.deps/pip/pip/_vendor/pep517/_in_process.py", line 257, in <module>
      main()
    File "/tmp/tmp35l8p0cf/.deps/pip/pip/_vendor/pep517/_in_process.py", line 240, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/tmp/tmp35l8p0cf/.deps/pip/pip/_vendor/pep517/_in_process.py", line 85, in get_requires_for_build_wheel
      backend = _build_backend()
    File "/tmp/tmp35l8p0cf/.deps/pip/pip/_vendor/pep517/_in_process.py", line 76, in _build_backend
      obj = getattr(obj, path_part)
  AttributeError: 'module' object has no attribute '__legacy__'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python2.7 /tmp/tmp35l8p0cf/.deps/pip/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpPhYaZM Check the logs for full command output.
19:05:57 [DEBUG] pants.process.lock:pid=7609: releasing lock: <pants.process.lock.OwnerPrintingInterProcessFileLock object at 0x7d76780ecd68>

               Waiting for background workers to finish.
12:05:57 00:32   [complete]
               FAILURE
timestamp: 2022-04-03T12:05:57.308688
Exception caught: (pex.resolver.Unsatisfiable)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/bin/pants", line 8, in <module>
    sys.exit(main())
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/pants_loader.py", line 94, in main
    PantsLoader.run()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/pants_loader.py", line 90, in run
    cls.load_and_execute(entrypoint)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/pants_loader.py", line 83, in load_and_execute
    entrypoint_main()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/pants_exe.py", line 32, in main
    PantsRunner(start_time=start_time).run()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/pants_runner.py", line 115, in run
    return runner.run()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 293, in run
    self._run()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 389, in _run
    goal_runner_result = self._maybe_run_v1()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 330, in _maybe_run_v1
    self._exiter,
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/goal_runner.py", line 230, in run
    return self._run_goals()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/goal_runner.py", line 201, in _run_goals
    result = self._execute_engine()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/goal_runner.py", line 189, in _execute_engine
    result = engine.execute(self._context, self._goals)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/engine/legacy_engine.py", line 21, in execute
    self.attempt(context, goals)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/engine/round_engine.py", line 252, in attempt
    goal_executor.attempt(explain)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/engine/round_engine.py", line 50, in attempt
    task.execute()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/backend/python/tasks/resolve_requirements.py", line 29, in execute
    pex = self.resolve_requirements(interpreter, self.context.targets(has_python_requirements))
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/backend/python/tasks/resolve_requirements_task_base.py", line 96, in resolve_requirements
    pex_builder.add_requirement_libs_from(req_libs, platforms=platforms)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/python/pex_build_util.py", line 202, in add_requirement_libs_from
    self.add_resolved_requirements(reqs, platforms=platforms)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/python/pex_build_util.py", line 275, in add_resolved_requirements
    distributions = self.resolve_distributions(reqs, platforms=platforms)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/python/pex_build_util.py", line 251, in resolve_distributions
    self._builder.interpreter, list(deduped_reqs), platforms, list(find_links),
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/python/pex_build_util.py", line 339, in _resolve_multi
    manylinux=python_setup.manylinux,
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pex/resolver.py", line 722, in resolve
    return list(resolve_request.resolve_distributions(ignore_errors=ignore_errors))
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pex/resolver.py", line 521, in resolve_distributions
    raise_type=Unsatisfiable):
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pex/resolver.py", line 392, in _run_parallel
    max_jobs=self._max_parallel_jobs
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pex/jobs.py", line 219, in execute_parallel
    raise error
Looks like a python2 syntax error again, though I have no idea how to fix this. Thanks!
Can anyone help me on this~? Thx!
h
Looks like you've hit this bug in the underlying pip: https://github.com/pypa/setuptools/issues/1694#issuecomment-466010982
But I don't know on which package it is erroring
Is there any more info before or after this error if you run with
-ldebug
?
f
hmm I think that’s the result of
-ldebug
I clean up the
.cache
and
.pants.d
and rerun again. I got a different error message:
Copy code
ERROR: Package 'rsa' requires a different Python: 2.7.12 not in '>=3.5, <4'
00:36:23 [DEBUG] pants.process.lock:pid=12378: releasing lock: <pants.process.lock.OwnerPrintingInterProcessFileLock object at 0x7d8735754710>

               Waiting for background workers to finish.
17:36:23 00:33   [complete]
               FAILURE
timestamp: 2022-04-05T17:36:23.420379
Exception caught: (pex.resolver.Unsatisfiable)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/bin/pants", line 8, in <module>
    sys.exit(main())
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/pants_loader.py", line 94, in main
    PantsLoader.run()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/pants_loader.py", line 90, in run
    cls.load_and_execute(entrypoint)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/pants_loader.py", line 83, in load_and_execute
    entrypoint_main()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/pants_exe.py", line 32, in main
    PantsRunner(start_time=start_time).run()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/pants_runner.py", line 115, in run
    return runner.run()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 293, in run
    self._run()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 389, in _run
    goal_runner_result = self._maybe_run_v1()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 330, in _maybe_run_v1
    self._exiter,
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/goal_runner.py", line 230, in run
    return self._run_goals()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/goal_runner.py", line 201, in _run_goals
    result = self._execute_engine()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/bin/goal_runner.py", line 189, in _execute_engine
    result = engine.execute(self._context, self._goals)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/engine/legacy_engine.py", line 21, in execute
    self.attempt(context, goals)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/engine/round_engine.py", line 252, in attempt
    goal_executor.attempt(explain)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/engine/round_engine.py", line 50, in attempt
    task.execute()
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/backend/python/tasks/resolve_requirements.py", line 29, in execute
    pex = self.resolve_requirements(interpreter, self.context.targets(has_python_requirements))
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/backend/python/tasks/resolve_requirements_task_base.py", line 96, in resolve_requirements
    pex_builder.add_requirement_libs_from(req_libs, platforms=platforms)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/python/pex_build_util.py", line 202, in add_requirement_libs_from
    self.add_resolved_requirements(reqs, platforms=platforms)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/python/pex_build_util.py", line 275, in add_resolved_requirements
    distributions = self.resolve_distributions(reqs, platforms=platforms)
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/python/pex_build_util.py", line 251, in resolve_distributions
    self._builder.interpreter, list(deduped_reqs), platforms, list(find_links),
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pants/python/pex_build_util.py", line 339, in _resolve_multi
    manylinux=python_setup.manylinux,
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pex/resolver.py", line 722, in resolve
    return list(resolve_request.resolve_distributions(ignore_errors=ignore_errors))
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pex/resolver.py", line 521, in resolve_distributions
    raise_type=Unsatisfiable):
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pex/resolver.py", line 392, in _run_parallel
    max_jobs=self._max_parallel_jobs
  File "/home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.26.0_py37/lib/python3.7/site-packages/pex/jobs.py", line 219, in execute_parallel
    raise error
👀 1
h
Huh. Do you expect Python two or Python three to be used?
I'm logging off for the night, but I'm curious at which point pex changed from using its own resolver to instead using PIP. I wonder if this is related
f
There are a few scripts in my
bin
that use
compatibility='CPython>=3.5'
h
Your codebase is 2.7 right?
What command are you running, and what is the full output? Or is that it?
f
oh I see. I ran two different
./pants binary … -ldebug --print-exception-stacktrace
One got this result :
The other is this:
These are the full output
h
And can you post your full
pants.ini
?
Not sure where this
>=3.5, <4
is coming from
Oh, that is coming from whichever version of
rsa
is being pulled in
One weird thing - you're resolving for
luigi==2.7.1.9
(which I guess comes from your requirements.txt?) but there is no such version of luigi
That I can find anyway
f
There are something like this in BUILD:
Copy code
python_requirement_library(
    name='ruamel_0_16_10',
    requirements=[
        python_requirement(
            name='ruamel.yaml',
            requirement='ruamel.yaml==0.16.10',
            compatibility='CPython>=3.5'),
    ],
)
Are these the reason that I need python>=3.5?
Right now the
pants.toml
is like this:
Copy code
[GLOBAL]
pants_version= "1.26.0"
build_file_imports = "warn"
binaries_path_by_id ="""
{('darwin', '18'): ('mac', '10.13')}
"""
fail_fast = "True"

[python-setup]
interpreter_constraints = ['CPython>=2.7,<3']

[pytest]
version = "pytest==4.6.6"
pytest_plugins = ["zipp==1.0.0"]
@happy-kitchen-89482 Any idea?
h
I would guess so. If your code requires Python 2.7 then I don't see how that requirement can work for you?
Interesting how that compatibility ended up there, but I would try removing it