Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"SyntaxError: invalid syntax" at os_detect_ on Ubuntu 16.04 #143

Closed
130s opened this issue Apr 19, 2021 · 4 comments
Closed

"SyntaxError: invalid syntax" at os_detect_ on Ubuntu 16.04 #143

130s opened this issue Apr 19, 2021 · 4 comments

Comments

@130s
Copy link

130s commented Apr 19, 2021

Problem

Dev-installing the latest main on 16.04 (where Python3 is 3.5) I get this. Confirmed on a native host and a Docker container.

Citing the result from Docker container.
$ docker run -it -v /home/noodle/repos/osrf/rocker:/cws/rocker ubuntu:xenial bash

root@f1c29e17b557:/# apt update
# cd %ROCKER% && git log --oneline -2
7351432 (HEAD -> feature-mount, plusone-robotics/feature-mount) Document --volume
a735938 [volume] Rename from 'mount' (addressing https://github.com/osrf/rocker/pull/46#discussion_r301416615)

# pip3 install --user . 
# find ~/.local/ -iname rocker*
/root/.local/bin/rocker
/root/.local/lib/python3.5/site-packages/rocker
/root/.local/lib/python3.5/site-packages/rocker-0.2.3.egg-info

root@f1c29e17b557:/cws/rocker# /root/.local/bin/rocker --help
Traceback (most recent call last):
  File "/root/.local/bin/rocker", line 9, in <module>
    load_entry_point('rocker==0.2.3', 'console_scripts', 'rocker')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2229, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2235, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/root/.local/lib/python3.5/site-packages/rocker/cli.py", line 26, in <module>
    from .os_detector import detect_os
  File "/root/.local/lib/python3.5/site-packages/rocker/os_detector.py", line 60
    tag="rocker:" + f"os_detect_{image_name}".replace(':', '_').replace('/', '_')
                                            ^
SyntaxError: invalid syntax
root@f1c29e17b557:/cws/rocker# python3 --version
Python 3.5.2

Although, this doesn't happen with the version 0.2.3 taken from apt.

Potential fix

Ubuntu 16.04 is ending the life and Py3.5 has EoLed. So I'm not sure how much we want to fix this?

@130s
Copy link
Author

130s commented Apr 19, 2021

Although, this doesn't happen with the version 0.2.3 taken from apt.

The result in OP was from the branch in #142 but even I switched to main, the same happens.

$ git log --oneline -2
9d7a392 (HEAD -> main, origin/master, origin/main, origin/HEAD) add an action to mirror main to master Providing backwards compatibility for renaming master to main
695734c git extension supporting user override and full coverage (#138)

@130s
Copy link
Author

130s commented Apr 19, 2021

Since I have a project with Ubuntu 16.04 and it's unclear when we'd switch to OS with newer Python, I made #144.

@malban
Copy link

malban commented Aug 9, 2021

Although, this doesn't happen with the version 0.2.3 taken from apt.

Now that 0.2.4 is the version apt installs for xenial, the 0.2.4 xenial apt package is broken.

It should be a trivial change to fix:

tag="rocker:" + f"os_detect_{image_name}".replace(':', '_').replace('/', '_')

to

tag="rocker:" + "os_detect_{}".format(image_name).replace(':', '_').replace('/', '_')

@tfoote
Copy link
Collaborator

tfoote commented Aug 11, 2021

I'm going to close this as xenial is EOL and which was the last python 3.5 platform.

@tfoote tfoote closed this as completed Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants