Skip to content

Commit

Permalink
add postgres 17 support and mark postgres 12 and 13 as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
tbicr committed Feb 16, 2025
1 parent 97209de commit 62d52da
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 18 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
## 0.17
- added support for Python 3.13
- added support for Django 5.1
- added postgres 17 support
- dropped support for Python 3.6 and 3.7
- dropped support for Django 3.2, 4.0 and 4.1
- dropped `migrate_isnotnull_check_constraints` command
- marked postgres 12 support as deprecated
- marked postgres 13 support as deprecated

## 0.16
- changed `ADD COLUMN DEFAULT NULL` to safe operation for code default
Expand Down
17 changes: 10 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ ENV LC_ALL=C.UTF-8
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update
RUN apt-get install -q -y --no-install-recommends software-properties-common git gpg-agent
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get install -q -y --no-install-recommends \
RUN apt-get update && \
apt-get install -q -y --no-install-recommends software-properties-common git gpg-agent curl && \
add-apt-repository ppa:deadsnakes/ppa && \
echo "deb http://apt.postgresql.org/pub/repos/apt noble-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc > /etc/apt/trusted.gpg.d/apt.postgresql.org.asc && \
apt-get update && \
apt-get install -q -y --no-install-recommends \
python3.8 python3.8-distutils \
python3.9 python3.9-distutils \
python3.10 python3.10-distutils \
Expand All @@ -17,8 +19,9 @@ RUN apt-get install -q -y --no-install-recommends \
python3.13 \
python3-pip \
libgdal34 \
postgresql-client
RUN pip3 install --break-system-packages setuptools tox
postgresql-client-17 && \
rm -rf /var/lib/apt/lists/* && \
pip3 install --break-system-packages setuptools tox

ADD . /app
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![PyPI](https://img.shields.io/pypi/v/django-pg-zero-downtime-migrations.svg)](https://pypi.org/project/django-pg-zero-downtime-migrations/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-pg-zero-downtime-migrations.svg)
![PyPI - Django Version](https://img.shields.io/pypi/djversions/django-pg-zero-downtime-migrations.svg?label=django)
![Postgres Version](https://img.shields.io/badge/postgres-12%20|%2013%20|%2014%20|%2015%20|%2016%20-blue.svg)
![Postgres Version](https://img.shields.io/badge/postgres-12%20|%2013%20|%2014%20|%2015%20|%2016%20|%2017%20-blue.svg)
[![PyPI - License](https://img.shields.io/pypi/l/django-pg-zero-downtime-migrations.svg)](https://raw.githubusercontent.com/tbicr/django-pg-zero-downtime-migrations/master/LICENSE)

[![PyPI - Downloads](https://img.shields.io/pypi/dm/django-pg-zero-downtime-migrations.svg)](https://pypistats.org/packages/django-pg-zero-downtime-migrations)
Expand Down
15 changes: 12 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
services:
pg17:
image: postgres:17-alpine
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
volumes:
- ./docker_postgres_init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql

pg16:
image: postgres:16-alpine
environment:
Expand Down Expand Up @@ -47,8 +55,8 @@ services:
volumes:
- ./docker_postgres_init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql

postgis16:
image: postgis/postgis:16-3.4-alpine
postgis17:
image: postgis/postgis:17-3.5-alpine
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
Expand All @@ -58,12 +66,13 @@ services:
django-pg-zero-downtime-migrations-tests:
build: .
depends_on:
- pg17
- pg16
- pg15
- pg14
- pg13
- pg12
- pg11
- postgis16
- postgis17
volumes:
- .:/app
24 changes: 17 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,32 @@ envlist =
usedevelop = True
allowlist_externals = bash
commands =
# linters
py{3.13}-django{5.1}-psycopg{3}: flake8
py{3.13}-django{5.1}-psycopg{3}: isort . --check --diff

py{3.8,3.9,3.10,3.11,3.12,3.13}-django{4.2,5.0,5.1}-psycopg{2,3}: bash -c "DB_HOST=pg16 DB_USER=test pytest tests/unit"
py{3.8,3.9,3.10,3.11,3.12,3.13}-django{4.2,5.0,5.1}-psycopg{2,3}: bash -c "DB_HOST=postgis16 DB_USER=root DB_ENGINE=django_zero_downtime_migrations.backends.postgis pytest tests/unit"
# unit tests
py{3.8,3.9,3.10,3.11,3.12,3.13}-django{4.2,5.0,5.1}-psycopg{2,3}: bash -c "DB_HOST=pg17 DB_USER=test pytest tests/unit"
py{3.8,3.9,3.10,3.11,3.12,3.13}-django{4.2,5.0,5.1}-psycopg{2,3}: bash -c "DB_HOST=postgis17 DB_USER=root DB_ENGINE=django_zero_downtime_migrations.backends.postgis pytest tests/unit"

py{3.13}-django{5.1}-psycopg{3}: bash -c "DB_HOST=pg16 DB_USER=test DB_ENGINE=django.db.backends.postgresql pytest tests/integration"
py{3.13}-django{5.1}-psycopg{3}: bash -c "DB_HOST=pg16 DB_USER=test DB_SUPER_USER=root pytest tests/integration"
py{3.13}-django{5.1}-psycopg{3}: bash -c "DB_HOST=postgis16 DB_USER=root DB_ENGINE=django_zero_downtime_migrations.backends.postgis pytest tests/integration"
# integration tests
py{3.13}-django{5.1}-psycopg{3}: bash -c "DB_HOST=pg17 DB_USER=test DB_ENGINE=django.db.backends.postgresql pytest tests/integration"
py{3.13}-django{5.1}-psycopg{3}: bash -c "DB_HOST=pg17 DB_USER=test DB_SUPER_USER=root pytest tests/integration"
py{3.13}-django{5.1}-psycopg{3}: bash -c "DB_HOST=postgis17 DB_USER=root DB_ENGINE=django_zero_downtime_migrations.backends.postgis pytest tests/integration"

# old psycopg version support integration tests
py{3.13}-django{5.1}-psycopg{2}: bash -c "DB_HOST=pg17 DB_USER=test DB_SUPER_USER=root pytest tests/integration"

# old postgres version support integration tests
py{3.13}-django{5.1}-psycopg{3}: bash -c "DB_HOST=pg16 DB_USER=test DB_SUPER_USER=root pytest tests/integration"
py{3.13}-django{5.1}-psycopg{3}: bash -c "DB_HOST=pg15 DB_USER=test DB_SUPER_USER=root pytest tests/integration"
py{3.13}-django{5.1}-psycopg{3}: bash -c "DB_HOST=pg14 DB_USER=test DB_SUPER_USER=root pytest tests/integration"
py{3.13}-django{5.1}-psycopg{3}: bash -c "DB_HOST=pg13 DB_USER=test DB_SUPER_USER=root pytest tests/integration"

py{3.12}-django{5.0}-psycopg{3}: bash -c "DB_HOST=pg12 DB_USER=test DB_SUPER_USER=root pytest tests/integration"
py{3.12}-django{4.2}-psycopg{3}: bash -c "DB_HOST=pg16 DB_USER=test DB_SUPER_USER=root pytest tests/integration"

# old django version support integration tests
py{3.12}-django{5.0}-psycopg{3}: bash -c "DB_HOST=pg17 DB_USER=test DB_SUPER_USER=root pytest tests/integration"
py{3.12}-django{4.2}-psycopg{3}: bash -c "DB_HOST=pg17 DB_USER=test DB_SUPER_USER=root pytest tests/integration"

deps =
py{3.13}-django{5.1}-psycopg{3}: flake8
Expand Down

0 comments on commit 62d52da

Please sign in to comment.