blob: f2062b46261a2c228b4927268c679da68f433414 [file] [log] [blame] [view]
Mike Frysingere7379dc2019-01-30 14:35:39 -05001# Supported Python Versions
2
Mike Frysingera99f19f2024-01-04 12:41:32 -05003> **Warning: The "master" branch is no longer used. Use "main" instead.**<br>
4> https://gerrit.googlesource.com/git-repo/+/HEAD/docs/python-support.md
5
Mike Frysingere7379dc2019-01-30 14:35:39 -05006With Python 2.7 officially going EOL on [01 Jan 2020](https://pythonclock.org/),
7we need a support plan for the repo project itself.
8Inevitably, there will be a long tail of users who still want to use Python 2 on
9their old LTS/corp systems and have little power to change the system.
10
11## Summary
12
Mike Frysingerd1e93dd2019-10-10 18:34:39 -040013* Python 3.6 (released Dec 2016) is required by default starting with repo-2.x.
Mike Frysingere7379dc2019-01-30 14:35:39 -050014* Older versions of Python (e.g. v2.7) may use the legacy feature-frozen branch
Mike Frysingerd1e93dd2019-10-10 18:34:39 -040015 based on repo-1.x.
Mike Frysingere7379dc2019-01-30 14:35:39 -050016
17## Overview
18
19We provide a branch for Python 2 users that is feature-frozen.
20Bugfixes may be added on a best-effort basis or from the community, but largely
21no new features will be added, nor is support guaranteed.
22
23Users can select this during `repo init` time via the [repo launcher].
24Otherwise the default branches (e.g. stable & master) will be used which will
25require Python 3.
26
27This means the [repo launcher] needs to support both Python 2 & Python 3, but
28since it doesn't import any other repo code, this shouldn't be too problematic.
29
30The master branch will require Python 3.6 at a minimum.
31If the system has an older version of Python 3, then users will have to select
32the legacy Python 2 branch instead.
33
Mike Frysingerf7c51602019-06-18 17:23:39 -040034### repo hooks
Mike Frysingere7379dc2019-01-30 14:35:39 -050035
Mike Frysingerf7c51602019-06-18 17:23:39 -040036Projects that use [repo hooks] run on independent schedules.
37They might migrate to Python 3 earlier or later than us.
38To support them, we'll probe the shebang of the hook script and if we find an
39interpreter in there that indicates a different version than repo is currently
40running under, we'll attempt to reexec ourselves under that.
41
42For example, a hook with a header like `#!/usr/bin/python2` will have repo
43execute `/usr/bin/python2` to execute the hook code specifically if repo is
44currently running Python 3.
45
46For more details, consult the [repo hooks] documentation.
47
48
49[repo hooks]: ./repo-hooks.md
Mike Frysingere7379dc2019-01-30 14:35:39 -050050[repo launcher]: ../repo