Skip to content

Commit

Permalink
Merge branch 'main' into use-psycopg3-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Nov 19, 2024
2 parents fbe087b + 41a9d99 commit 898ffef
Show file tree
Hide file tree
Showing 12 changed files with 690 additions and 558 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ body:
label: Python Version
description: Version of Python you are using
options:
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
- "NA"
validations:
required: true
Expand Down
10 changes: 3 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: weekly
interval: monthly
timezone: "America/New_York"
time: "07:23"
reviewers:
- "visch"
versioning-strategy: increase-if-necessary
groups:
development-dependencies:
Expand All @@ -24,7 +22,7 @@ updates:
- package-ecosystem: "pip"
directory: "/.github/workflows"
schedule:
interval: weekly
interval: monthly
timezone: "America/New_York"
time: "07:23"
reviewers:
Expand All @@ -36,11 +34,9 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
interval: monthly
timezone: "America/New_York"
time: "07:23"
reviewers:
- "visch"
groups:
actions:
patterns:
Expand Down
41 changes: 32 additions & 9 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,53 @@ 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
matrix:
python-version:
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
postgres-version:
- "17"
include:
- 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:
Expand All @@ -52,19 +76,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 ${{ matrix.python-version }}
- name: Run lint
run: |
poetry run tox -e lint
tox -e lint
integration:
name: Meltano integration test
runs-on: ubuntu-latest
services:
postgres:
Expand All @@ -85,9 +106,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.3
meltano==3.6.0b2
tox==4.23.2
4 changes: 1 addition & 3 deletions .github/workflows/release_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,4 @@ jobs:
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- uses: pypa/[email protected]
with:
attestations: true
- uses: pypa/[email protected]
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ci:
autofix_prs: false
autoupdate_schedule: weekly
autoupdate_schedule: monthly
autoupdate_commit_msg: 'chore: pre-commit autoupdate'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-json
- id: check-toml
Expand All @@ -18,14 +18,14 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.8
rev: v0.7.2
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.11.2'
rev: 'v1.13.0'
hooks:
- id: mypy
exclude: tests
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ 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 |
| :------------------------------ | :------- |:-----------------------------| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| :------------------------------ | :------- | :--------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| host | False | None | Hostname for postgres instance. Note if sqlalchemy_url is set this will be ignored. |
| port | False | 5432 | The port on which postgres is awaiting connection. Note if sqlalchemy_url is set this will be ignored. |
| user | False | None | User name used to authenticate. Note if sqlalchemy_url is set this will be ignored. |
Expand Down
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
Expand All @@ -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:
Expand All @@ -43,7 +42,7 @@ services:
networks:
- inner
postgresdb:
image: postgres:13.0
image: postgres:${POSTGRES_VERSION:-latest}
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand Down
Loading

0 comments on commit 898ffef

Please sign in to comment.