|
| 1 | +PEP: 807 |
| 2 | +Title: Creation of a CPython mirror |
| 3 | +Author: Stan Ulbrych <stanulbrych@gmail.com> |
| 4 | +Sponsor: Ezio Melotti <ezio.melotti@gmail.com> |
| 5 | +Discussions-To: Pending |
| 6 | +Status: Draft |
| 7 | +Type: Process |
| 8 | +Created: 10-Sep-2025 |
| 9 | + |
| 10 | + |
| 11 | +Abstract |
| 12 | +======== |
| 13 | + |
| 14 | +This PEP proposes the creation of an official read-only mirror of the |
| 15 | +`CPython Git repository <https://github.com/python/cpython>`_, |
| 16 | +currently hosted on GitHub (since :pep:`512`), on an additional hosting |
| 17 | +platform to improve resilience. |
| 18 | + |
| 19 | + |
| 20 | +Motivation |
| 21 | +========== |
| 22 | + |
| 23 | +The authors believe that mirroring the repository on an alternative |
| 24 | +platform will limit |
| 25 | +`vendor lock-in <https://en.wikipedia.org/wiki/Vendor_lock-in>`_ and improve |
| 26 | +the security, resilience, and accessibility of CPython without impacting the |
| 27 | +current development workflow. |
| 28 | +Currently, the up-to-date CPython source code is officially available only |
| 29 | +on GitHub, following the retirement of `hg.python.org <https://hg.python.org/>`_. |
| 30 | +The idea of a mirror was originally noted in :pep:`512#the-fate-of-hg-python-org`. |
| 31 | + |
| 32 | +.. note:: |
| 33 | + |
| 34 | + The standard clone of a repository does not pull all information, see |
| 35 | + the `Git documentation <https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---mirror>`_ |
| 36 | + for more information. |
| 37 | + |
| 38 | +Many open source projects provide mirrors, for example: |
| 39 | +`GNOME <https://github.com/GNOME>`_, `KDE <https://github.com/KDE?>`_, |
| 40 | +`Git <https://github.com/git/git>`_, `GCC <https://github.com/gcc-mirror/gcc>`_, |
| 41 | +`Linux <https://gitlab.com/linux-kernel/linux>`_, `curl <https://codeberg.org/curl/curl-mirror>`_, |
| 42 | +`FreeBSD <https://gitlab.com/FreeBSD/freebsd-src>`_, and `OpenBSD <https://github.com/openbsd/src>`_. |
| 43 | + |
| 44 | +Relying on a single storage provider carries the risk that, if the provider |
| 45 | +goes down, all data stored on the platform could be lost. |
| 46 | +This is similar to maintaining backups of personal data (photos, documents, etc.). |
| 47 | + |
| 48 | +In the event of a temporary outage, local development can still continue as |
| 49 | +one can pull the most recent state of the repository from the mirror. |
| 50 | +In the event of a permanent outage, having a mirror with the |
| 51 | +``python`` namespace would allow for a smoother migration to a new |
| 52 | +contribution platform as many things would already be set up, and |
| 53 | +a copy of the up-to-date source would be available. |
| 54 | + |
| 55 | +Some contributors prefer using open-source platforms to develop open source projects. |
| 56 | +Since `GitHub <github.com>`_ is not open source, a mirror would allow us to |
| 57 | +address this concern. Mirrors improve accessibility for contributors in regions |
| 58 | +where GitHub may be blocked [#ghcens]_ or slow. |
| 59 | + |
| 60 | + |
| 61 | +Rationale |
| 62 | +========= |
| 63 | + |
| 64 | +The mirror is **not** intended to replace the host for contributions |
| 65 | +(issues, pull requests, CI), but to provide an additional |
| 66 | +read-only distribution channel for the Git data (commits, branches, tags etc.) |
| 67 | +because having multiple contribution platforms would introduce excessive |
| 68 | +complexity and asynchrony. |
| 69 | + |
| 70 | +Mirrors require little maintenance and should not have a financial impact on |
| 71 | +the PSF, since many hosting providers offer free plans which are sufficient for |
| 72 | +a mirror. |
| 73 | + |
| 74 | + |
| 75 | +Specification |
| 76 | +============= |
| 77 | + |
| 78 | +The repository will be mirrored using Git's |
| 79 | +`--mirror <https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---mirror>`__ |
| 80 | +option, either using a platform's built-in integration [#gldoc]_ or a script. |
| 81 | +The repository should be in the platform's equivalent of the GitHub |
| 82 | +`python organization <https://github.com/python/>`_. |
| 83 | + |
| 84 | +To avoid confusion, all contribution-related tabs (Issues, Pull Requests, |
| 85 | +Discussions, etc.) will be disabled, and the fact that the repository is a |
| 86 | +mirror will be clearly noted in the description. |
| 87 | + |
| 88 | + |
| 89 | +Security Implications |
| 90 | +===================== |
| 91 | + |
| 92 | +This PEP increases the security workload, as two platforms must be secured. |
| 93 | +Because the mirror is read-only, some risks of compromise are alleviated, |
| 94 | +but not all. |
| 95 | + |
| 96 | +Access to the repository should follow the |
| 97 | +`principle of least privilege <https://en.wikipedia.org/wiki/Principle_of_least_privilege>`_. |
| 98 | + |
| 99 | + |
| 100 | +Backwards Compatibility |
| 101 | +======================= |
| 102 | + |
| 103 | +This PEP has no effect on existing contributor workflows. |
| 104 | + |
| 105 | + |
| 106 | +Open Questions |
| 107 | +============== |
| 108 | + |
| 109 | +What platform should be used? The platform should be free, so as not to have a |
| 110 | +financial impact on the PSF. There are several options, for example |
| 111 | +`GitLab <https://gitlab.com/>`_ and `Codeberg <https://codeberg.org/>`_. |
| 112 | + |
| 113 | + |
| 114 | +Footnotes |
| 115 | +========= |
| 116 | + |
| 117 | +.. [#ghcens] `Wikipedia: Censorship of GitHub <https://en.wikipedia.org/wiki/Censorship_of_GitHub>`_ |
| 118 | +
|
| 119 | +.. [#gldoc] `GitLab: Repository mirroring documentation <https://docs.gitlab.com/user/project/repository/mirror/>`_ |
| 120 | +
|
| 121 | +
|
| 122 | +Copyright |
| 123 | +========= |
| 124 | + |
| 125 | +This document is placed in the public domain or under the |
| 126 | +CC0-1.0-Universal license, whichever is more permissive. |
0 commit comments