blob: e4ee96c48646f58723f1ac45832a01782935caab [file] [log] [blame] [view]
Mike Frysingere7379dc2019-01-30 14:35:39 -05001# Supported Python Versions
2
Mike Frysinger1544afe2023-10-14 02:10:39 +05453This documents the current supported Python versions, and tries to provide
4guidance for when we decide to drop support for older versions.
Mike Frysingere7379dc2019-01-30 14:35:39 -05005
6## Summary
7
Mike Frysinger1544afe2023-10-14 02:10:39 +05458* Python 3.6 (released Dec 2016) is required starting with repo-2.0.
9* Older versions of Python (e.g. v2.7) may use old releases via the repo-1.x
10 branch, but no support is provided.
Mike Frysingere7379dc2019-01-30 14:35:39 -050011
Mike Frysinger1544afe2023-10-14 02:10:39 +054512## repo hooks
Mike Frysingere7379dc2019-01-30 14:35:39 -050013
Mike Frysingerf7c51602019-06-18 17:23:39 -040014Projects that use [repo hooks] run on independent schedules.
Mike Frysinger1544afe2023-10-14 02:10:39 +054515Since it's not possible to detect what version of Python the hooks were written
16or tested against, we always import & exec them with the active Python version.
Mike Frysingerf7c51602019-06-18 17:23:39 -040017
Mike Frysinger1544afe2023-10-14 02:10:39 +054518If the user's Python is too new for the [repo hooks], then it is up to the hooks
19maintainer to update.
Mike Frysingerf7c51602019-06-18 17:23:39 -040020
Mike Frysinger1544afe2023-10-14 02:10:39 +054521## Repo launcher
22
23The [repo launcher] is an independent script that can support older versions of
24Python without holding back the rest of the codebase.
25If it detects the current version of Python is too old, it will try to reexec
26via a newer version of Python via standard `pythonX.Y` interpreter names.
27
28However, this is provided as a nicety when it is not onerous, and there is no
29official support for older versions of Python than the rest of the codebase.
30
31If your default python interpreters are too old to run the launcher even though
32you have newer versions installed, your choices are:
33
34* Modify the [repo launcher]'s shebang to suite your environment.
35* Download an older version of the [repo launcher] and don't upgrade it.
36 Be aware that there is no guarantee old repo launchers are WILL work with
37 current versions of repo. Bug reports using old launchers will not be
38 accepted.
39
40## When to drop support
41
42So far, Python 3.6 has provided most of the interesting features that we want
43(e.g. typing & f-strings), and there haven't been features in newer versions
44that are critical to us.
45
46That said, let's assume we need functionality that only exists in Python 3.7.
47How do we decide when it's acceptable to drop Python 3.6?
48
491. Review the [Project References](./release-process.md#project-references) to
50 see what major distros are using the previous version of Python, and when
51 they go EOL. Generally we care about Ubuntu LTS & current/previous Debian
52 stable versions.
53 * If they're all EOL already, then go for it, drop support.
54 * If they aren't EOL, start a thread on [repo-discuss] to see how the user
55 base feels about the proposal.
561. Update the "soft" versions in the codebase. This will start warning users
57 that the older version is deprecated.
58 * Update [repo](/repo) if the launcher needs updating.
59 This only helps with people who download newer launchers.
60 * Update [main.py](/main.py) for the main codebase.
61 This warns for everyone regardless of [repo launcher] version.
62 * Update [requirements.json](/requirements.json).
63 This allows [repo launcher] to display warnings/errors without having
64 to execute the new codebase. This helps in case of syntax or module
65 changes where older versions won't even be able to import the new code.
661. After some grace period (ideally at least 2 quarters after the first release
67 with the updated soft requirements), update the "hard" versions, and then
68 start using the new functionality.
69
70## Python 2.7 & 3.0-3.5
71
72> **There is no support for these versions.**
73> **Do not file bugs if you are using old Python versions.**
74> **Any such reports will be marked invalid and ignored.**
75> **Upgrade your distro and/or runtime instead.**
76
77Fetch an old version of the [repo launcher]:
78
79```sh
80$ curl https://storage.googleapis.com/git-repo-downloads/repo-2.32 > ~/.bin/repo-2.32
81$ chmod a+rx ~/.bin/repo-2.32
82```
83
84Then initialize an old version of repo:
85
86```sh
87$ repo-2.32 init --repo-rev=repo-1 ...
88```
Mike Frysingerf7c51602019-06-18 17:23:39 -040089
90
Mike Frysinger1544afe2023-10-14 02:10:39 +054591[repo-discuss]: https://groups.google.com/forum/#!forum/repo-discuss
Mike Frysingerf7c51602019-06-18 17:23:39 -040092[repo hooks]: ./repo-hooks.md
Mike Frysingere7379dc2019-01-30 14:35:39 -050093[repo launcher]: ../repo