diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..ed79a451 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,104 @@ +General guidance +================ + +* The usual principes of respecting existing conventions and making sure that your changes + are in line with the overall product design apply when contributing code to Pyenv. + +* We are limited to Bash 3.2 features + + That's because that's the version shipped with MacOS. + (They didn't upgrade past it and switched to Zsh because later versions + are covered by GPLv3 which has additional restrictions unacceptable for Apple.) + +* Be extra careful when submitting logic specific for the Apple Silicon platform + + As of this writing, Github Actions do not support it and only one team member has the necessary hardware. + So we may be unable to test your changes and may have to take your word for it. + + +Formatting PRs +============== + +We strive to keep commit history one-concern-per-commit to keep it meaningful and easy to follow. +If a pull request (PR) addresses a single concern (the typical case), we usually squash commits +from it together when merging so its commit history doesn't matter. +If however a PR addresses multiple separate concerns, each of them should be presented as a separate commit. +Adding multiple new Python releases of the same flavor is okay with either a single or multiple commits. + + +Authoring installation scripts +============================== + +Adding new Python release support +--------------------------------- + +The easiest way to add support for a new Python release is to copy the script from the previous one +and adjust it as necessary. In many cases, just changing version numbers, URLs and hashes is enough. +Do pay attention to other "magic numbers" that may be present in a script -- +e.g. the set of architectures and OS versions supported by a release -- since those change from time to time, too. + +Make sure to also copy any patches for the previous release that still apply to the new one. +Typically, a patch no longer applies if it addresses a problem that's already fixed in the new release. + +For prereleases, we only create an entry for the latest prerelease in a specific version line. +When submitting a newer prerelease, replace the older one. + + +Adding version-specific fixes/patches +------------------------------------- + +We accept fixes to issues in specific Python releases that prevent users from using them with Pyenv. + +In the default configuration for a Python release, we strive to provide as close to vanilla experience as practical, +to maintain [the principle of the least surprise](https://en.wikipedia.org/wiki/Principle_of_least_astonishment). +As such, any such fixes: + +* Must not break or degrade (e.g. disable features) the build in any of the environments that the release officially supports +* Must not introduce incompatibilities with the vanilla release (including binary incompatibilities) +* Should not patch things unnecessarily, to minimize the risk of the aforementioned undesirable side effects. + * E.g. if the fix is for a specific environment, its logic ought to only fire in this specific environment and not touch execution paths for other environments. + * As such, it's advisable to briefly explain in the PR what each added patch does and why it is necessary to fix the declared problem + +Generally, version-specific fixes belong in the scripts for the affected releases and/or patches for them -- this guarantees that their effect is limited to only those releases. + +