PEP 507 – Migrate CPython to Git and GitLab | peps.python.org
PEP 507 – Migrate CPython to Git and GitLab PEP 507 – Migrate CPython to Git and GitLab Author : Barry Warsaw <barry at python.org> Status : Rejected Type : Process Created : 30-Sep-2015 Post-History : Resolution : Core-Workflow message Table of Contents Abstract Rationale Version Control System Repository Hosting Code Review GitLab merge requests Criticism X is not written in Python Mercurial is better than Git CPython Workflow is too Complicated Open issues References Copyright Abstract This PEP proposes migrating the repository hosting of CPython and the supporting repositories to Git.
Further, it proposes adopting a hosted GitLab instance as the primary way of handling merge requests, code reviews, and code hosting. It is similar in intent to PEP 481 but proposes an open source alternative to GitHub and omits the proposal to run Phabricator. As with PEP 481 , this particular PEP is offered as an alternative to PEP 474 and PEP 462 . Rationale CPython is an open source project which relies on a number of volunteers donating their time.
As with any healthy, vibrant open source project, it relies on attracting new volunteers as well as retaining existing developers. Given that volunteer time is the most scarce resource, providing a process that maximizes the efficiency of contributors and reduces the friction for contributions, is of vital importance for the long-term health of the project. The current tool chain of the CPython project is a custom and unique combination of tools.
This has two critical implications: The unique nature of the tool chain means that contributors must remember or relearn, the process, workflow, and tools whenever they contribute to CPython, without the advantage of leveraging long-term memory and familiarity they retain by working with other projects in the FLOSS ecosystem. The knowledge they gain in working with CPython is unlikely to be applicable to other projects.
The burden on the Python/PSF infrastructure team is much greater in order to continue to maintain custom tools, improve them over time, fix bugs, address security issues, and more generally adapt to new standards in online software development with global collaboration. These limitations act as a barrier to contribution both for highly engaged contributors (e.g. core Python developers) and especially for more casual “drive-by” contributors, who care more about getting their bug fix than learning a new suite of tools and workflows.
By proposing the adoption of both a different version control system and a modern, well-maintained hosting solution, this PEP addresses these limitations. It aims to enable a modern, well-understood process that will carry CPython development for many years. Version Control System Currently the CPython and supporting repositories use Mercurial. As a modern distributed version control system, it has served us well since the migration from Subversion.
However, when evaluating the VCS we must consider the capabilities of the VCS itself as well as the network effect and mindshare of the community around that VCS. There are really only two real options for this, Mercurial and Git. The technical capabilities of the two systems are largely equivalent, therefore this PEP instead focuses on their social aspects. It is not possible to get exact numbers for the number of projects or people which are using a particular VCS, however we can infer this by looking at several sources of information for what VCS projects are using.
The Open Hub (previously Ohloh) statistics [1] show that 37% of the repositories indexed by The Open Hub are using Git (second only to Subversion which has 48%) while Mercurial has just 2%, beating only Bazaar which has 1%. This has Git being just over 18 times as popular as Mercurial on The Open Hub. Another source of information on VCS popularity is PyPI itself. This source is more targeted at the Python community itself since it represents projects developed for Python.
Unfortunately PyPI does not have a standard location for representing this information, so this requires manual processing. If we limit our search to the top 100 projects on PyPI (ordered by download counts) we can see that 62% of them use Git, while 22% of them use Mercurial, and 13% use something else. This has Git being just under 3 times as popular as Mercurial for the top 100 projects on PyPI. These numbers back up the anecdotal evidence for Git as the far more popular DVCS for open source projects.
Choosing the more popular VCS has a number of positive benefits. For new contributors it increases the likelihood that they will have already learned the basics of Git as part of working with another project or if they are just now learning Git, that they’ll be able to take that knowledge and apply it to other projects. Additionally a larger community means more people writing how to guides, answering questions, and writing articles about Git which makes it easier for a new user to find answers and information about the tool they are trying to learn and use.
Given its popularity, there may also be more auxiliary tooling written around Git. This increases options for everything from GUI clients, helper scripts, repository hosting, etc. Further, the adoption of Git as the proposed back-end repository format doesn’t prohibit the use of Mercurial by fans of that VCS! Mercurial users have the [2] plugin which allows them to push and pull from a Git server using the Mercurial front-end.
It’s a well-maintained and highly functional plugin that seems to be well-liked by Mercurial users. Repository Hosting Where and how the official repositories for CPython are hosted is in someways determined by the choice of VCS. With Git there are several options. In fact, once the repository is hosted in Git, branches can be mirrored in many locations, within many free, open, and proprietary code hosting sites. It’s still important for CPython to adopt a single, official repository, with a web front-end that allows for many convenient and common interactions entirely through the web, without always requiring local VCS manipulations.
These interactions include as a minimum, code review with inline comments, branch diffing, CI integration, and auto-merging. This PEP proposes to adopt a [3] instance, run within the python.org domain, accessible to and with ultimate control from the PSF and the Python infrastructure team, but donated, hosted, and primarily maintained by GitLab, Inc. Why GitLab? Because it is a fully functional Git hosting system, that sports modern web interactions, software workflows, and CI integration.
GitLab’s Community Edition (CE) is open source software, and thus is closely aligned with the principles of the CPython community. Code Review Currently CPython uses a custom fork of Rietveld modified to not run on Google App Engine and which is currently only really maintained by one person. It is missing common features present in many modern code review tools. This PEP proposes to utilize GitLab’s built-in merge requests and online code review features to facilitate reviews of all proposed changes.
GitLab merge requests The normal workflow for a GitLab hosted project is to submit a merge request asking that a feature or bug fix branch be merged into a target branch, usually one or more of the stable maintenance branches or the next-version master branch for new features. GitLab’s merge requests are similar in form and function to GitHub’s pull requests, so anybody who is already familiar with the latter should be able to immediately utilize the former.
Once submitted, a conversation about the change can be had between the submitter and reviewer. This includes both general comments, and inline comments attached to a particular line of the diff between the source and target branches. Projects can also be configured to automatically run continuous integration on the submitted branch, the results of which are readily visible from the mer
The rest of this page is on the live site.