Skip to content

Commit

Permalink
Merge branch 'main' into test_various_snapshot_configs
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Nov 22, 2024
2 parents f3ed1f1 + ae48e67 commit 4fdc0b5
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 2,808 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Breaking Changes-20241016-175527.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Breaking Changes
body: Drop support for Python 3.8
time: 2024-10-16T17:55:27.844499-04:00
custom:
Author: mikealfare
Issue: "161"
11 changes: 8 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

services:
postgres:
Expand Down Expand Up @@ -147,8 +147,8 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-22.04, macos-12]
python-version: ["3.8", "3.12"]
platform: [ubuntu-22.04, macos-14]
python-version: ["3.9", "3.12"]
steps:
- name: "Check out repository"
uses: actions/checkout@v4
Expand All @@ -158,6 +158,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: "Install postgresql on MacOS"
if: ${{ matrix.platform == 'macos-14' }}
run: |
brew install postgresql
- name: "Test psycopg2 name - default"
run: .github/scripts/psycopg2-check.sh
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Check out repository
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ repos:
- id: black
args:
- --line-length=99
- --target-version=py38
- --target-version=py39
- --target-version=py310
- --target-version=py311
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# this image gets published to GHCR for production use
ARG py_version=3.12.4

FROM python:$py_version-slim-bullseye as base
FROM python:$py_version-slim-bullseye AS base

RUN apt-get update \
&& apt-get dist-upgrade -y \
Expand All @@ -25,7 +25,7 @@ ENV LANG=C.UTF-8
RUN python -m pip install --upgrade "pip==24.0" "setuptools==69.2.0" "wheel==0.43.0" --no-cache-dir


FROM base as dbt-postgres
FROM base AS dbt-postgres

ARG commit_ref=main

Expand Down
9 changes: 4 additions & 5 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,19 @@ docker build --tag <your_image_name> \
```

### Examples:
To build an image named "my-dbt" that supports Snowflake using the latest releases:
To build an image named "my-dbt" that supports Postgres using the latest releases:
```shell
cd dbt-core/docker
docker build --tag my-dbt --target dbt-postgres .
```

To build an image named "my-other-dbt" that supports Snowflake using the adapter version 1.0.0b1:
To build an image named "my-other-dbt" that supports Postgres using the adapter version 1.8.0:
```shell
cd dbt-core/docker
docker build \
--tag my-other-dbt \
--target dbt-postgres \
--build-arg commit_ref=v1.0.0b1 \
.
--build-arg commit_ref=v1.8.0 \
.
```

## Running an image in a container:
Expand Down
58 changes: 29 additions & 29 deletions docker/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
# this image does not get published, it is intended for local development only, see `Makefile` for usage
FROM ubuntu:24.04 as base
FROM ubuntu:24.04 AS base

# prevent python installation from asking for time zone region
ARG DEBIAN_FRONTEND=noninteractive

# add python repository
RUN apt-get update \
&& apt-get install -y software-properties-common=0.99.22.9 \
&& add-apt-repository -y ppa:deadsnakes/ppa \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
&& apt-get install -y software-properties-common=0.99.48 \
&& add-apt-repository -y ppa:deadsnakes/ppa \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*

# install python
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential=12.9ubuntu3 \
git-all=1:2.34.1-1ubuntu1.10 \
libpq-dev=14.11-0ubuntu0.22.04.1 \
python3.8=3.8.19-1+jammy1 \
python3.8-dev=3.8.19-1+jammy1 \
python3.8-distutils=3.8.19-1+jammy1 \
python3.8-venv=3.8.19-1+jammy1 \
python3-pip=22.0.2+dfsg-1ubuntu0.4 \
python3-wheel=0.37.1-2ubuntu0.22.04.1 \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
&& apt-get install -y --no-install-recommends \
build-essential=12.10ubuntu1 \
git-all=1:2.43.0-1ubuntu7.1 \
libpq-dev=16.4-0ubuntu0.24.04.2 \
python3.9=3.9.20-1+noble1 \
python3.9-dev=3.9.20-1+noble1 \
python3.9-distutils=3.9.20-1+noble1 \
python3.9-venv=3.9.20-1+noble1 \
python3-pip=24.0+dfsg-1ubuntu1 \
python3-wheel=0.42.0-2 \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*

# update the default system interpreter to the newly installed version
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1

# install python dependencies
RUN python3 -m pip install --upgrade --no-cache-dir "hatch==1.9.1"
RUN python -m pip install --upgrade "hatch==1.13.0" --no-cache-dir --compile


FROM base as dbt-postgres-dev
FROM base AS dbt-postgres-dev

HEALTHCHECK CMD python3 --version || exit 1
HEALTHCHECK CMD python --version || exit 1

# send stdout/stderr to terminal
ENV PYTHONUNBUFFERED=1
Expand All @@ -50,5 +50,5 @@ ENV PYTHONUNBUFFERED=1
WORKDIR /opt/code
VOLUME /opt/code

# create a virtual environment
RUN python3 -m venv /opt/venv
# setup hatch virtual envs
RUN hatch config set dirs.env.virtual ".hatch"
8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name = "dbt-postgres"
description = "The set of adapter protocols and base functionality that supports integration with dbt-core"
readme = "README.md"
keywords = ["dbt", "adapter", "adapters", "database", "elt", "dbt-core", "dbt Core", "dbt Cloud", "dbt Labs", "postgres"]
requires-python = ">=3.8.0"
requires-python = ">=3.9.0"
authors = [
{ name = "dbt Labs", email = "[email protected]" },
]
Expand All @@ -17,7 +17,6 @@ classifiers = [
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down Expand Up @@ -57,9 +56,8 @@ dependencies = [
"dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@test_various_snapshot_configs",
"dbt-common @ git+https://github.com/dbt-labs/dbt-common.git",
"dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git@test_various_snapshot_configs#subdirectory=dbt-tests-adapter",
"dbt-core @ git+https://github.com/dbt-labs/dbt-core.git@snapshot_dbt_valid_to_current#subdirectory=core",
'pre-commit==3.7.0;python_version>="3.9"',
'pre-commit==3.5.0;python_version=="3.8"',
"dbt-core @ git+https://github.com/dbt-labs/dbt-core.git#subdirectory=core",
"pre-commit==3.7.0",
"freezegun",
"pytest",
"pytest-dotenv",
Expand Down
5 changes: 5 additions & 0 deletions tests/functional/adapter/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from dbt.tests.adapter.basic.test_incremental import (
BaseIncremental,
BaseIncrementalNotSchemaChange,
BaseIncrementalBadStrategy,
)
from dbt.tests.adapter.basic.test_singular_tests import BaseSingularTests
from dbt.tests.adapter.basic.test_singular_tests_ephemeral import BaseSingularTestsEphemeral
Expand Down Expand Up @@ -55,6 +56,10 @@ class TestBaseIncrementalNotSchemaChange(BaseIncrementalNotSchemaChange):
pass


class TestBaseIncrementalBadStrategy(BaseIncrementalBadStrategy):
pass


class TestSingularTests(BaseSingularTests):
pass

Expand Down
98 changes: 0 additions & 98 deletions tests/functional/logging/test_logging.py

This file was deleted.

46 changes: 0 additions & 46 deletions tests/functional/logging/test_meta_logging.py

This file was deleted.

Loading

0 comments on commit 4fdc0b5

Please sign in to comment.