Contributing to the DO Python Client
June 24, 2026 ยท View on GitHub
First: if you're unsure or afraid of anything, just ask or submit the issue or pull request anyways. You won't be yelled at for giving your best effort. The worst that can happen is that you'll be politely asked to change something. We appreciate all contributions!
A Little Bit of Context
The DigitalOcean Python client is generated using AutoRest. The AutoRest tool generates client libraries for accessing RESTful web services. Input to AutoRest is a spec that describes the DigitalOcean REST API using the OpenAPI 3.0 Specification format. The spec can be found here. AutoRest allows customizations to be made on top of the generated code.
Generating PyDo Locally
PyDo is a generated client. This section will walk you through generating the client locally. One might ask, when would one want to generate PyDo locally? Local generation is really helpful when making changes to the client configuration itself. It is good practice to re-generate the client to ensure the behavior is as expected.
Prerequisites
- Python version: >= 3.9 (it's highly recommended to use a python version management tool)
- poetry: python packaging and dependency management
- AutoRest: The tool that generates the client libraries for accessing RESTful web services.
Optional but highly recommended
We chose not to tie this repository to tooling for managing python installations. This allows developers to use their preferred tooling.
We like these:
- pyenv: python version management
- pyenv-virtualenv: a pyenv plugin to enable pyenv to manage virtualenvs for development environment isolation
Setup
-
Clone this repository. Run:
git clone git@github.com:digitalocean/pydo.git cd pydo -
(Optional) Ensure you have the right version of python installed using your preferred python version manager. This is what you'd run if you used
pyenv:pyenv install 3.9.4This can take a few minutes.
-
Install the package dependencies
poetry install -
You can now activate your virtual environment
poetry shell
Using make commands to re-generate the client
-
Remove the previous generated code.
make clean -
Re-download the latest DO OpenAPI 3.0 Specification.
make download-spec -
Generate the client
make generateIt is also good practice to run mock tests against the changes using the following make command:
make test-mocked
Customizing the Client Using Patch Files
On top of generating our client, we've added a few customizations to create an optimal user experience. These customizations can by making changes to the _patch.py file. To learn more about adding customizations, please follow Autorest's documentation for it here
Releasing pydo
The repo uses GitHub workflows to publish a draft release when a new tag is pushed. We use semver to determine the version number vor the tag.
-
Run
make changesto review the merged PRs since last release and decide what kind of release you are doing (bugfix, feature or breaking).- Review the tags on each PR and make sure they are categorized appropriately.
-
Run
BUMP=(bugfix|feature|breaking) make bump_versionto update thepydoversion.
BUMPalso accepts(patch|minor|major)Command example:
make BUMP=minor bump_version -
Update the Pydo version in
pyproject.tomlandsrc/pydo/_version.py. Create a separate PR with only these changes. -
Once the PR has been pushed and merged, tag the commit to trigger the release workflow: run
make tagto tag the latest commit and push the tag to ORIGIN.Notes:
- To tag an earlier commit, run
COMMIT=${commit} make tag. - To push the tag to a different remote, run
ORIGIN=${REMOTE} make tag.
- To tag an earlier commit, run
-
Once the release process completes, review the draft release for correctness and publish the release.
Ensure the release has been markedLatest.
Cutting a beta pre-release
Betas can be cut from a feature branch. Run make beta_tag to push the next
beta tag for the version in pyproject.toml (e.g. v0.37.0-beta.1, then
-beta.2, ...). This triggers a workflow that publishes a PEP 440 pre-release to
PyPI (e.g. 0.37.0b1) and creates a draft GitHub pre-release. It won't be
installed by pip install pydo; pin it explicitly: pip install pydo==0.37.0b1.