Lucky for you, the internals of PyAwaitable are extremely well documented, since it was originally designed to be part of the CPython API.
Before you get started, it's a good idea to read the following discussions, or at least skim through them:
- Adding a C API for coroutines/awaitables
- C API for asynchronous functions
- Revisiting a C API for asynchronous functions
Then, for all the details of the underlying implementation, read the scrapped PEP.
You'll first want to find an issue that you want to implement. Make sure not to choose an issue that already has someone assigned to it!
Once you've chosen something you would like to work on, be sure to make a comment requesting that the issue be assigned to you. You can start working on the issue before you've been officially assigned to it on GitHub, as long as you made a comment first.
After you're done, make a pull request merging your code to the master branch. A successful pull request will have all of the following:
- A link to the issue that it's implementing.
- New and passing tests.
- Updated docs and changelog.
- Code following the style guide, mentioned below.
PyAwaitable follows PEP 7, so if you've written any code in the CPython core, you'll feel right at home writing code for PyAwaitable.
However, don't bother trying to format things yourself! PyAwaitable provides an uncrustify configuration file for you.
If you haven't already, clone the project.
$ git clone https://github.com/ZeroIntensity/pyawaitable
$ cd pyawaitable
To build PyAwaitable locally, simple run pip
:
$ pip install .
It's highly recommended to do this inside of a virtual environment.
PyAwaitable uses Hatch, so that will handle everything for you:
$ hatch test