After cloning the project, you'll need to set up the development environment. Here are the guidelines on how to do this.
Create a virtual environment in a directory using Python's venv
module:
python -m venv venv
That will create a ./venv/
directory with Python binaries, allowing you to install packages in an isolated environment.
Activate the new environment with:
source ./venv/bin/activate
Ensure you have the latest pip version in your virtual environment:
python -m pip install --upgrade pip
After activating the virtual environment as described above, run:
pip install -e ".[dev]"
This will install all the dependencies and your local project in your virtual environment.
If you create a Python file that imports and uses taskiq_faststream, and run it with the Python from your local environment, it will use your local taskiq_faststream source code.
Whenever you update your local taskiq_faststream source code, it will automatically use the latest version when you run your Python file again. This is because it is installed with -e
.
This way, you don't have to "install" your local version to be able to test every change.
To run tests with your current FastStream application and Python environment, use:
pytest tests
# or
./scripts/test.sh
# with coverage output
./scripts/test-cov.sh