git-repo/docs/python-support.md
Mike Frysinger d1e93dd58a python-support: adjust major versions
The plan previously documented was <=1.13.x is Python 2 and >=1.14.x
is Python 3.  Other projects that migrated Python versions and drop
support for older have tended to take a more drastic version jump to
make it clearer to users.  So lets adjust the plan to say <=1.x will
support Python 2, and >=2.x will be Python 3-only.

This also allows us to harmonize the repo launcher version.  It is
currently sitting at v1.26 and has been incremented independently of
the repo version for the life of the project.  While we might know
these lower nuances, pretty much no one else does and it just leads
to confusion: do I know version 1.26 or version 1.13.7?  Or do I
have both?  What does that even mean?

Once we update the major version to 2.0.0, we can also adjust the
launcher script to 2.0.0, and then the launcher release process will
be tied to a new repo release in general.

Bug: https://crbug.com/gerrit/10418
Change-Id: Idb2257371a06e56d2923cf717345c028f49176a2
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/240372
Reviewed-by: David Pursehouse <dpursehouse@collab.net>
Tested-by: Mike Frysinger <vapier@google.com>
2019-10-11 06:56:03 +00:00

1.8 KiB

Supported Python Versions

With Python 2.7 officially going EOL on 01 Jan 2020, we need a support plan for the repo project itself. Inevitably, there will be a long tail of users who still want to use Python 2 on their old LTS/corp systems and have little power to change the system.

Summary

  • Python 3.6 (released Dec 2016) is required by default starting with repo-2.x.
  • Older versions of Python (e.g. v2.7) may use the legacy feature-frozen branch based on repo-1.x.

Overview

We provide a branch for Python 2 users that is feature-frozen. Bugfixes may be added on a best-effort basis or from the community, but largely no new features will be added, nor is support guaranteed.

Users can select this during repo init time via the repo launcher. Otherwise the default branches (e.g. stable & master) will be used which will require Python 3.

This means the repo launcher needs to support both Python 2 & Python 3, but since it doesn't import any other repo code, this shouldn't be too problematic.

The master branch will require Python 3.6 at a minimum. If the system has an older version of Python 3, then users will have to select the legacy Python 2 branch instead.

repo hooks

Projects that use repo hooks run on independent schedules. They might migrate to Python 3 earlier or later than us. To support them, we'll probe the shebang of the hook script and if we find an interpreter in there that indicates a different version than repo is currently running under, we'll attempt to reexec ourselves under that.

For example, a hook with a header like #!/usr/bin/python2 will have repo execute /usr/bin/python2 to execute the hook code specifically if repo is currently running Python 3.

For more details, consult the repo hooks documentation.