Welcome to the Speechmatics Python SDK and CLI! We're open to contributions from anyone. We hope you can find everything you need in here to get started contributing to this repo.
- Useful Links
- Setting Up
- How to Submit Changes
- How to Report a Bug
- How to Request a Feature
- Style Guide
- Testing
To get started, make sure you have a compatible version of python installed. Currently, we support 3.7-3.10.
To install the dependencies for development run:
pip install -r requirements.txt
pip install -r requirements-dev.txt
We try not to be too prescreptive about how people work, but we also believe in helping make things easier by following a couple of basic steps. If you follow these recommendations, it should make the review process simpler and quicker:
- If your change is large, consider reaching out to us beforehand and discussing the issue. This could save you a lot of time if there are good reasons why we haven't done something.
- Fork the repo and work on a branch on your fork. Try to give your branches short, descriptive names in the format {type}/{description} e.g. bugfix/missing-try-catch.
- Make sure your changes are tested - ideally both manually and in the unit tests.
- When opening a PR back into our repo, provide some simple descriptive comments that list the changes being made in the PR.
- Give your PR a short, descriptive title.
If you are experiencing a bug, you can report it via the issues page. Ideally, you'd follow our template for submitting bugs to make it easier for us to understand and respond to the report. Make sure to tag your issue with the bug label. And remember, the more details you give us, the better we can understand and fix your problem!
If you want a feature, you can open a discussion via the issues page. Try to tag your issue with the most appropriate label available so that we can track it more easily.
When requesting a feature, we don't have a particule template we expect you to follow. Just make sure that you include as much information as possible about the feature you'd like to see added, why you'd like to see it added and what the expected behaviour of the feature might be.
Any color you like.
As with many python projects, ours uses Black to set the standard for formatting. We also use ruff to handle our linting. We previously used pylint, but we love the lightning-fast performance that the rust-based linter provides us!
You can run linting and formatting using the makefile:
make format
make lint
We also make use of the pre-commit package. This should already be installed when you clone the repo. If it isn't installed, you can install it by running the pre-commit install
. It will run a serious of checks on every commit to make sure your code is properly formatted and linted. You can run the pre-commit check independent of a commit with the command pre-commit run --all-files
.
In general, code should be self-explanatory and kept as simple as possible. Comments can be added to clarify what a piece of code does and docstrings should be added to any important functions that are expected to be used by SDK clients.
Tests for this repo are included in the /tests
directory. You can use the command make unittests
to run unit tests. You can also target specific tests using the pytest command, e.g.:
pytest -v tests/test_models.py::test_notification_config
If you make changes to the SDK or CLI, the tests should be updated or added to in a sensible way to ensure the new change is properly covered.