diff --git a/.github/workflows/ci_psycopg2_gis.yml b/.github/workflows/ci_psycopg2_gis.yml new file mode 100644 index 0000000..6107452 --- /dev/null +++ b/.github/workflows/ci_psycopg2_gis.yml @@ -0,0 +1,68 @@ +name: CI-psycopg2-gis +'on': + push: + branches: + - master + pull_request: + branches: + - master +jobs: + build: + env: + POSTGRES_USER: postgres + PGPASSWORD: postgres + runs-on: '${{ matrix.os }}' + strategy: + matrix: + include: + - os: ubuntu-latest + python-version: '3.8' + django-version: '3.2.23' + - os: ubuntu-latest + python-version: '3.9' + django-version: '3.2.23' + - os: ubuntu-latest + python-version: '3.10' + django-version: '3.2.23' + - os: ubuntu-latest + python-version: '3.8' + django-version: '4.2.9' + - os: ubuntu-latest + python-version: '3.9' + django-version: '4.2.9' + - os: ubuntu-latest + python-version: '3.10' + django-version: '4.2.9' + - os: ubuntu-latest + python-version: '3.11' + django-version: '4.2.9' + - os: ubuntu-latest + python-version: '3.12' + django-version: '4.2.9' + services: + postgres: + image: postgis/postgis + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + steps: + - name: 'Set up Python ${{ matrix.python-version }}' + uses: actions/setup-python@v5 + with: + python-version: '${{ matrix.python-version }}' + - uses: actions/checkout@v4 + - run: sudo apt-get install gdal-bin libgdal-dev + - run: pip install django==${{ matrix.django-version}} + - run: pip install psycopg2 + - run: pip install psycogreen + - run: pip install gevent + - run: pip install gdal==3.4.1 + - run: pip install . + - run: python runtests_psycopg2_gis.py diff --git a/.github/workflows/ci_psycopg3_gis.yml b/.github/workflows/ci_psycopg3_gis.yml new file mode 100644 index 0000000..b7966df --- /dev/null +++ b/.github/workflows/ci_psycopg3_gis.yml @@ -0,0 +1,58 @@ +name: CI-psycopg3-gis +'on': + push: + branches: + - master + pull_request: + branches: + - master +jobs: + build: + env: + POSTGRES_USER: postgres + PGPASSWORD: postgres + runs-on: '${{ matrix.os }}' + strategy: + matrix: + include: + - os: ubuntu-latest + python-version: '3.8' + django-version: '4.2.9' + - os: ubuntu-latest + python-version: '3.9' + django-version: '4.2.9' + - os: ubuntu-latest + python-version: '3.10' + django-version: '4.2.9' + - os: ubuntu-latest + python-version: '3.11' + django-version: '4.2.9' + - os: ubuntu-latest + python-version: '3.12' + django-version: '4.2.9' + services: + postgres: + image: postgis/postgis + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + steps: + - name: 'Set up Python ${{ matrix.python-version }}' + uses: actions/setup-python@v5 + with: + python-version: '${{ matrix.python-version }}' + - uses: actions/checkout@v4 + - run: sudo apt-get install gdal-bin libgdal-dev + - run: pip install django==${{ matrix.django-version}} + - run: pip install psycopg[binary] + - run: pip install gevent + - run: pip install gdal==3.4.1 + - run: pip install . + - run: python runtests_psycopg3_gis.py diff --git a/django_db_geventpool/__init__.py b/django_db_geventpool/__init__.py index b2f5605..609611f 100755 --- a/django_db_geventpool/__init__.py +++ b/django_db_geventpool/__init__.py @@ -1 +1 @@ -version = 'v4.0.5' +version = 'v4.0.6' diff --git a/runtests_psycopg3_gis.py b/runtests_psycopg3_gis.py new file mode 100644 index 0000000..2856196 --- /dev/null +++ b/runtests_psycopg3_gis.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +import sys +import gevent.monkey + +gevent.monkey.patch_all() + +import django +from django.conf import settings +from django.test.runner import DiscoverRunner + + +settings.configure( + DEBUG=True, + DATABASES={ + "default": { + "ENGINE": "django_db_geventpool.backends.postgis", + "NAME": "test", + "USER": "postgres", + "PASSWORD": "postgres", + "ATOMIC_REQUESTS": False, + "CONN_MAX_AGE": 0, + "HOST": "localhost", + } + }, + INSTALLED_APPS=( + "tests", + "django_db_geventpool", + ), + USE_TZ=True, +) +django.setup() + +test_runner = DiscoverRunner(verbosity=2) + +failures = test_runner.run_tests(["tests"]) +if failures: + sys.exit(failures) diff --git a/tox.ini b/tox.ini index abb6cdb..c6873ab 100644 --- a/tox.ini +++ b/tox.ini @@ -8,9 +8,9 @@ python = [tox] envlist = - py3{8,9,10,11,12}-dj{32,42}-pg{is,2} - py3{8,9,10,11,12}-dj{42}-pg{3} - py3{10,11,12}-dj{50}-pg{is,2,3} + py3{8,9,10,11,12}-dj{32,42}-pg{2-gis,2} + py3{8,9,10,11,12}-dj{42}-pg{3-gis,3} + py3{10,11,12}-dj{50}-pg{2-gis,2,3-gis,3} [testenv] deps = @@ -19,11 +19,13 @@ deps = dj32: django~=3.2 dj42: django~=4.2 dj50: django~=5.0 - pgis: psycopg2-binary + pg2-gis: psycopg2-binary pg2: psycopg2-binary + pg3-gis: psycopg[binary,pool] pg3: psycopg[binary,pool] commands = - pgis: python -Wall runtests_psycopg2_gis.py + pg2-gis: python -Wall runtests_psycopg2_gis.py pg2: python -Wall runtests_psycopg2.py + pg3-gis:python -Wall runtests_psycopg3_gis.py pg3: python -Wall runtests_psycopg3.py