Table of contents:
- Use the issue template when creating an issue.
- Provide a minimal reproducible example.
- Provide the full traceback.
- Provide the output of
uv venv --pythonanduv pip freeze.
- Describe the exact use case.
- Describe the input and output for the potential test case.
- Optionally, describe how you envision the feature to be implemented.
- Fork the repository.
- Make your changes in your fork.
- Run all tests and make sure they pass.
- Push your commits to your fork.
- Create a pull request from your fork to the original repository. Choose the
mainbranch as the target branch or a specific branch you want to merge your changes into. - Get an approval from the maintainer.
- Your changes will be merged into the original repository.
- Once the maintainer collects all the changes, they will release a new version of the library.
We use ruff for code style and linting.
Here are the steps to publish a new version of the library:
- Make sure everything you want to release is merged into the
mainbranch. - Sync the dependencies with
uv sync --all-extras. - Run all tests and make sure they pass.
- Bump the version using
uv run bump-my-versionand make sure the bump reflects the scope of changes:patchfor small changes, might be unnoticeable to usersminorfor new features, might be noticeable to usersmajorfor breaking changes or complete overhauls
- Push new commit and tag created by
bump-my-versionto GitHub. - Build the package with
uv run build. - Publish the package to PyPI using
uv run publish.
- Python 3.10+
- uv
- PostgreSQL (standalone or container)
uv sync --all-extrasIf you are using Nix, you can use the provided shell.nix file to enter a
shell with all the dependencies installed. That includes uv, PostgreSQL, and
will automatically set up the virtual environment.
nix-shell- You need to have an active PostgreSQL instance running on
localhost:5432. - Make sure to install everything in optional dependencies as well as extras.
uv sync --all-extrasdoes this for you.
When tests are running, some of the are using a temporary SQLite database. But around half of the tests interact with the real PostgreSQL instance.
There is a ready to use Docker Compose file in the tests directory.
It will start a PostgreSQL instance on localhost:5432:
$ docker compose -f tests/docker-compose.yaml up -d
[+] Running 2/2
✔ Network tests_default Created 0.0s
✔ Container tests-postgres-1 Started 0.0sOr by manually creating a container using docker or podman:
$ docker run -d --name raquel-postgres -p 5432:5432 \
-e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=postgres postgres:latestAfter the tests are done, you can bring the PostgreSQL container down with:
$ docker compose -f tests/docker-compose.yaml down
[+] Running 2/2
✔ Container tests-postgres-1 Stopped 0.0s
✔ Network tests_default Removed 0.0sIf you start the container manually, remove it with:
$ docker rm -f raquel-postgres
raquel-postgresuv run pytest -x.
$ pytest -x
============================ test session starts ===========================
platform darwin -- Python 3.13.2, pytest-8.3.5, pluggy-1.6.0
rootdir: /Users/vduseev/Projects/vduseev/raquel
configfile: pyproject.toml
plugins: asyncio-0.24.0, cov-5.0.0
asyncio: mode=Mode.AUTO, default_loop_scope=function
collected 78 items
tests/test_basics.py .......... [ 12%]
tests/test_conflict.py .... [ 17%]
tests/test_dequeue.py .................. [ 41%]
tests/test_enqueue.py ........................ [ 71%]
tests/test_postgres.py .... [ 76%]
tests/test_retry.py ...... [ 84%]
tests/test_subscribe.py ............ [100%]
============================ 78 passed in 9.37s ============================If your PostgreSQL instance is running on a different host, port, or with different credentials, you can configure the connection using command-line options:
# Run tests with a custom PostgreSQL port
pytest --postgres-port=5433
# Run tests with custom host and credentials
pytest --postgres-host=db.example.com --postgres-user=testuser --postgres-password=testpass
# Run tests with a custom database
pytest --postgres-database=test_dbAvailable PostgreSQL configuration options:
--postgres-host(default: localhost)--postgres-port(default: 5432)--postgres-user(default: postgres)--postgres-password(default: postgres)--postgres-database(default: postgres)