How To Contribute To Open Source Python

Open source software is made by volunteers. There is a culture of community participation and collaboration that has been key to the Open Source Movement’s success. This tutorial explains how you can participate in Open Source with Python by contributing to an existing open source project on GitHub, or starting your own.

Open source software keeps the world going. It powers the internet and much of the software that runs just about every major business on earth. Some of it is truly brilliant. Much of it, like anything else in life, could use a little love now and then. There is probably an open source project out there that needs your help. Here’s a small guide to get you started, with references on how to find all sorts of open source programs to work on.

Understand the product

Before contributing to a project, you should understand how it works. To understand it, you need to try it for yourself. If you find the product interesting and useful, it is worth contributing to.

Too often, beginners try to contribute to a project without first using the software. They then get frustrated and give up. If you don’t use the software, you can’t understand how it works. If you don’t know how it works, how can you fix a bug or write a new feature?

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:

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:

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.

Familiarize yourself with the project

Once you find a project that aligns with your interests and skills, the next step is to get a sense as to how large and how active the project is.

A good way to get a sense of the pulse of the codebase is to look at the right-most column of the project. This gives an indication as to when certain files were last updated.

Let’s look at an example of an inactive project. Note that the last time most of these files were modified was 4 years ago. This is a project that perhaps at one time was more active, but is currently either in a stable enough place to not require updates or is a project that may have been abandoned or replaced by another project.

Inactive Project
Inactive Project

Inactive Project

Alternatively, here is an example of a more active project. Note that some of the files have not been updated. This is common, especially for certain files that are not expected to change drastically over the course of the project lifespan like the .gitignore.

However there are many files in this repository that indicate that the last time they were modified was either 4 days ago or 9 days ago. So, it seems as if the pulse of this project is a bit more active and perhaps more suitable to contributing to.

Active Project
Active Project

Active Project

While it’s certainly fine to take an inactive project and build upon it with your own features and extensions, it can serve a benefit to a newcomer to be part of an active community.

Once you’ve found a suitable project that is of interest to you and ideally is somewhat actively maintained, perusing the source code and looking through the project structure can be a good way to see the intent, style, and other attributes of the existing project.

Depending on the size of the project, this can be more or less involved task, but the “meat” of the project can usually be isolated to just a few spots. Spending your time here and reading through the source code like you’re reading this article can be an insightful and surprisingly enjoyable task.

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 bugs.python.org. 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:

Filtering issues with queries at bugs.python.org

Here’s an example of what you’d see if you edited your queries to leave in only easy documentation issues:

A filtered list of easy documentation issues at bugs.python.org

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:

QueryTypes of Issues
Easy TasksIssues that have been flagged as good for beginners
Reports Without RepliesIssues that have been reported but not discussed
UnreadIssues that have been reported but not read
Recently CreatedIssues that were reported recently
50 Latest IssuesThe 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.

Check the project’s status

How active is the project?

If you send a pull request to an unmaintained or dormant project, your pull request (or PR) may never be reviewed or merged. Look for projects with lots of activity; that way you will get immediate feedback on your code and your contributions will not go to waste.

Here’s how to tell if a project is active:

  • Number of contributors: A growing number of contributors indicates the developer community is interested and willing to accept new contributors.
  • Frequency of commits: Check the most recent commit date. If it was within the last week, or even month or two, the project is being maintained.
  • Number of maintainers: A higher number of maintainers means more potential mentors to guide you.
  • Activity level in the chat room/IRC: A busy chat room means quick replies to your queries.

Conclusion

Have you always wanted to contribute some code to a large project? Have you been waiting for a tutorial that would show you how to begin contributing long enough to make your first contribution? Here’s how to get started contributing with Python.

0 Comments

No Comment.