Skip to content

Commit

Permalink
new version 4.0.6 (#88)
Browse files Browse the repository at this point in the history
* new version 4.0.6

* Added tests for pg3 postgis

---------

Co-authored-by: Javier Cordero <[email protected]>
  • Loading branch information
jneight and Javier Cordero committed Jul 7, 2024
1 parent e8eb90a commit b3c8e58
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 6 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ci_psycopg2_gis.yml
Original file line number Diff line number Diff line change
@@ -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
58 changes: 58 additions & 0 deletions .github/workflows/ci_psycopg3_gis.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion django_db_geventpool/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = 'v4.0.5'
version = 'v4.0.6'
37 changes: 37 additions & 0 deletions runtests_psycopg3_gis.py
Original file line number Diff line number Diff line change
@@ -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)
12 changes: 7 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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

0 comments on commit b3c8e58

Please sign in to comment.