From 886d7bf383d799225cfe2b13b20b5fef64b05f15 Mon Sep 17 00:00:00 2001 From: IlyaFaer Date: Mon, 5 Oct 2020 11:07:26 +0300 Subject: [PATCH 01/11] test: don't use Django fork for testing --- .kokoro/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 8d7113079a..ad6879e0aa 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -57,7 +57,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 master https://github.com/django/django.git $DJANGO_TESTS_DIR/django # Install dependencies for Django tests. sudo apt-get update From 560fce8da400abdc36426bf978ebb8f6f5170962 Mon Sep 17 00:00:00 2001 From: IlyaFaer Date: Mon, 5 Oct 2020 11:30:48 +0300 Subject: [PATCH 02/11] try not to check Django compatibility --- django_spanner/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_spanner/__init__.py b/django_spanner/__init__.py index 4d94bebf4f..7f188cd673 100644 --- a/django_spanner/__init__.py +++ b/django_spanner/__init__.py @@ -24,7 +24,7 @@ __version__ = pkg_resources.get_distribution("django-google-spanner").version -check_django_compatability() +# check_django_compatability() register_expressions() register_functions() register_lookups() From 30415a2a808535b184a3e9adb840832798b8cedf Mon Sep 17 00:00:00 2001 From: IlyaFaer Date: Mon, 5 Oct 2020 11:45:48 +0300 Subject: [PATCH 03/11] fix lint --- .kokoro/build.sh | 2 +- django_spanner/__init__.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index ad6879e0aa..84cead2d9c 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -57,7 +57,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 master https://github.com/django/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 7f188cd673..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() From e0bb2945fd4067918ead4d3a02edddcd9febdd80 Mon Sep 17 00:00:00 2001 From: IlyaFaer Date: Mon, 5 Oct 2020 12:27:18 +0300 Subject: [PATCH 04/11] try to upgrade requests --- .kokoro/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 84cead2d9c..53b449aa29 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -34,6 +34,7 @@ python3.6 -m pip uninstall --yes --quiet nox-automation # Install nox python3.6 -m pip install --upgrade --quiet nox +python3.6 -m pip install --upgrade requests python3.6 -m nox --version # If NOX_SESSION is set, it only runs the specified session, From 85f5132ff5178ba16abe90423238a172a7fc383c Mon Sep 17 00:00:00 2001 From: IlyaFaer Date: Mon, 5 Oct 2020 13:05:37 +0300 Subject: [PATCH 05/11] update package dependencies --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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__) From 079cebf225d19e67ea5c57c2798694e3ddd8a12a Mon Sep 17 00:00:00 2001 From: IlyaFaer Date: Mon, 5 Oct 2020 13:20:35 +0300 Subject: [PATCH 06/11] update requests for python 3.8 --- .kokoro/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 53b449aa29..8aa73ad2db 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -35,6 +35,7 @@ python3.6 -m pip uninstall --yes --quiet nox-automation # Install nox python3.6 -m pip install --upgrade --quiet nox python3.6 -m pip install --upgrade requests +python3.8 -m pip install --upgrade requests python3.6 -m nox --version # If NOX_SESSION is set, it only runs the specified session, From f24427b1b0c20dc25ac55a22703db82e85c5a1e3 Mon Sep 17 00:00:00 2001 From: IlyaFaer Date: Tue, 6 Oct 2020 12:41:45 +0300 Subject: [PATCH 07/11] try pip3 upgrade --- .kokoro/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 8aa73ad2db..ea2c93ecf2 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -56,6 +56,7 @@ export RUNNING_SPANNER_BACKEND_TESTS=1 export USE_SPANNER_EMULATOR=0 pip3 install . +pip3 install --upgrade requests # 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" From aa6be343c4ed6273026b4b7809bf4782d71d77cf Mon Sep 17 00:00:00 2001 From: IlyaFaer Date: Tue, 6 Oct 2020 18:19:01 +0300 Subject: [PATCH 08/11] one more try --- .kokoro/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index ea2c93ecf2..a255d0b49c 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -65,7 +65,7 @@ mkdir -p $DJANGO_TESTS_DIR && git clone --depth 1 --single-branch --branch stabl # Install dependencies for Django tests. sudo apt-get update apt-get install -y libffi-dev libjpeg-dev zlib1g-dev libmemcached-dev -cd $DJANGO_TESTS_DIR/django && pip3 install -e . && pip3 install -r tests/requirements/py3.txt; cd ../../ +cd $DJANGO_TESTS_DIR/django && pip3 install -e . && pip3 install -r tests/requirements/py3.txt && pip3 install --upgrade requests; cd ../../ if [[ $USE_SPANNER_EMULATOR != 1 ]] then From 1412a9bfa0088da3dffb5ffa2b67141bfc403208 Mon Sep 17 00:00:00 2001 From: IlyaFaer Date: Tue, 6 Oct 2020 18:37:50 +0300 Subject: [PATCH 09/11] reinstall requests --- .kokoro/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index a255d0b49c..1c27a781b3 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -65,7 +65,7 @@ mkdir -p $DJANGO_TESTS_DIR && git clone --depth 1 --single-branch --branch stabl # Install dependencies for Django tests. sudo apt-get update apt-get install -y libffi-dev libjpeg-dev zlib1g-dev libmemcached-dev -cd $DJANGO_TESTS_DIR/django && pip3 install -e . && pip3 install -r tests/requirements/py3.txt && pip3 install --upgrade requests; cd ../../ +cd $DJANGO_TESTS_DIR/django && pip3 install -e . && pip3 install -r tests/requirements/py3.txt && pip3 uninstall -y requests && pip3 install --upgrade requests; cd ../../ if [[ $USE_SPANNER_EMULATOR != 1 ]] then From 80f5861c85034448b2addf1779716aea094ef6be Mon Sep 17 00:00:00 2001 From: IlyaFaer Date: Fri, 9 Oct 2020 16:10:11 +0300 Subject: [PATCH 10/11] try to use virtual env --- .kokoro/build.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 1c27a781b3..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 @@ -34,10 +37,10 @@ python3.6 -m pip uninstall --yes --quiet nox-automation # Install nox python3.6 -m pip install --upgrade --quiet nox -python3.6 -m pip install --upgrade requests -python3.8 -m pip install --upgrade requests 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 @@ -56,7 +59,6 @@ export RUNNING_SPANNER_BACKEND_TESTS=1 export USE_SPANNER_EMULATOR=0 pip3 install . -pip3 install --upgrade requests # 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" @@ -65,7 +67,7 @@ mkdir -p $DJANGO_TESTS_DIR && git clone --depth 1 --single-branch --branch stabl # Install dependencies for Django tests. sudo apt-get update apt-get install -y libffi-dev libjpeg-dev zlib1g-dev libmemcached-dev -cd $DJANGO_TESTS_DIR/django && pip3 install -e . && pip3 install -r tests/requirements/py3.txt && pip3 uninstall -y requests && pip3 install --upgrade requests; cd ../../ +cd $DJANGO_TESTS_DIR/django && pip3 install -e . && pip3 install -r tests/requirements/py3.txt; cd ../../ if [[ $USE_SPANNER_EMULATOR != 1 ]] then From 7d0bc0cc651a0432430428ac06cdef2c39af843c Mon Sep 17 00:00:00 2001 From: IlyaFaer Date: Mon, 19 Oct 2020 12:20:32 +0300 Subject: [PATCH 11/11] fix the lack of time_ns() function --- django_test_suite.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}