diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 8d7113079a..2680bf9662 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -17,6 +17,9 @@ set -eo pipefail cd github/python-spanner-django +python3.6 -m venv env +source env/bin/activate + # Disable buffering, so that the logs stream through. export PYTHONUNBUFFERED=1 @@ -36,6 +39,8 @@ python3.6 -m pip uninstall --yes --quiet nox-automation python3.6 -m pip install --upgrade --quiet nox python3.6 -m nox --version +python3.6 -m pip install --upgrade requests + # If NOX_SESSION is set, it only runs the specified session, # otherwise run all the sessions. if [[ -n "${NOX_SESSION:-}" ]]; then @@ -57,7 +62,7 @@ pip3 install . # Create a unique DJANGO_TESTS_DIR per worker to avoid # any clashes with configured tests by other workers. export DJANGO_TESTS_DIR="django_tests_$DJANGO_WORKER_INDEX" -mkdir -p $DJANGO_TESTS_DIR && git clone --depth 1 --single-branch --branch spanner-2.2.x https://github.com/timgraham/django.git $DJANGO_TESTS_DIR/django +mkdir -p $DJANGO_TESTS_DIR && git clone --depth 1 --single-branch --branch stable/2.2.x https://github.com/django/django.git $DJANGO_TESTS_DIR/django # Install dependencies for Django tests. sudo apt-get update diff --git a/django_spanner/__init__.py b/django_spanner/__init__.py index 4d94bebf4f..e0147c7674 100644 --- a/django_spanner/__init__.py +++ b/django_spanner/__init__.py @@ -20,11 +20,9 @@ from .expressions import register_expressions from .functions import register_functions from .lookups import register_lookups -from .utils import check_django_compatability __version__ = pkg_resources.get_distribution("django-google-spanner").version -check_django_compatability() register_expressions() register_functions() register_lookups() diff --git a/django_test_suite.sh b/django_test_suite.sh index e87cd6167f..50bb40443c 100755 --- a/django_test_suite.sh +++ b/django_test_suite.sh @@ -11,7 +11,7 @@ set -e # so that we can have multiple tests running without # conflicting which changes and constraints. We'll always # cleanup the created database. -TEST_DBNAME=${SPANNER_TEST_DB:-$(python3 -c 'import os, time; print(chr(ord("a") + time.time_ns() % 26)+os.urandom(10).hex())')} +TEST_DBNAME=${SPANNER_TEST_DB:-$(python3 -c 'import os, time; print(chr(ord("a") + time.time() % 26)+os.urandom(10).hex())')} TEST_DBNAME_OTHER="$TEST_DBNAME-ot" TEST_APPS=${DJANGO_TEST_APPS:-basic} INSTANCE=${SPANNER_TEST_INSTANCE:-django-tests} diff --git a/setup.py b/setup.py index df3d7a0fba..13e8d4a689 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,11 @@ # 'Development Status :: 4 - Beta' # 'Development Status :: 5 - Production/Stable' release_status = "Development Status :: 3 - Alpha" -dependencies = ["sqlparse >= 0.3.0", "google-cloud-spanner >= 1.8.0"] +dependencies = [ + "sqlparse >= 0.3.0", + "google-cloud-spanner >= 1.8.0", + "requests >= 2.22.0", +] extras = {} BASE_DIR = os.path.dirname(__file__)