Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 32 additions & 28 deletions .github/workflows/pgmq_python.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,80 @@
name: tembo-pgmq-python CI workflow
name: pgmq-python CI workflow

defaults:
run:
shell: bash
working-directory: tembo-pgmq-python
working-directory: ./

on:
pull_request:
branches:
- main
paths:
- ".github/workflows/pgmq_python.yml"
- "tembo-pgmq-python/tembo_pgmq_python/**"
- "tembo-pgmq-python/tests/**"
- "tembo-pgmq-python/pyproject.toml"
- "pgmq-extension/**"
- "src/**"
- "tests/**"
- "pyproject.toml"
push:
branches:
- main
paths:
- ".github/workflows/pgmq_python.yml"
- "tembo-pgmq-python/tembo_pgmq_python/**"
- "tembo-pgmq-python/tests/**"
- "tembo-pgmq-python/pyproject.toml"
- "pgmq-extension/**"
- "src/**"
- "tests/**"
- "pyproject.toml"
jobs:
lints:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11.0
uses: actions/setup-python@v2
uses: actions/setup-python@v6
with:
python-version: 3.11.0
- name: Install dependencies
run: |
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python3 -
poetry install
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install project
run: uv sync --all-groups
- name: Lints / Type Checking
run: make lints
run: make lint

tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11.0
uses: actions/setup-python@v2
uses: actions/setup-python@v6
with:
python-version: 3.11.0
- name: Install dependencies
run: |
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python3 -
poetry install --extras "async"
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install project
run: uv sync --all-groups --all-extras
- name: Unit and Integration Tests
run: make test

publish:
runs-on: ubuntu-latest
# only publish off main branch
if: github.repository == 'tembo-io/pgmq' && github.ref == 'refs/heads/main'
if: github.repository == 'pgmq/pgmq-py' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11.0
uses: actions/setup-python@v2
uses: actions/setup-python@v6
with:
python-version: 3.11.0
- name: Install dependencies
run: |
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python3 -
poetry install
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install project
run: uv sync --all-groups
- name: Publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: |
poetry publish --build --skip-existing
uv publish
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SCOPE=pgmq-py/
SCOPE=src/

.PHONY: format lint test clear-postgres run-pgmq-postgres

Expand All @@ -15,7 +15,7 @@ clear-postgres:
docker rm -f pgmq-postgres || true

run-pgmq-postgres:
docker run -d --name pgmq-postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 quay.io/tembo/pg17-pgmq:latest
docker run -d --name pgmq-postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 ghcr.io/pgmq/pg17-pgmq:latest

test: clear-postgres run-pgmq-postgres
sleep 10 # Give PostgreSQL time to start
Expand Down
1 change: 0 additions & 1 deletion benches/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ def bench(
# example usage (remove `poetry run`) if not using poetry to manage the environment
# 10 processes each writing 1 message at a time, as fast as possible for 60 seconds
# 10 processes, each reading->deleting up to 10 messages at a time, until all messages consumed
# excecute from pgmq/tembo-pgmq-python
#
# poetry run python -m benches.bench 'postgresql://$USER:$PASSWORD@$HOST:$PORT/$DATABASE' 60 \
# --write-concurrency=10 \
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ classifiers = [
]

authors = [
{ name = "Adam Hendel", email = "[email protected]" },
{ name = "Adam Hendel" },
]

maintainers = [
{ name = "Adam Hendel", email = "[email protected]" },
{ name = "Adam Hendel" },
{ name = "Ali Tavallaie", email = "[email protected]" },
]

Expand Down