Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MeltanoLabs/target-postgres
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4bacd9069bf85bd79d68eadcefa3842e08e81489
Choose a base ref
..
head repository: MeltanoLabs/target-postgres
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 16e549b31b99659ce20f6f70017bc553409b18cc
Choose a head ref
Showing with 65 additions and 30 deletions.
  1. +3 −3 .github/dependabot.yml
  2. +33 −8 .github/workflows/ci_workflow.yml
  3. +2 −1 .github/workflows/constraints.txt
  4. +1 −1 .pre-commit-config.yaml
  5. +4 −0 README.md
  6. +3 −4 docker-compose.yml
  7. +19 −13 tox.ini
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: weekly
interval: monthly
timezone: "America/New_York"
time: "07:23"
versioning-strategy: increase-if-necessary
@@ -22,7 +22,7 @@ updates:
- package-ecosystem: "pip"
directory: "/.github/workflows"
schedule:
interval: weekly
interval: monthly
timezone: "America/New_York"
time: "07:23"
reviewers:
@@ -34,7 +34,7 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
interval: monthly
timezone: "America/New_York"
time: "07:23"
groups:
41 changes: 33 additions & 8 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
@@ -20,8 +20,16 @@ on:
workflow_dispatch:
inputs: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FORCE_COLOR: 1

jobs:
tests:
name: Python ${{ matrix.python-version }} / Postgres ${{ matrix.postgres-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -32,17 +40,35 @@ jobs:
- "3.11"
- "3.10"
- "3.9"
postgres-version:
- "17"
include:
- python-version: "3.13"
postgres-version: "12"
- python-version: "3.13"
postgres-version: "13"
- python-version: "3.13"
postgres-version: "14"
- python-version: "3.13"
postgres-version: "15"
- python-version: "3.13"
postgres-version: "16"
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
- name: Fix key permissions
run: |
chmod 600 ssl/server.key
sudo chown 999:999 ssl/server.key
chmod 600 ssl/pkey.key
chmod 644 ssl/public_pkey.key
- name: Set up Postgres container
env:
POSTGRES_VERSION: ${{ matrix.postgres-version }}
run: |
docker compose -f docker-compose.yml up -d
- run: docker ps
- name: Set up Python '${{ matrix.python-version }}'
uses: actions/setup-python@v5
with:
@@ -52,19 +78,16 @@ jobs:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
python -m pip install --upgrade pip
pipx install poetry
- name: Install dependencies
run: |
poetry env use python${{ matrix.python-version }}
poetry install
pipx install tox
- name: Run pytest
run: |
poetry run pytest --capture=no
tox -e $(echo py${{ matrix.python-version }} | tr -d .)
- name: Run lint
run: |
poetry run tox -e lint
tox -e lint
integration:
name: Meltano integration test
runs-on: ubuntu-latest
services:
postgres:
@@ -85,9 +108,11 @@ jobs:
with:
python-version: 3.x
- name: Install dependencies
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
python -m pip install --upgrade pip
pipx install meltano
meltano install
meltano --version
- name: smoke-test-tap
run: meltano run tap-smoke-test target-postgres
3 changes: 2 additions & 1 deletion .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
poetry==1.8.4
meltano==3.6.0b2
tox==4.23.2
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ci:
autofix_prs: false
autoupdate_schedule: weekly
autoupdate_schedule: monthly
autoupdate_commit_msg: 'chore: pre-commit autoupdate'

repos:
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -18,6 +18,10 @@ Built with the [Meltano SDK](https://sdk.meltano.com) for Singer Taps and Target
* `target-schema`
* `hard-delete`

## Supported Python and PostgreSQL Versions

This target is tested with all actively supported [Python](https://devguide.python.org/versions/#supported-versions) and [PostgreSQL](https://www.postgresql.org/support/versioning/) versions. At the time of writing, this includes Python 3.9 through 3.13 and PostgreSQL 12 through 17.

## Settings

| Setting | Required | Default | Description |
7 changes: 3 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
# docker compose -f docker-compose.yml up -d
version: "2.1"
services:
postgres:
image: docker.io/postgres:latest
image: postgres:${POSTGRES_VERSION:-latest}
command: postgres -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key -c ssl_ca_file=/var/lib/postgresql/ca.crt -c hba_file=/var/lib/postgresql/pg_hba.conf
environment:
POSTGRES_USER: postgres
@@ -20,7 +19,7 @@ services:
ports:
- "5432:5432"
postgres_no_ssl: # Borrowed from https://github.com/MeltanoLabs/tap-postgres/blob/main/.github/workflows/test.yml#L13-L23
image: docker.io/postgres:latest
image: postgres:${POSTGRES_VERSION:-latest}
environment:
POSTGRES_PASSWORD: postgres
ports:
@@ -43,7 +42,7 @@ services:
networks:
- inner
postgresdb:
image: postgres:13.0
image: postgres:${POSTGRES_VERSION:-latest}
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
32 changes: 19 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -3,31 +3,37 @@
[tox]
envlist = py312
isolated_build = true
min_version = 4

[testenv]
allowlist_externals = poetry

[testenv:pytest]
# Run the python tests.
# To execute, run `tox -e pytest`
# To execute, run `tox -e py313`
envlist = py3{9,10,11,12,13}
deps =
pytest
commands =
poetry install -v
poetry run pytest
pytest

[testenv:format]
# Attempt to auto-resolve lint errors before they are raised.
# To execute, run `tox -e format`
deps =
ruff
commands =
poetry install -v
poetry run ruff check target_postgres/
poetry run ruff format target_postgres/
ruff check target_postgres/
ruff format target_postgres/

[testenv:lint]
# Raise an error if lint and style standards are not met.
# To execute, run `tox -e lint`
deps =
mypy
ruff
types-paramiko
types-simplejson
types-sqlalchemy
types-jsonschema
commands =
poetry install -v
poetry run ruff check --diff target_postgres/
poetry run ruff format --check target_postgres/
poetry run mypy .
ruff check --diff target_postgres/
ruff format --check target_postgres/
mypy .