If you want to start contributing to open source, then Python is a great project to start with. You’ll not only be making your mark on one of the biggest projects out there, but you’ll also be doing it as part of a vibrant and welcoming community. Open source projects rely on contributions from volunteers like you to grow and evolve, so you’ll be making a real difference to the future of open source software.
On top of that, contributing to open source is a great way to learn and build your skills, so don’t worry if you don’t feel like an expert. There may be a way to contribute that’s perfect for you, even if you don’t know about it yet. It all starts with your first contribution!
By the end of this tutorial, you’ll know:
- How you can contribute in a way that matches your skills and interests
- What resources and tools you can use to help you contribute confidently
- Where you can find ideas for fixes to propose in your first contribution
Free Download: Get a sample chapter from CPython Internals: Your Guide to the Python 3 Interpreter showing you how to unlock the inner workings of the Python language, compile the Python interpreter from source code, and participate in the development of CPython.
How You Can Contribute
Depending on your interests and skills, you can contribute in a number of different ways. For example, if you want to contribute to CPython, you can:
- Fix code bugs
- Write unit tests for functions in the standard library
- Write documentation for functions in the standard library
But if you want to contribute in other areas, you can:
- Write documentation for the Python Developer’s Guide
- Translate documentation
- Use your front end skills to improve Python’s official site
You can also help review pull requests from other contributors. The core developers have a lot of work on their hands, so if you can help move some issues forward, then you’ll be helping Python get better faster.
How to Get the Resources You’ll Need
When you start contributing to an open source project, there can be a lot of information to take in all at once.
To help you navigate it all, your first port of call should be the Python Developer’s Guide. It’s a super important resource that all contributors and core developers rely on since it covers everything from how to assess a potential contribution to how to deal will issue tracking. (If you contribute to this guide, then you’ll be able to make a big impact on what contributing to Python is like.)
Once you get down to the nuts and bolts of contributing, it’ll be useful to get familiar with a few tools:
-
GitHub: Python contributors collaborate with each other through GitHub, which allows you to host code, do version control, give feedback, and more. To learn more about how to use this tool, check out Introduction to Git and GitHub for Python Developers as well as Python’s official Git Bootcamp and Cheat Sheet.
-
reStructuredText: If you want to contribute documentation, then it’ll be very helpful to learn how to use this markup language. The Python Developer’s Guide has a primer on reStructuredText to help you get started. (Fun fact: reStructuredText has been around longer than Markdown!)
-
Sphinx: You’ll use Sphinx to build Python’s documentation. To learn more, you can check out Mariatta Wijaya’s talk Introduction to Sphinx Docs and reStructuredText and Eric Holscher’s talk Documenting your project with Sphinx & Read the Docs.
Although you don’t need to have experience with the C programming language to contribute to Python, it can open up some new ways of contributing. Here are some resources you can check out to learn more:
- C for Python Programmers
- Your Guide to the CPython Source Code
- CPython Internals: Your Guide to the Python 3 Interpreter
To get a feel for how the interpersonal aspects of contributing to Python work, you can also check out Brett Canon’s PyCascades talk Setting Expectations for Open Source Participation. It’s about setting reasonable expectations of each other so we can make open source pleasant for everyone involved.
How to Pick Your First Issue
If you see something in Python that you think should be improved, then you’re welcome to suggest it. But for your first contribution, it can be easier to start with an issue that has already been flagged by someone else.
If you want to contribute to the Python Developer’s Guide or Python’s official site, then you can check out the issues listed on GitHub:
If you want to contribute to CPython, which is what most people mean when they say “Python,” then you’ll need to create an account at Python’s bug tracker, which is called BPO because it’s at b
ugs.
p
ython.
o
rg
. You can register yourself as a user by going to User → Register in the menu on the left.
The information in the default view can be a lot to take in since it shows issues raised by users as well as issues raised by core developers, which may already have been fixed. Fortunately, you can filter this list to find exactly what you’re looking for.
To filter the list, start by logging in and then go to Your Queries → Edit in the menu on the left. You’ll get a list of queries that you can leave in or leave out:
Here’s an example of what you’d see if you edited your queries to leave in only easy documentation issues:
Now that you’ve filtered your list to leave in only easy documentation issues, you’re seeing just documentation issues that are suitable for beginners.
If you’d like to work on something other than documentation, you can also try some other queries to help you find an issue that interests you:
Query | Types of Issues |
---|---|
Easy Tasks | Issues that have been flagged as good for beginners |
Reports Without Replies | Issues that have been reported but not discussed |
Unread | Issues that have been reported but not read |
Recently Created | Issues that were reported recently |
50 Latest Issues | The top fifty issues that have had the most recent updates |
Once you’ve decided which issue you want to work on for your first contribution, it’s good to check the comments to see if:
- There’s still some ongoing discussion about whether it should be resolved and how it should be approached
- Someone else is already working on the issue
You can also check the latest version of the code and documentation to see if the issue has already been resolved but hasn’t been closed by a core developer yet.
Note: You can learn more about how to use the issue tracker in the official documentation on triaging an issue.
Once you’ve determined which issue you want to start with, you can leave a comment on the issue to:
- Say that you’re going to work on it
- Let others know when you plan to submit your pull request
If you clearly communicate your plans, then other contributors will know that someone else is already working on the issue and be able to focus their energy on solving other issues instead.
How to Submit Your First Contribution
Be sure to check out Python’s official documentation about the lifecycle of a pull request. It’ll walk you through the step-by-step mechanics of submitting a pull request, give you tips on making good commits, and more.
Since most core developers are volunteers, you may not get a response right away, but there are couple things you can do to speed up the process:
- Give a clear explanation of the problem you solved and how you solved it: This will help reviewers get up to speed quickly and have the information they need to accept your pull request.
- Resolve only one issue in each pull request: If you notice another problem while you’re working on your contribution, then you can resolve it in a second pull quest.
Contributing to open source is all about collaboration, so communication is super important. To learn more, check out what Open Source Guides has to say about communicating effectively when you submit a contribution.
When you’ve submitted your first pull request, kick back and celebrate! You’ve taken your first big step on a journey that could lead to some cool places.
What’s Next?
If you decide that you’d like to get more involved, then there are some opportunities you can explore. Maybe you’d like to:
- Work toward becoming a core developer
- Seek mentorship
- Join the triage team
- Join a work group for a specific project
- Become a member of the Python Software Foundation
There’s a lot going on in the world of Python, so look around and see what strikes your fancy. Let’s be kind to each other and build something great together.
Conclusion: Start Contributing to Python
Congratulations on taking your first steps toward contributing to Python! If you take the plunge and get started, then you’re sure to learn a lot while making an impact on an important open source project.
In this tutorial, you learned:
- How you can contribute to Python in a way that matches your skills and interests
- What resources and tools you can use to help you contribute confidently
- Where you can find ideas for fixes to propose in your first contribution
Everyone who’s on the core developer team started with just one contribution, so why not give it a try? You’re sure to learn something along the way!