summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/make_errorcodes.py4
-rwxr-xr-xscripts/refcounter.py16
-rwxr-xr-xscripts/travis_prepare.sh6
-rwxr-xr-xscripts/travis_test.sh2
4 files changed, 13 insertions, 15 deletions
diff --git a/scripts/make_errorcodes.py b/scripts/make_errorcodes.py
index 53808a6..3c72a2c 100755
--- a/scripts/make_errorcodes.py
+++ b/scripts/make_errorcodes.py
@@ -33,7 +33,7 @@ def main():
file_start = read_base_file(filename)
# If you add a version to the list fix the docs (in errorcodes.rst)
classes, errors = fetch_errors(
- ['9.1', '9.2', '9.3', '9.4', '9.5', '9.6', '10'])
+ ['9.1', '9.2', '9.3', '9.4', '9.5', '9.6', '10', '11'])
f = open(filename, "w")
for line in file_start:
@@ -111,7 +111,7 @@ def fetch_errors(versions):
# TODO: this error was added in PG 10 beta 1 but dropped in the
# final release. It doesn't harm leaving it in the file. Check if it
- # will be added back in PG 11.
+ # will be added back in PG 12.
# https://github.com/postgres/postgres/commit/28e0727076
errors['55']['55P04'] = 'UNSAFE_NEW_ENUM_VALUE_USAGE'
diff --git a/scripts/refcounter.py b/scripts/refcounter.py
index f41dc21..a5f62d0 100755
--- a/scripts/refcounter.py
+++ b/scripts/refcounter.py
@@ -19,6 +19,7 @@ script exits with error 1.
# License for more details.
from __future__ import print_function
+import argparse
import gc
import sys
import difflib
@@ -62,19 +63,16 @@ def main():
def parse_args():
- import optparse
-
- parser = optparse.OptionParser(description=__doc__)
- parser.add_option('--nruns', type='int', metavar="N", default=3,
- help="number of test suite runs [default: %default]")
- parser.add_option('--suite', metavar="NAME",
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('--nruns', type=int, metavar="N", default=3,
+ help="number of test suite runs [default: %(default)d]")
+ parser.add_argument('--suite', metavar="NAME",
help="the test suite to run (e.g. 'test_cursor'). [default: all]")
- parser.add_option('--objs', metavar="TYPE",
+ parser.add_argument('--objs', metavar="TYPE",
help="in case of leaks, print a report of object TYPE "
"(support still incomplete)")
- opt, args = parser.parse_args()
- return opt
+ return parser.parse_args()
def dump(i, opt):
diff --git a/scripts/travis_prepare.sh b/scripts/travis_prepare.sh
index 73cbb84..f2e06b7 100755
--- a/scripts/travis_prepare.sh
+++ b/scripts/travis_prepare.sh
@@ -38,8 +38,8 @@ create () {
export PGBIN="$PGDIR/bin"
# install postgres versions not available on the image
- if (( "$VERNUM" < 902 || "$VERNUM" > 906 )); then
- wget -O - http://initd.org/psycopg/upload/postgresql/postgresql-${PACKAGE}.tar.bz2 \
+ if [[ ! -d "${PGDIR}" ]]; then
+ wget -O - http://initd.org/psycopg/upload/postgresql/postgresql-${PACKAGE}-$(lsb_release -cs).tar.bz2 \
| sudo tar xjf - -C /usr/lib/postgresql
fi
@@ -109,7 +109,6 @@ if [[ -z "$DONT_TEST_PRESENT" ]]; then
create 9.6
create 9.5
create 9.4
- create 9.3
fi
# Unsupported postgres versions that we still support
@@ -124,6 +123,7 @@ if [[ -n "$TEST_PAST" ]]; then
create 9.0
create 9.1
create 9.2
+ create 9.3
fi
# Postgres built from master
diff --git a/scripts/travis_test.sh b/scripts/travis_test.sh
index 342e24c..8ca4e9a 100755
--- a/scripts/travis_test.sh
+++ b/scripts/travis_test.sh
@@ -50,12 +50,12 @@ if [[ -z "$DONT_TEST_PRESENT" ]]; then
run_test 9.6
run_test 9.5
run_test 9.4
- run_test 9.3
fi
# Unsupported postgres versions that we still support
# Images built by https://github.com/psycopg/psycopg2-wheels/tree/build-dinosaurs
if [[ -n "$TEST_PAST" ]]; then
+ run_test 9.3
run_test 9.2
run_test 9.1
run_test 9.0