symforce-org / symforce

Fast symbolic computation, code generation, and nonlinear optimization for robotics
https://symforce.org
Apache License 2.0
1.41k stars 145 forks source link

Update pip in CI #207

Closed bradley-solliday-skydio closed 1 year ago

bradley-solliday-skydio commented 2 years ago

Fixes an error which has popped up in the CI.

bradley-solliday-skydio commented 2 years ago

If you don't update pip, the CI gives this error while installing pip install build/lcmtypes/python2.7

Installing collected packages: lcmtypes
Successfully installed lcmtypes-0.5.0
--- Logging error ---
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_internal/utils/logging.py", line 177, in emit
    self.console.print(renderable, overflow="ignore", crop=False, style=style)
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_vendor/rich/console.py", line 1752, in print
    extend(render(renderable, render_options))
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_vendor/rich/console.py", line 1390, in render
    for render_output in iter_render:
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_internal/utils/logging.py", line 134, in __rich_console__
    for line in lines:
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_vendor/rich/segment.py", line 245, in split_lines
    for segment in segments:
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_vendor/rich/console.py", line 1368, in render
    renderable = rich_cast(renderable)
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_vendor/rich/protocol.py", line 36, in rich_cast
    renderable = cast_method()
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_internal/self_outdated_check.py", line 130, in __rich__
    pip_cmd = get_best_invocation_for_this_pip()
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_internal/utils/entrypoints.py", line 58, in get_best_invocation_for_this_pip
    if found_executable and os.path.samefile(
  File "/usr/lib/python3.8/genericpath.py", line 101, in samefile
    s2 = os.stat(f2)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/pip3.8'
Call stack:
  File "/home/runner/.local/bin/pip", line 8, in <module>
    sys.exit(main())
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 70, in main
    return command.main(cmd_args)
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 101, in main
    return self._main(args)
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line [22](https://github.com/bradley-solliday-skydio/symforce/runs/7663110710?check_suite_focus=true#step:11:23)3, in _main
    self.handle_pip_version_check(options)
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 148, in handle_pip_version_check
    pip_self_version_check(session, options)
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_internal/self_outdated_check.py", line [23](https://github.com/bradley-solliday-skydio/symforce/runs/7663110710?check_suite_focus=true#step:11:24)7, in pip_self_version_check
    logger.info("[present-rich] %s", upgrade_prompt)
  File "/usr/lib/python3.8/logging/__init__.py", line 1[44](https://github.com/bradley-solliday-skydio/symforce/runs/7663110710?check_suite_focus=true#step:11:45)6, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/lib/python3.8/logging/__init__.py", line 1589, in _log
    self.handle(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 1599, in handle
    self.callHandlers(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 1661, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 9[54](https://github.com/bradley-solliday-skydio/symforce/runs/7663110710?check_suite_focus=true#step:11:55), in handle
    self.emit(record)
  File "/home/runner/.local/lib/python3.8/site-packages/pip/_internal/utils/logging.py", line 179, in emit
    self.handleError(record)
Message: '[present-rich] %s'
Arguments: (UpgradePrompt(old='22.1.2', new='22.2.2'),)
aaron-skydio commented 2 years ago

I'm a little confused what changed here such that we're seeing this now. I'd also strongly lean towards upgrading the pinned version of pip in our dev_requirements.txt if we in fact need the new version, rather than blindly upgrading to latest. Or we should at least install to some known pinned version if pip install -r dev_requirements.txt doesn't install the correct version of pip for some reason

bradley-solliday-skydio commented 1 year ago

CI is passing without this, so evidently it's no longer necessary.