Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Contribute to bpython

00:00 Contribute to bpython. The bpython REPL is an open-source project licensed under the MIT license, with code hosted on GitHub. Anyone can contribute to bpython in various ways, including fixing bugs, improving documentation, adding translations, or suggesting new features.

00:20 In fact, its home page has the encouraging message seen on-screen. This message underscores bpython’s, openness to contributions from newer and more established programmers alike.

00:32 To make your mark, you can start by checking out GitHub issues labeled bitesize that are still open in the bpython project. They should be particularly suitable to get started with, and they can help you get familiar with the codebase. First, fork the bpython project on GitHub under your name.

00:52 You can see this process on-screen, and it just involves a couple of clicks.

01:10 Next, clone the bpython repository to your computer. Don’t forget to change the command seen on-screen to use your GitHub username, as otherwise, you won’t be able to write any changes you make back to it.

01:27 You’ll then need to move into the bpython directory, and you’ll need to add tags to allow the setup to be completed. This is done firstly by adding the original bpython repository as an upstream remote

01:49 and then fetching those tags. Without the tags, the version number of bpython will be unknown, and the installation will fail. With all of that complete, create an activated virtual environment for the cloned project using Python 3.7 or later

02:18 and install your copy of bpython with the required dependencies in the editable mode. You should have all the mandatory requirements in place as part of the installation process, but if you want, you can also manually install optional dependencies that may be useful during development or for enabling extra features.

02:52 You can now make some changes to bpython source code. As a simple example, you can change the banner with the Python version that appears at the top of the screen when you start bpython.

03:04 Go ahead and open the args.py module in your favorite code editor.

03:22 Because you installed bpython using the editable mode, changes like this will immediately show up in your virtual environment when you run the module. Give it a try.

03:32 You should see something similar to what’s seen on-screen. You can customize the bpython REPL however you like. When you are happy about your modification and you’re ready to contribute back, then open a pull request to the original repository.

03:50 In the next section, you’ll take a look back at what you’ve covered in this course.

Become a Member to join the conversation.