-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
PEP 9999: Creation of a CPython mirror #4583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| PEP: 807 | ||
| Title: Creation of a CPython mirror | ||
| Author: Stan Ulbrych <stanulbrych@gmail.com> | ||
| Sponsor: Ezio Melotti <ezio.melotti@gmail.com> | ||
| Discussions-To: https://discuss.python.org/t/103671 | ||
| Status: Draft | ||
| Type: Process | ||
| Created: 10-Sep-2025 | ||
| Post-History: `10-Sep-2025 <https://discuss.python.org/t/103671>`__ | ||
|
|
||
|
|
||
| Abstract | ||
| ======== | ||
|
|
||
| This PEP proposes the creation of an official read-only mirror of the | ||
| `CPython Git repository <https://github.com/python/cpython>`_, | ||
| currently hosted on GitHub (since :pep:`512`), on an additional hosting | ||
| platform to improve resilience. | ||
|
|
||
|
|
||
| Motivation | ||
| ========== | ||
|
|
||
| The authors believe that mirroring the repository on an alternative | ||
| platform will limit | ||
| `vendor lock-in <https://en.wikipedia.org/wiki/Vendor_lock-in>`_ and improve | ||
| the security, resilience, and accessibility of CPython without impacting the | ||
| current development workflow. | ||
| Currently, the up-to-date CPython source code is officially available only | ||
| on GitHub, following the retirement of `hg.python.org <https://hg.python.org/>`_. | ||
| The idea of a mirror was originally noted in :pep:`512#the-fate-of-hg-python-org`. | ||
|
|
||
| .. note:: | ||
|
|
||
| The standard clone of a repository does not pull all information, see | ||
| the `Git documentation <https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---mirror>`_ | ||
| for more information. | ||
|
|
||
| Many open source projects provide mirrors, for example: | ||
| `GNOME <https://github.com/GNOME>`_, `KDE <https://github.com/KDE?>`_, | ||
| `Git <https://github.com/git/git>`_, `GCC <https://github.com/gcc-mirror/gcc>`_, | ||
| `Linux <https://gitlab.com/linux-kernel/linux>`_, `curl <https://codeberg.org/curl/curl-mirror>`_, | ||
| `FreeBSD <https://gitlab.com/FreeBSD/freebsd-src>`_, and `OpenBSD <https://github.com/openbsd/src>`_. | ||
|
|
||
| Relying on a single storage provider carries the risk that, if the provider | ||
| goes down, all data stored on the platform could be lost. | ||
| This is similar to maintaining backups of personal data (photos, documents, etc.). | ||
|
|
||
| In the event of a temporary outage, local development can still continue as | ||
| one can pull the most recent state of the repository from the mirror. | ||
| In the event of a permanent outage, having a mirror with the | ||
| ``python`` namespace would allow for a smoother migration to a new | ||
| contribution platform as many things would already be set up, and | ||
| a copy of the up-to-date source would be available. | ||
|
|
||
| Some contributors prefer using open-source platforms to develop open source projects. | ||
| Since `GitHub <github.com>`_ is not open source, a mirror would allow us to | ||
| address this concern. Mirrors improve accessibility for contributors in regions | ||
| where GitHub may be blocked [#ghcens]_ or slow. | ||
|
|
||
|
|
||
| Rationale | ||
| ========= | ||
|
|
||
| The mirror is **not** intended to replace the host for contributions | ||
| (issues, pull requests, CI), but to provide an additional | ||
| read-only distribution channel for the Git data (commits, branches, tags etc.) | ||
| because having multiple contribution platforms would introduce excessive | ||
| complexity and asynchrony. | ||
|
|
||
| Mirrors require little maintenance and should not have a financial impact on | ||
| the PSF, since many hosting providers offer free plans which are sufficient for | ||
| a mirror. | ||
|
|
||
|
|
||
| Specification | ||
| ============= | ||
|
|
||
| The repository will be mirrored using Git's | ||
| `--mirror <https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---mirror>`__ | ||
| option, either using a platform's built-in integration [#gldoc]_ or a script. | ||
| The repository should be in the platform's equivalent of the GitHub | ||
| `python organization <https://github.com/python/>`_. | ||
|
|
||
| To avoid confusion, all contribution-related tabs (Issues, Pull Requests, | ||
| Discussions, etc.) will be disabled, and the fact that the repository is a | ||
| mirror will be clearly noted in the description. | ||
|
|
||
|
|
||
| Security Implications | ||
| ===================== | ||
|
|
||
| This PEP increases the security workload, as two platforms must be secured. | ||
| Because the mirror is read-only, some risks of compromise are alleviated, | ||
| but not all. | ||
|
|
||
| Access to the repository should follow the | ||
| `principle of least privilege <https://en.wikipedia.org/wiki/Principle_of_least_privilege>`_. | ||
|
|
||
|
|
||
| Backwards Compatibility | ||
| ======================= | ||
|
|
||
| This PEP has no effect on existing contributor workflows. | ||
|
|
||
|
|
||
| Open Questions | ||
| ============== | ||
|
|
||
| What platform should be used? The platform should be free, so as not to have a | ||
| financial impact on the PSF. There are several options, for example | ||
| `GitLab <https://gitlab.com/>`_ and `Codeberg <https://codeberg.org/>`_. | ||
|
|
||
|
|
||
| Footnotes | ||
| ========= | ||
|
|
||
| .. [#ghcens] `Wikipedia: Censorship of GitHub <https://en.wikipedia.org/wiki/Censorship_of_GitHub>`_ | ||
|
|
||
| .. [#gldoc] `GitLab: Repository mirroring documentation <https://docs.gitlab.com/user/project/repository/mirror/>`_ | ||
|
|
||
|
|
||
| Copyright | ||
| ========= | ||
|
|
||
| This document is placed in the public domain or under the | ||
| CC0-1.0-Universal license, whichever is more permissive. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps more of a comment for Discourse, but are you aware that we already back up the repo (including all the GH metadata not in the Git repo)?
I'm not sure what this PEP gives on top of that. Perhaps worth having a pre-PEP discussion before going directly to the PEP stage?
cc @ezio-melotti @StanFromIreland
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thread created here: https://discuss.python.org/t/pre-pep-providing-a-cpython-mirror/103671