Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork252
contributing.rst
contributing.rst
Thanks for working on bpython!
On theGitHub issue tracker some issues are labeledbite-size -these are particularly good ones to start out with.
See our section about the:ref:`community` for a list of resources.
#bpython on OFTC is particularly useful,but you might have to wait for a while to get a question answered depending onthe time of day.
bpython supports Python 3.9 and newer. The code is compatible with allsupported versions.
Using a virtual environment is probably a good idea. Create a virtualenvironment with
# determines Python version used$ virtualenv bpython-dev# necessary every time you work on bpython$source bpython-dev/bin/activate
Fork bpython in the GitHub web interface. Be sure to include the tagsin your fork by un-selecting the option to copy only the main branch.
Then, clone the forked repo:
$ git clone git@github.com:YOUR_GITHUB_USERNAME/bpython.git# or "git clone https://github.com/YOUR_GITHUB_USERNAME/bpython.git"Next install your development copy of bpython and its dependencies:
$cd bpython# install bpython and required dependencies$ pip install -e.# install optional dependencies$ pip install watchdog urwid# development dependencies$ pip install sphinx pytest<modify a filein some way># this runs your modified copy of bpython!$ bpython
Note
Many requirements are also available from your distribution's packagemanager. On Debian/Ubuntu based systems, the following packages can beused:
$ sudo apt install python3-greenlet python3-pygments python3-requests$ sudo apt install python3-watchdog python3-urwid$ sudo apt install python3-sphinx python3-pytest
You also need to run virtualenv with --system-site-packages packages, ifyou want to use the packages provided by your distribution.
Note
Installation of some dependencies withpip requires Python headers anda C compiler. These are also available from your package manager.
$ sudo apt install gcc python3-dev
As a first dev task, I recommend getting bpython to print your name everytime you hit a specific key.
To run tests from the bpython directory:
$ pytest
The documentation is included in the bpython repository. Afterchecking out the bpython repository and installing sphinx as described inthe previous step, you can run the following command in your checkout of therepository to build the documentation:
$ make -C doc/sphinx html
Afterwards you can point your browser to doc/sphinx/build/html/index.html.Don't forget to recreate the HTML after you make changes.
The site (and its theme as well) is stored in a separate repository and builtusing pelican. To start hacking on the site you need to start out with acheckout and probably a virtual environment:
$ virtualenv bpython-site-dev$source bpython-site-dev/bin/activate$ pip install pelicanFork bsite and bsite-theme in the GitHub web interface, then clone therepositories:
$ git clone git@github.com:YOUR_GITHUB_USERNAME/bsite.git$ git clone git@github.com:YOUR_GITHUB_USERNAME/bsite-theme.git
Next you can fiddle around in the source files. If you want to build the siteyou activate your virtualenv and tell pelican to generate the site with theincluded configuration file.
$source bpython-site-dev/bin/activate# if you want to fiddle on the text of the site otherwise go into# bsite-theme$cd bsite# if you checked out the theme in a different place, use that path$ pelican -t ../bsite-theme -s pelicanconf.py
After this you can open the output/index.html in your favourite browser andsee if your changes had an effect.