Development#
After cloning the project, you'll need to set up the development environment. Here are the guidelines on how to do this.
Install Justfile Utility#
Install justfile on your system:
https://just.systems/man/en/prerequisites.html
View all available commands:
Install uv#
Install uv on your system:
https://docs.astral.sh/uv/getting-started/installation/
Init development environment#
Build faststream image and install all dependencies:
By default, this builds Python 3.10. If you need another version, pass it as an argument to the just command:
To check available Python versions, refer to the pyproject.toml file in the project root.
Run all Dependencies#
Start all dependencies as docker containers:
Once you are done with development and running tests, you can stop the dependencies' docker containers by running:
Running Tests#
To run fast tests, use:
To run all tests with brokers connections, use:
To run tests with coverage:
If you need test only specific folder or broker:just test tests/brokers/kafka
# or
just test-all tests/brokers/kafka
# or
just coverage-test tests/brokers/kafka
If you need some pytest arguments:
In your project, some tests are grouped under specific pytest marks:
- confluent
- slow
- rabbit
- kafka
- nats
- redis
- all
By default, "just test" will execute "not slow and not kafka and not confluent and not redis and not rabbit and not nats" tests. "just test-all" will execute tests with mark "all". You can specify marks to include or exclude tests:
just test tests/ -vv "not kafka and not rabbit"
# or
just test . -vv "not kafka and not rabbit"
# or if you no need pytest arguments
just test . "" "not kafka and not rabbit"
Linter#
Run all linters:
This command run ruff check, ruff format.To use specific command
Static analysis#
To run mypy, please use the following command.
Pre-commit#
Run pre-commit:
Docs#
Build docs:
Run docs:
To run full version of the documentation (including API Reference) type the command:
Commits#
Please, use Conventional Commits to name your commits and PR's.
- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
- docs: Documentation only changes
- feat: A new feature
- fix: A bug fix
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- test: Adding missing tests or correcting existing tests
- chore Miscellaneous commits e.g. modifying .gitignore, ...