[solved] repo tool on Ubuntu 14.04 (Python 3.5)

441 views
Skip to first unread message

Christian Gagneraud

unread,
Sep 2, 2023, 9:05:23 PM9/2/23
to Repo and Gerrit Discussion
Hi there,

We have a build environment that is (still) based on Python 3.5 and we
need to use the repo tool within that old env.
Any recommendations on the repo tool version I should use with python 3.5?

looking into git history [1]
Jan 2021 launcher: support Python 3.5 for now
Jan 2021 main: require Python 3.5 now
April 2021 tox: enable python 3.5 & 3.9 testing
June 2021 Drop support for Python 3.5

Looking at tags, it looks like v2.11 was released in January, and v2.16 in June.
Maybe v2.15.4 would be a good candidate?
I'm getting
[2023-09-02T23:47:05.352Z] repo: warning: your Python 3 version is no
longer supported; Please upgrade to Python 3.6+.
and then in RepoSourceVersion
[2023-09-02T23:47:05.352Z] TypeError: __init__() got an unexpected
keyword argument 'encoding'
Coming from
[2023-09-02T23:47:05.352Z] 0.00 git_command.py(77): result =
subprocess.run([GIT, 'describe', HEAD], stdout=subprocess.PIPE,
[2023-09-02T23:47:05.352Z] 0.00 git_command.py(78):
encoding='utf-8', env=env, check=False)

Posting my own investigation and solution:
so i've tried v2.14.5, v2.13.8 and they fail too, v2.12.2 seems to work.

So if for some reason you're stuck on Ubuntu 14.04, install python 3.5
and repo v2.12.x, set the environment variable REPO_REV and install
repo front end from
https://raw.githubusercontent.com/GerritCodeReview/git-repo/${REPO_REV}/repo

Cheers,
Chris

[1] https://github.com/search?q=repo%3AGerritCodeReview%2Fgit-repo+python+3.5&type=commits

Björn Pedersen

unread,
Sep 4, 2023, 2:55:35 AM9/4/23
to Repo and Gerrit Discussion
Christian Gagneraud schrieb am Sonntag, 3. September 2023 um 03:05:23 UTC+2:
Hi there,

We have a build environment that is (still) based on Python 3.5 and we
need to use the repo tool within that old env.
Any recommendations on the repo tool version I should use with python 3.5?


I would just install repo in a virtualenv and specifiy the pasth <virtualenv>/bin/repo  to use it. Then the python version for repo is simply decoupled from your project build python version. 

Christian Gagneraud

unread,
Sep 4, 2023, 4:38:59 AM9/4/23
to Björn Pedersen, Repo and Gerrit Discussion
On Mon, 4 Sept 2023 at 18:55, 'Björn Pedersen' via Repo and Gerrit
But it will still be a python 3.5 virtual env. virtualenv use the
"host" python interpreter.
Or maybe i'm missing smth here.

Chris

Björn Pedersen

unread,
Sep 4, 2023, 6:20:25 AM9/4/23
to Repo and Gerrit Discussion
Not necessarily,  if the host only has a python 3.5 you could use pyenv ( https://github.com/pyenv/pyenv) together with pyenv-virtualenv to setup  amdoern python for repo.


Chris

Christian Gagneraud

unread,
Sep 5, 2023, 9:13:53 PM9/5/23
to Björn Pedersen, Repo and Gerrit Discussion
On Mon, 4 Sept 2023 at 22:20, 'Björn Pedersen' via Repo and Gerrit
Discussion <repo-d...@googlegroups.com> wrote:
> Christian Gagneraud schrieb am Montag, 4. September 2023 um 10:38:59 UTC+2:
> On Mon, 4 Sept 2023 at 18:55, 'Björn Pedersen' via Repo and Gerrit
> Discussion <repo-d...@googlegroups.com> wrote:
> > Christian Gagneraud schrieb am Sonntag, 3. September 2023 um 03:05:23 UTC+2:
> >
> > Hi there,
> >
> > We have a build environment that is (still) based on Python 3.5 and we
> > need to use the repo tool within that old env.
> > Any recommendations on the repo tool version I should use with python 3.5?
> >
> >
> > I would just install repo in a virtualenv and specifiy the pasth <virtualenv>/bin/repo to use it. Then the python version for repo is simply decoupled from your project build python version.
>
> But it will still be a python 3.5 virtual env. virtualenv use the
> "host" python interpreter.
> Or maybe i'm missing smth here.
>
>
> Not necessarily, if the host only has a python 3.5 you could use pyenv ( https://github.com/pyenv/pyenv) together with pyenv-virtualenv to setup amdoern python for repo.

Thanks for the tip, i was able to install python 3.6 (newer versions
have issues with libssl).
I can now run the latest repo and python-gerrit-api!
I had to update git too as it was very slow for some strange reason.

Thanks,
Chris
Reply all
Reply to author
Forward
0 new messages