출처: devguide.python.org/
Python Developer’s Guide¶
This guide is a comprehensive resource for contributing to Python – for both new and experienced contributors. It is maintained by the same community that maintains Python. We welcome your contributions to Python!
Quick Reference
Here are the basic steps needed to get set up and contribute a patch. This is meant as a checklist, once you know the basics. For complete instructions please see the setup guide.
- Install and set up Git and other dependencies (see the Git Setup page for detailed information).
- Fork the CPython repository to your GitHub account and get the source code using:
- git clone https://github.com//cpython cd cpython
- 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.
- PCbuild\build.bat -e -d
- ./configure --with-pydebug && make -j
- Run the tests:On most Mac OS X systems, replace ./python with ./python.exe. On Windows, use python.bat. With Python 2.7, replace test with test.regrtest.
- ./python -m test -j3
- 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 not require any issue to be created.
- git checkout -b fix-issue-12345 master
- Once you fixed the issue, run the tests, run make patchcheck, and if everything is ok, commit.
- Push the branch on your fork on GitHub and create a pull request. Include the issue number using bpo-NNNN in the pull request description. For example:
- bpo-12345: Fix some bug in spam module
- Add a News entry into the Misc/NEWS.d directory as individual file. The news entry can be created by using blurb-it, or the blurb tool and its blurb add command. Please read more about blurb in documentation.
Note
First time contributors will need to sign the Contributor Licensing Agreement (CLA) as described in the Licensing section of this guide.
Quick Links
Here are some links that you probably will reference frequently while contributing to Python:
- Issue tracker
- Buildbot status
- Where to Get Help
- PEPs (Python Enhancement Proposals)
- Git Bootcamp and Cheat Sheet
Status of Python branches
BranchScheduleStatusFirst releaseEnd-of-lifeRelease 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 only branch that accepts new features. The latest release for each Python version can be found on the download page.
Status:
features:prerelease:bugfix:security:end-of-life:
new features, bugfixes, and security fixes are accepted. |
feature fixes, bugfixes, and security fixes are accepted for the upcoming feature release. |
bugfixes and security fixes are accepted, new binaries are still released. (Also called maintenance mode or stable release) |
only security fixes are accepted and no more binaries are released, but new source-only versions can be released |
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 2 versions 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 this developer’s guide. If you still have questions after reviewing the material in this guide, then the Core Python Mentorship group is available to help guide new contributors through the process.
A number of individuals from the Python community have contributed to a series of excellent guides at Open Source Guides.
Core developers and contributors alike will find the following guides useful:
Guide for contributing to Python:
New ContributorsDocumentariansTriagersCore Developers
Advanced tasks and topics for once you are comfortable:
- Silence Warnings From the Test Suite
- Fixing issues found by the buildbots
- Coverity Scan
- Helping out with reviewing open pull requests. See how to review a Pull Request.
- Fixing “easy” Issues (and Beyond)
It is recommended that the above documents be read as needed. New contributors will build understanding of the CPython workflow by reading the sections mentioned in this table. You can stop where you feel comfortable and begin contributing immediately without reading and understanding these documents all at once. If you do choose to skip around within the documentation, be aware that it is written assuming preceding documentation has been read so you may find it necessary to backtrack to fill in missing concepts and terminology.
Proposing changes to Python itself
Improving Python’s code, documentation and tests are ongoing tasks that are never going to be “finished”, as Python operates as part of an ever-evolving system of technology. An even more challenging ongoing task than these necessary maintenance activities is finding ways to make Python, in the form of the standard library and the language definition, an even better tool in a developer’s toolkit.
While these kinds of change are much rarer than those described above, they do happen 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 and C++ ecosystems).
There are other Python implementations, each with a different focus. Like CPython, they always have more things they would like to do than they have developers to work on them. Some major examples that may be of interest are:
- PyPy: A Python interpreter focused on high speed (JIT-compiled) operation on major platforms
- Jython: A Python interpreter focused on good integration with the Java Virtual Machine (JVM) environment
- IronPython: A Python interpreter focused on good integration with the Common Language Runtime (CLR) provided by .NET and Mono
- Stackless: A Python interpreter focused on providing lightweight microthreads while remaining largely compatible with CPython specific extension modules
Key Resources
- Coding style guides
- Issue tracker
- Meta tracker (issue tracker for the issue tracker)
- Experts Index
- Buildbot status
- Source code
- PEPs (Python Enhancement Proposals)
- Where to Get Help
- Developer Log
Additional Resources
- Anyone can clone the sources for this guide. See Helping with the Developer’s Guide.
- Help with …
- Tool support
- gdb Support
- Dynamic Analysis with Clang
- Various tools with configuration files as found in the Misc directory
- Information about editors and their configurations can be found in the wiki
- python.org maintenance
- Search this guide
Code of Conduct
Please note that all interactions on Python Software Foundation-supported infrastructure is covered by 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, and respectful of others no matter what their position is within the project.
Full Table of Contents
- 1. Getting Started
- 2. Where to Get Help
- 3. Lifecycle of a Pull Request
- 3.1. Introduction
- 3.2. Quick Guide
- 3.3. Step-by-step Guide
- 3.4. Making Good PRs
- 3.5. patchcheck
- 3.6. Making Good Commits
- 3.7. Licensing
- 3.8. Submitting
- 3.9. Converting an Existing Patch from b.p.o to GitHub
- 3.10. Reviewing
- 3.11. Leaving a Pull Request Review on GitHub
- 3.12. Dismissing Review from Another Core Developer
- 3.13. Committing/Rejecting
- 3.14. Crediting
- 4. Running & Writing Tests
- 5. Increase Test Coverage
- 6. Helping with Documentation
- 7. Documenting Python
- 7.1. Introduction
- 7.2. Style guide
- 7.3. reStructuredText Primer
- 7.4. Additional Markup Constructs
- 7.4.1. Meta-information markup
- 7.4.2. Module-specific markup
- 7.4.3. Information units
- 7.4.4. Showing code examples
- 7.4.5. Inline markup
- 7.4.6. Cross-linking markup
- 7.4.7. Paragraph-level markup
- 7.4.8. Table-of-contents markup
- 7.4.9. Index-generating markup
- 7.4.10. Grammar production displays
- 7.4.11. Substitutions
- 7.5. Building the documentation
- 7.6. Translating
- 8. Silence Warnings From the Test Suite
- 9. Fixing “easy” Issues (and Beyond)
- 10. Issue Tracking
- 11. Triaging an Issue
- 12. Following Python’s Development
- 13. Porting Python to a new platform
- 14. How to Become a Core Developer
- 15. Developer Log
- 16. Accepting Pull Requests
- 17. Development Cycle
- 18. Continuous Integration
- 19. Adding to the Stdlib
- 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
- 27. Updating standard library extension modules
- 28. Coverity Scan
- 29. Dynamic Analysis with Clang
- 30. Running a buildbot worker
- 31. Core Developer Motivations and Affiliations
- 32. Git Bootcamp and Cheat Sheet
- 32.1. Forking CPython GitHub Repository
- 32.2. Cloning a Forked CPython Repository
- 32.3. Listing the Remote Repositories
- 32.4. Setting Up Your Name and Email Address
- 32.5. Enabling autocrlf on Windows
- 32.6. Creating and Switching Branches
- 32.7. Deleting Branches
- 32.8. Staging and Committing Files
- 32.9. Reverting Changes
- 32.10. Stashing Changes
- 32.11. Committing Changes
- 32.12. Pushing Changes
- 32.13. Creating a Pull Request
- 32.14. Updating your CPython Fork
- 32.15. Applying a Patch from Mercurial to Git
- 32.16. Downloading Other’s Patches
- 32.17. Accepting and Merging a Pull Request
- 32.18. Backporting Merged Changes
- 32.19. Editing a Pull Request Prior to Merging
- 33. Appendix: Topics
'Python 기초' 카테고리의 다른 글
파이썬, 소수 구하는 특이한 방법 (0) | 2021.05.18 |
---|---|
파이썬 정규식 패턴 예제 (0) | 2021.05.11 |
파이썬, 다이나믹(동적) 프로그래밍 동영상 (0) | 2021.04.03 |
파이썬, DFS, BFS 코드와 동영상 (0) | 2021.04.01 |
파이썬 동영상 강의 (0) | 2021.03.31 |