Skip to content

Commit

Permalink
add django 3.1 and pg13 support, drop py3.5 support (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbicr authored Sep 30, 2020
1 parent a64cd2d commit a7db6e7
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 36 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# django-pg-zero-downtime-migrations changelog

## 0.10
- added django 3.1 support
- added postgres 13 support
- drop python 3.5 support
- updated test environment

## 0.9
- fixed decimal to float migration error
- fixed django 3.0.2+ tests
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM ubuntu:18.04
FROM ubuntu:20.04

ENV LC_ALL=C.UTF-8
ENV LANG C.UTF-8

RUN apt-get update
RUN apt-get install -q -y --no-install-recommends software-properties-common
RUN DEBIAN_FRONTEND=noninteractive apt-get install -q -y --no-install-recommends software-properties-common git
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get install -q -y --no-install-recommends python3.5 python3.6 python3.7 python3.8 python3-pip libgdal20
RUN apt-get install -q -y --no-install-recommends python3.6 python3.7 python3.8 python3-pip libgdal26
RUN pip3 install setuptools tox

ADD . /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-9.5%20|%209.6%20|%2010%20|%2011%20|%2012%20-blue.svg)
![Postgres Version](https://img.shields.io/badge/postgres-9.5%20|%209.6%20|%2010%20|%2011%20|%2012%20|%2013%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
2 changes: 1 addition & 1 deletion django_zero_downtime_migrations/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.9'
__version__ = '0.10'
15 changes: 12 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
version: "3.7"
services:
pg13:
image: postgres:13-alpine
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
volumes:
- ./docker_postgres_init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql

pg12:
image: postgres:12-alpine
environment:
Expand Down Expand Up @@ -40,8 +48,8 @@ services:
volumes:
- ./docker_postgres_init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql

postgis11:
image: mdillon/postgis:11-alpine
postgis13:
image: postgis/postgis:13-3.0-alpine
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
Expand All @@ -51,11 +59,12 @@ services:
django-pg-zero-downtime-migrations-tests:
build: .
depends_on:
- pg13
- pg12
- pg11
- pg10
- pg96
- pg95
- postgis11
- postgis13
volumes:
- .:/app
2 changes: 0 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ max-line-length = 120
exclude = .tox/,venv/

[isort]
statistics = True
combine_as_imports = true
known_django = django
known_first_party = django_zero_downtime_migrations,tests
sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
default_section = THIRDPARTY
line_length = 79
multi_line_output = 5
not_skip = __init__.py
skip = .tox/,venv/

[tool:pytest]
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ def _get_long_description():
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
],
keywords='django postgres postgresql migrations',
packages=find_packages(exclude=['manage*', 'tests*']),
python_requires='>=3.5',
python_requires='>=3.6',
install_requires=[
'django>=2.2',
]
Expand Down
49 changes: 25 additions & 24 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
[tox]
envlist = py35-django22,py{36,37,38}-django{22,30}
envlist = py{36,37,38}-django{22,30,31}

[testenv]
usedevelop = True
whitelist_externals = bash
commands =
py{38}-django{30}: flake8
py{38}-django{30}: isort --check-only --diff --recursive
py{38}-django{31}: flake8
py{38}-django{31}: isort . --check --diff

py35-django22,py{36,37,38}-django{22,30}: pytest tests/unit
py35-django22,py{36,37,38}-django{22,30}: bash -c "DB_ENGINE=django_zero_downtime_migrations.backends.postgis pytest tests/unit"
py{36,37,38}-django{22,30,31}: pytest tests/unit
py{36,37,38}-django{22,30,31}: bash -c "DB_ENGINE=django_zero_downtime_migrations.backends.postgis pytest tests/unit"

py{38}-django{30}: bash -c "DB_HOST=pg12 DB_USER=test DB_ENGINE=django.db.backends.postgresql pytest tests/integration"
py{38}-django{30}: bash -c "DB_HOST=pg12 DB_USER=test pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg13 DB_USER=test DB_ENGINE=django.db.backends.postgresql pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg13 DB_USER=test pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=postgis13 DB_USER=root DB_ENGINE=django_zero_downtime_migrations.backends.postgis pytest tests/integration"

py{38}-django{30}: bash -c "DB_HOST=pg11 DB_USER=test NOTNULL=true pytest tests/integration"
py{38}-django{30}: bash -c "DB_HOST=pg11 DB_USER=test NOTNULL=false pytest tests/integration"
py{38}-django{30}: bash -c "DB_HOST=pg11 DB_USER=root NOTNULL=super pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg12 DB_USER=test pytest tests/integration"

py{38}-django{30}: bash -c "DB_HOST=pg10 DB_USER=test NOTNULL=true pytest tests/integration"
py{38}-django{30}: bash -c "DB_HOST=pg10 DB_USER=test NOTNULL=false pytest tests/integration"
py{38}-django{30}: bash -c "DB_HOST=pg10 DB_USER=root NOTNULL=super pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg11 DB_USER=test NOTNULL=true pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg11 DB_USER=test NOTNULL=false pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg11 DB_USER=root NOTNULL=super pytest tests/integration"

py{38}-django{30}: bash -c "DB_HOST=pg96 DB_USER=test NOTNULL=true pytest tests/integration"
py{38}-django{30}: bash -c "DB_HOST=pg96 DB_USER=test NOTNULL=false pytest tests/integration"
py{38}-django{30}: bash -c "DB_HOST=pg96 DB_USER=root NOTNULL=super pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg10 DB_USER=test NOTNULL=true pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg10 DB_USER=test NOTNULL=false pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg10 DB_USER=root NOTNULL=super pytest tests/integration"

py{38}-django{30}: bash -c "DB_HOST=pg95 DB_USER=test NOTNULL=true pytest tests/integration"
py{38}-django{30}: bash -c "DB_HOST=pg95 DB_USER=test NOTNULL=false pytest tests/integration"
py{38}-django{30}: bash -c "DB_HOST=pg95 DB_USER=root NOTNULL=super pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg96 DB_USER=test NOTNULL=true pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg96 DB_USER=test NOTNULL=false pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg96 DB_USER=root NOTNULL=super pytest tests/integration"

py{38}-django{31}: bash -c "DB_HOST=pg95 DB_USER=test NOTNULL=true pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg95 DB_USER=test NOTNULL=false pytest tests/integration"
py{38}-django{31}: bash -c "DB_HOST=pg95 DB_USER=root NOTNULL=super pytest tests/integration"

py{38}-django{30}: bash -c "DB_ENGINE=django_zero_downtime_migrations.backends.postgis DB_HOST=postgis11 DB_USER=root NOTNULL=true pytest tests/integration"
py{38}-django{30}: bash -c "DB_ENGINE=django_zero_downtime_migrations.backends.postgis DB_HOST=postgis11 DB_USER=root NOTNULL=false pytest tests/integration"
py{38}-django{30}: bash -c "DB_ENGINE=django_zero_downtime_migrations.backends.postgis DB_HOST=postgis11 DB_USER=root NOTNULL=super pytest tests/integration"
deps =
py{38}-django{30}: flake8
py{38}-django{30}: isort
py{38}-django{31}: flake8
py{38}-django{31}: isort

pytest
pytest-django
Expand All @@ -45,3 +45,4 @@ deps =

django{22}: django>=2.2,<2.3
django{30}: django>=3.0,<3.1
django{31}: django>=3.1,<3.2

0 comments on commit a7db6e7

Please sign in to comment.