This guide is a comprehensive resource for contributingto Python – for both new and experienced contributors. It ismaintained by the samecommunity that maintains Python. We welcome your contributions to Python!
Quick Reference¶
Holding down the Shift Key while hitting the Refresh Button forces the browser to download all the server files; clearing cache and updating with any newer versions. SHIFT/REFRESH works for both on Mac/PC. Any operating system, Any browser. – flipflopmedia Oct 2 '18 at 15:02. Compile and build¶. CPython provides several compilation flags which help with debugging various things. While all of the known flags can be found in the Misc/SpecialBuilds.txt file, the most critical one is the PyDEBUG flag which creates what is known as a “pydebug” build. Python-nmap is a python library which helps in using nmap port scanner. It allows to easilly manipulate nmap scan results and will be a perfect tool for systems administrators who want to automatize scanning task and reports. It also supports nmap script outputs. It can even be used asynchronously.
Here are the basic steps needed to get set up and contribute apatch. This is meant as a checklist, once you know the basics. For completeinstructions please see the setup guide.
Install and set up Git and other dependencies(see the Git Setup page for detailed information).
Fork the CPython repositoryto your GitHub account and get the source code using:
Build Python, on UNIX and Mac OS use:
and on Windows use:
See also more detailed instructions,how to install and build dependencies,and the platform-specific pages for UNIX,Mac OS, and Windows.
Run the tests:
On most Mac OS X systems, replace
./python
with./python.exe
. On Windows, usepython.bat
. With Python2.7, replacetest
withtest.regrtest
.Create a new branch where your work for the issue will go, e.g.:
If an issue does not already exist, please create it. Trivial issues (e.g. typo fixes) do notrequire any issue to be created.
Once you fixed the issue, run the tests, run
makepatchcheck
, and ifeverything is ok, commit.Push the branch on your fork on GitHub and create a pull request. Include the issue number using
bpo-NNNN
in thepull request description. For example:Add a News entry into the
Misc/NEWS.d
directory as individual file. Thenews entry can be created by using blurb-it,or the blurb tool and itsblurbadd
command. Please read more aboutblurb
in documentation.
Note
First time contributors will need to sign the Contributor LicensingAgreement (CLA) as described in the Licensing section ofthis guide.
Quick Links¶
Here are some links that you probably will reference frequently whilecontributing to Python:
- PEPs (Python Enhancement Proposals)
Status of Python branches¶
Branch | Schedule | Status | First release | End-of-life | Release manager |
---|---|---|---|---|---|
master | PEP 619 | features | 2021-10-04 | TBD | Pablo Galindo Salgado |
3.9 | PEP 596 | bugfix | 2020-10-05 | TBD | Łukasz Langa |
3.8 | PEP 569 | bugfix | 2019-10-14 | 2024-10 | Łukasz Langa |
3.7 | PEP 537 | security | 2018-06-27 | 2023-06-27 | Ned Deily |
3.6 | PEP 494 | security | 2016-12-23 | 2021-12-23 | Ned Deily |
The master branch is currently the future Python 3.10, and is the onlybranch that accepts new features. The latest release for each Pythonversion can be found on the download page.
Status:
features: | new features, bugfixes, and security fixes are accepted. |
---|---|
prerelease: | feature fixes, bugfixes, and security fixes are accepted for theupcoming feature release. |
bugfix: | bugfixes and security fixes are accepted, new binaries are stillreleased. (Also called maintenance mode or stable release) |
security: | only security fixes are accepted and no more binaries are released,but new source-only versions can be released |
end-of-life: | release cycle is frozen; no further changes can be pushed to it. |
Dates in italic are scheduled and can be adjusted.
By default, the end-of-life is scheduled 5 years after the first release,but can be adjusted by the release manager of each branch. All Python 2versions have reached end-of-life.
See also the Development Cycle page for more information about branches.
Contributing¶
We encourage everyone to contribute to Python and that’s why we have put up thisdeveloper’s guide. If you still have questions after reviewing the material inthis guide, then the Core Python Mentorship group is available to help guide newcontributors through the process.
A number of individuals from the Python community have contributed to a seriesof excellent guides at Open Source Guides.
Core developers and contributors alike will find the following guides useful:
Guide for contributing to Python:
New Contributors | Documentarians | Triagers | Core Developers |
---|---|---|---|
Getting Started | Helping with Documentation | Issue Tracking | How to Become a Core Developer |
Where to Get Help | Documenting Python | Triaging an Issue | Developer Log |
Lifecycle of a Pull Request | Style guide | Helping Triage Issues | Accepting Pull Requests |
Running & Writing Tests | reStructuredText Primer | Experts Index | Development Cycle |
Fixing “easy” Issues (and Beyond) | Translating | Core Developer Motivations and Affiliations | |
Following Python’s Development | Core Developers Office Hours | ||
Git Bootcamp and Cheat Sheet |
Advanced tasks and topics for once you are comfortable:
- Fixing issues found by the buildbots
- Helping out with reviewing open pull requests.See how to review a Pull Request.
It is recommended that the above documents be read as needed. Newcontributors will build understanding of the CPython workflow by reading thesections mentioned in this table. Youcan stop where you feel comfortable and begin contributing immediately withoutreading and understanding these documents all at once. If you do choose to skiparound within the documentation, be aware that it is written assuming precedingdocumentation has been read so you may find it necessary to backtrack to fill inmissing concepts and terminology.
Proposing changes to Python itself¶
Improving Python’s code, documentation and tests are ongoing tasks that arenever going to be “finished”, as Python operates as part of an ever-evolvingsystem of technology. An even more challenging ongoing task than thesenecessary maintenance activities is finding ways to make Python, in the form ofthe standard library and the language definition, an even better tool in adeveloper’s toolkit.
While these kinds of change are much rarer than those described above, they dohappen and that process is also described as part of this guide:
Other Interpreter Implementations¶
This guide is specifically for contributing to the Python reference interpreter,also known as CPython (while most of the standard library is written in Python,the interpreter core is written in C and integrates most easily with the C andC++ ecosystems).
There are other Python implementations, each with a different focus. LikeCPython, they always have more things they would like to do than they havedevelopers to work on them. Some major examples that may be of interest are:
- PyPy: A Python interpreter focused on high speed (JIT-compiled) operationon major platforms
- Jython: A Python interpreter focused on good integration with the JavaVirtual Machine (JVM) environment
- IronPython: A Python interpreter focused on good integration with theCommon Language Runtime (CLR) provided by .NET and Mono
- Stackless: A Python interpreter focused on providing lightweightmicrothreads while remaining largely compatible with CPython specificextension modules
Key Resources¶
- Coding style guides
- PEP 7 (Style Guide for C Code)
- PEP 8 (Style Guide for Python Code)
- Issue tracker
- Meta tracker (issuetracker for the issue tracker)
- Source code
- PEPs (Python Enhancement Proposals)
Additional Resources¶
Updating Python On Mac Os
- Anyone can clone the sources for this guide. SeeHelping with the Developer’s Guide.
- Help with …
- Tool support
- Various tools with configuration files as found in the Misc directory
- Information about editors and their configurations can be found in thewiki
Code of Conduct¶
Please note that all interactions onPython Software Foundation-supportedinfrastructure is coveredby the PSF Code of Conduct,which includes all infrastructure used in the development of Python itself(e.g. mailing lists, issue trackers, GitHub, etc.).In general this means everyone is expected to be open, considerate, andrespectful of others no matter what their position is within the project.
Updating Python Mac Os
Updating Python 3 On Mac
Full Table of Contents¶
- 1. Getting Started
- 1.3. Compile and build
- 1.4. Install dependencies
- 1.6. Troubleshoot the build
- 2. Where to Get Help
- 3. Lifecycle of a Pull Request
- 3.3. Step-by-step Guide
- 3.10. Reviewing
- 4. Running & Writing Tests
- 4.1. Running
- 5. Increase Test Coverage
- 5.2. Measuring Coverage
- 6. Helping with Documentation
- 7. Documenting Python
- 7.2. Style guide
- 7.3. reStructuredText Primer
- 7.4. Additional Markup Constructs
- 7.5. Building the documentation
- 7.6. Translating
- 10. Issue Tracking
- 10.1. Using the Issue Tracker
- 10.3. Helping Triage Issues
- 11. Triaging an Issue
- 11.2. Becoming a member of the Python triage team
- 11.3. Fields in the Issue Tracker
- 12. Following Python’s Development
- 14. How to Become a Core Developer
- 14.3. Gaining Commit Privileges
- 15. Developer Log
- 16. Accepting Pull Requests
- 16.3. Working with Git
- 17. Development Cycle
- 17.1. Branches
- 17.2. Stages
- 17.3. Repository Administration
- 18. Continuous Integration
- 19. Adding to the Stdlib
- 19.2. Adding a new module
- 20. Changing the Python Language
- 21. Experts Index
- 22. gdb Support
- 23. Exploring CPython’s Internals
- 24. Changing CPython’s Grammar
- 25. Design of CPython’s Compiler
- 26. Design of CPython’s Garbage Collector
- 26.3. Identifying reference cycles
- 26.5. Optimization: generations
- 28. Coverity Scan
- 28.3. Known limitations
- 28.5. Workflow
- 29. Dynamic Analysis with Clang
- 29.3. Clang/LLVM Setup
- 29.4. Python Build Setup
- 30. Running a buildbot worker
- 30.2. Setting up the buildbot worker
- 31. Core Developer Motivations and Affiliations
- 32. Git Bootcamp and Cheat Sheet
- 33. Appendix: Topics