Welcome to contribute to pgmq-sqlalchemy !
This document will guide you through the process of contributing to the project.
- Fork the repository
- Click the
Forkbutton in the upper right corner of the repository page.
- Click the
- Clone the repository
- Clone the repository to your local machine.
git clone https://github.com/your-username/pgmq-sqlalchemy.git
- Create a new branch
- Create a new branch for your changes.
git checkout -b feature/your-feature-name
- Make your changes
- Make your changes to the codebase.
- Add tests for your changes.
- Add documentation if changes are user-facing.
- Commit your changes
- Commit your changes with meaningful commit messages.
git commit -m "feat: your feature description" - Push your changes
- Push your changes to your forked repository.
git push origin feature/your-feature-name
- Create a Pull Request
- Create a Pull Request from your forked repository to the
developbranch of the original repository.
- Create a Pull Request from your forked repository to the
Install dependencies and ruff pre-commit hooks.
make installPrerequisites: Docker and Docker Compose installed.
Start development PostgreSQL
make start-dbStop development PostgreSQL
make stop-dbmake helpwill show all available commands and their descriptions.
We use pre-commit hook with ruff to automatically lint the codebase before committing.
Run tests locally with default settings:
make test-localTo test in the same way as GitHub Actions, follow these steps:
- Setup environment files (first time only):
make setup-env- Start the PostgreSQL database:
make start-db- Setup a test database with pgmq extension:
make setup-test-db DB_NAME=my_test_db- Run tests with a specific driver and database:
make test-with-driver DRIVER=psycopg2 DB_NAME=my_test_db- Teardown the test database after testing:
make teardown-test-db DB_NAME=my_test_dbAvailable drivers:
- Sync drivers:
pg8000,psycopg2,psycopg,psycopg2cffi - Async drivers:
asyncpg
To run tests for all drivers in parallel (similar to CI matrix):
make test-allThis command will:
- Set up test databases for all drivers
- Run tests for all drivers in parallel
- Clean up all test databases after completion
Run tests for a specific driver (uses default database):
uv run pytest tests --driver=psycopg2Run tests with a specific database name:
uv run pytest tests --driver=psycopg2 --db-name=custom_dbRun tests in docker:
make test-dockerServe documentation
make doc-serveClean documentation build
make doc-clean