Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 1d61844

Browse files
authored
Drop support for Python 3.8 (#1373)
* drop support for python 3.8
1 parent 455c768 commit 1d61844

File tree

11 files changed

+51
-47
lines changed

11 files changed

+51
-47
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Breaking Changes
2+
body: Drop support for Python 3.8
3+
time: 2024-10-16T18:51:17.581547-04:00
4+
custom:
5+
Author: mikealfare
6+
Issue: "1373"

.github/scripts/integration-test-matrix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = ({ context }) => {
2-
const defaultPythonVersion = "3.8";
3-
const supportedPythonVersions = ["3.8", "3.9", "3.10", "3.11", "3.12"];
2+
const defaultPythonVersion = "3.9";
3+
const supportedPythonVersions = ["3.9", "3.10", "3.11", "3.12"];
44
const supportedAdapters = ["bigquery"];
55

66
// if PR, generate matrix based on files changed and PR labels

.github/workflows/integration.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ on:
3333
# all PRs, important to note that `pull_request_target` workflows
3434
# will run in the context of the target branch of a PR
3535
pull_request_target:
36+
types: [opened, reopened, synchronize, labeled]
3637
# manual trigger
3738
workflow_dispatch:
3839
inputs:
@@ -280,10 +281,10 @@ jobs:
280281
persist-credentials: false
281282
ref: ${{ github.event.pull_request.head.sha }}
282283

283-
- name: Set up Python 3.8
284+
- name: Set up Python 3.9
284285
uses: actions/setup-python@v5
285286
with:
286-
python-version: "3.8"
287+
python-version: "3.9"
287288

288289
- name: Install python dependencies
289290
run: |

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
- name: Set up Python
5151
uses: actions/setup-python@v5
5252
with:
53-
python-version: '3.8'
53+
python-version: '3.9'
5454

5555
- name: Install python dependencies
5656
run: |
@@ -70,7 +70,7 @@ jobs:
7070
strategy:
7171
fail-fast: false
7272
matrix:
73-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
73+
python-version: ['3.9', '3.10', '3.11', '3.12']
7474

7575
env:
7676
TOXENV: "unit"
@@ -127,7 +127,7 @@ jobs:
127127
- name: Set up Python
128128
uses: actions/setup-python@v5
129129
with:
130-
python-version: '3.8'
130+
python-version: '3.9'
131131

132132
- name: Install python dependencies
133133
run: |
@@ -175,7 +175,7 @@ jobs:
175175
fail-fast: false
176176
matrix:
177177
os: [ubuntu-latest, macos-12, windows-latest]
178-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
178+
python-version: ['3.9', '3.10', '3.11', '3.12']
179179

180180
steps:
181181
- name: Set up Python ${{ matrix.python-version }}

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ repos:
2424
- id: black
2525
args:
2626
- --line-length=99
27-
- --target-version=py38
2827
- --target-version=py39
2928
- --target-version=py310
3029
- --target-version=py311

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ $EDITOR test.env
6767
There are a few methods for running tests locally.
6868

6969
#### `tox`
70-
`tox` takes care of managing Python virtualenvs and installing dependencies in order to run tests. You can also run tests in parallel, for example you can run unit tests for Python 3.8, Python 3.9, Python 3.10, and Python 3.11 in parallel with `tox -p`. Also, you can run unit tests for specific python versions with `tox -e py38`. The configuration of these tests are located in `tox.ini`.
70+
`tox` takes care of managing Python virtualenvs and installing dependencies in order to run tests. You can also run tests in parallel, for example you can run unit tests for Python 3.9, Python 3.10, and Python 3.11 in parallel with `tox -p`. Also, you can run unit tests for specific python versions with `tox -e py39`. The configuration of these tests are located in `tox.ini`.
7171

7272
#### `pytest`
7373
Finally, you can also run a specific test or group of tests using `pytest` directly. With a Python virtualenv active and dev dependencies installed you can do things like:

dev-requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core
66

77
# dev
88
ddtrace==2.3.0
9-
pre-commit~=3.7.0;python_version>="3.9"
10-
pre-commit~=3.5.0;python_version<"3.9"
9+
pre-commit~=3.7.0
1110
pytest~=7.4
1211
pytest-csv~=3.0
1312
pytest-dotenv~=0.5.2

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# this image gets published to GHCR for production use
22
ARG py_version=3.11.2
33

4-
FROM python:$py_version-slim-bullseye as base
4+
FROM python:$py_version-slim-bullseye AS base
55

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

2727

28-
FROM base as dbt-bigquery
28+
FROM base AS dbt-bigquery
2929

3030
ARG commit_ref=main
3131

docker/dev.Dockerfile

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
# this image does not get published, it is intended for local development only, see `Makefile` for usage
2-
FROM ubuntu:24.04 as base
2+
FROM ubuntu:24.04 AS base
33

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

77
# add python repository
88
RUN apt-get update \
9-
&& apt-get install -y software-properties-common=0.99.22.9 \
10-
&& add-apt-repository -y ppa:deadsnakes/ppa \
11-
&& apt-get clean \
12-
&& rm -rf \
13-
/var/lib/apt/lists/* \
14-
/tmp/* \
15-
/var/tmp/*
9+
&& apt-get install -y software-properties-common=0.99.48 \
10+
&& add-apt-repository -y ppa:deadsnakes/ppa \
11+
&& apt-get clean \
12+
&& rm -rf \
13+
/var/lib/apt/lists/* \
14+
/tmp/* \
15+
/var/tmp/*
1616

1717
# install python
1818
RUN apt-get update \
19-
&& apt-get install -y --no-install-recommends \
20-
build-essential=12.9ubuntu3 \
21-
git-all=1:2.34.1-1ubuntu1.10 \
22-
python3.8=3.8.19-1+jammy1 \
23-
python3.8-dev=3.8.19-1+jammy1 \
24-
python3.8-distutils=3.8.19-1+jammy1 \
25-
python3.8-venv=3.8.19-1+jammy1 \
26-
python3-pip=22.0.2+dfsg-1ubuntu0.4 \
27-
python3-wheel=0.37.1-2ubuntu0.22.04.1 \
28-
&& apt-get clean \
29-
&& rm -rf \
30-
/var/lib/apt/lists/* \
31-
/tmp/* \
32-
/var/tmp/*
19+
&& apt-get install -y --no-install-recommends \
20+
build-essential=12.10ubuntu1 \
21+
git-all=1:2.43.0-1ubuntu7.1 \
22+
python3.9=3.9.20-1+noble1 \
23+
python3.9-dev=3.9.20-1+noble1 \
24+
python3.9-distutils=3.9.20-1+noble1 \
25+
python3.9-venv=3.9.20-1+noble1 \
26+
python3-pip=24.0+dfsg-1ubuntu1 \
27+
python3-wheel=0.42.0-2 \
28+
&& apt-get clean \
29+
&& rm -rf \
30+
/var/lib/apt/lists/* \
31+
/tmp/* \
32+
/var/tmp/*
3333

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

3737

38-
FROM base as dbt-bigquery-dev
38+
FROM base AS dbt-bigquery-dev
3939

40-
HEALTHCHECK CMD python3 --version || exit 1
40+
HEALTHCHECK CMD python --version || exit 1
4141

4242
# send stdout/stderr to terminal
4343
ENV PYTHONUNBUFFERED=1

setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import sys
33

44
# require a supported version of Python
5-
if sys.version_info < (3, 8):
5+
if sys.version_info < (3, 9):
66
print("Error: dbt does not support this version of Python.")
7-
print("Please upgrade to Python 3.8 or higher.")
7+
print("Please upgrade to Python 3.9 or higher.")
88
sys.exit(1)
99

1010
try:
@@ -69,11 +69,10 @@ def _dbt_bigquery_version() -> str:
6969
"Operating System :: Microsoft :: Windows",
7070
"Operating System :: MacOS :: MacOS X",
7171
"Operating System :: POSIX :: Linux",
72-
"Programming Language :: Python :: 3.8",
7372
"Programming Language :: Python :: 3.9",
7473
"Programming Language :: Python :: 3.10",
7574
"Programming Language :: Python :: 3.11",
7675
"Programming Language :: Python :: 3.12",
7776
],
78-
python_requires=">=3.8",
77+
python_requires=">=3.9",
7978
)

0 commit comments

Comments
 (0)