From 159bdd8fef0507edd85548db7430525854d51c4b Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Sat, 18 Jun 2022 23:52:16 +0200 Subject: [PATCH 1/3] CI: Update to `actions/setup-python@v4` --- .github/workflows/docs.yml | 2 +- .github/workflows/nightly.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/tests.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3a7f2b2a..d30a6720 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.9' diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index fcda7737..54cc30ad 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -24,7 +24,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99984d86..b005723b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.9' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e8ba181e..f42401d6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} From 3d32174b4bfb8bf7d6ea5de11dc417ae687c356b Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Sun, 19 Jun 2022 01:43:50 +0200 Subject: [PATCH 2/3] Sandbox: Reduce footprint of Buildout - The sandbox setup is now based on vanilla Python and virtualenv. - A convenient bootstrap script is provided, which can be used like `source bootstrap.sh`. - The test runner has not been changed, it is still `zope.testrunner`. - The command line invocation interface `./bin/test` has not been changed. - Buildout is now only used for downloading the CrateDB tarball using `hexagonit.recipe.download`. References: - https://github.com/crate/crate-python/pull/428 - https://github.com/crate-workbench/test-buildout-python310/issues/1 --- .github/workflows/nightly.yml | 8 ++-- .github/workflows/tests.yml | 10 ++-- .gitignore | 4 +- DEVELOP.rst | 32 ++++++------- base.cfg | 49 ------------------- bin/sphinx | 15 ++++++ bin/test | 16 +++++++ bootstrap.sh | 90 +++++++++++++++++++++++++++++++++++ buildout.cfg | 36 +++++++------- devtools/create_tag.sh | 2 +- devtools/setup_ci.sh | 12 ++--- setup.cfg | 2 +- setup.py | 13 +++-- versions.cfg | 61 ------------------------ 14 files changed, 180 insertions(+), 170 deletions(-) delete mode 100644 base.cfg create mode 100755 bin/sphinx create mode 100755 bin/test create mode 100644 bootstrap.sh diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 54cc30ad..ddbff1d4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -28,11 +28,13 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Propagate matrix information run: | + source bootstrap.sh ./devtools/setup_ci.sh --cratedb-version=${{ matrix.cratedb-version }} --sqlalchemy-version=${{ matrix.sqla-version }} - name: Invoke tests run: | - bin/flake8 - bin/coverage run bin/test -vv1 + source bootstrap.sh + flake8 src bin + coverage run bin/test -vv1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f42401d6..c6ce2bfb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,15 +35,17 @@ jobs: brew install gnu-getopt echo "/usr/local/opt/gnu-getopt/bin" >> $GITHUB_PATH - - name: Install dependencies + - name: Propagate matrix information run: | + source bootstrap.sh ./devtools/setup_ci.sh --cratedb-version=${{ matrix.cratedb-version }} --sqlalchemy-version=${{ matrix.sqla-version }} - name: Invoke tests run: | - bin/flake8 - bin/coverage run bin/test -vv1 - bin/coverage xml + source bootstrap.sh + flake8 src bin + coverage run bin/test -vv1 + coverage xml # https://github.com/codecov/codecov-action - name: Upload coverage results to Codecov diff --git a/.gitignore b/.gitignore index e62679a3..aeca2d6b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,9 @@ coverage.xml .tox/ *.DS_Store *.pyc -bin/ +bin/* +!bin/test +!bin/sphinx build/ crate-python.iml crate.egg-info diff --git a/DEVELOP.rst b/DEVELOP.rst index d3d7efd4..a6e8ff3c 100644 --- a/DEVELOP.rst +++ b/DEVELOP.rst @@ -5,27 +5,22 @@ Developer guide Setup ===== -This project uses buildout_ to set up the development environment. +To start things off, bootstrap the sandbox environment:: -To start things off, create a Python virtualenv and install buildout:: + source bootstrap.sh - python3 -m venv .venv - source .venv/bin/activate +This command should automatically install all prerequisites for the development +sandbox and drop you into the virtualenv, ready for invoking further commands. - # Workaround for Python 3.5 - python -m pip install --upgrade "setuptools>=31,<51" - - pip install zc.buildout==2.13.4 - -Then, run:: - - buildout -N Running tests ============= All tests will be invoked using the Python interpreter that was used when -creating the Python virtualenv. The test runner is zope.testrunner_. +creating the Python virtualenv. The test runner is `zope.testrunner`_. + +Some examples are outlined below. In order to learn about more details, +see, for example, `useful command-line options for zope-testrunner`_. Run all tests:: @@ -41,18 +36,18 @@ Ignore specific test directories:: ./bin/test -vvvv --ignore_dir=testing -You can run the tests against multiple Python interpreters with tox_:: +You can run the tests against multiple Python interpreters with `tox`_:: - ./bin/tox + tox To do this, you will need the respective Python interpreter versions available on your ``$PATH``. To run against a single interpreter, you can also invoke:: - ./bin/tox -e py37 + tox -e py37 -*Note*: before running the tests, make sure to stop all CrateDB instances which +*Note*: Before running the tests, make sure to stop all CrateDB instances which are listening on the default CrateDB transport port to avoid side effects with the test layer. @@ -121,5 +116,6 @@ nothing special you need to do to get the live docs to update. .. _Sphinx: http://sphinx-doc.org/ .. _tox: http://testrun.org/tox/latest/ .. _twine: https://pypi.python.org/pypi/twine -.. _zope.testrunner: https://pypi.python.org/pypi/zope.testrunner/4.4.1 +.. _useful command-line options for zope-testrunner: https://pypi.org/project/zope.testrunner/#some-useful-command-line-options-to-get-you-started .. _versions hosted on ReadTheDocs: https://readthedocs.org/projects/crate-python/versions/ +.. _zope.testrunner: https://pypi.org/project/zope.testrunner/ diff --git a/base.cfg b/base.cfg deleted file mode 100644 index e470e47b..00000000 --- a/base.cfg +++ /dev/null @@ -1,49 +0,0 @@ -[buildout] -develop = . -extends = versions.cfg -versions = versions -show-picked-versions = true -parts = test - crate - scripts - coverage - linter - -[scripts] -recipe = zc.recipe.egg:script -interpreter = py -eggs = crate - crate [test,sqlalchemy] - -[coverage] -recipe = zc.recipe.egg -eggs = createcoverage - -[crate:linux] -recipe = hexagonit.recipe.download -url = https://cdn.crate.io/downloads/releases/crate-${versions:crate_server}.tar.gz -strip-top-level-dir = true - -[crate:macosx] -recipe = hexagonit.recipe.download -url = https://cdn.crate.io/downloads/releases/cratedb/x64_mac/crate-${versions:crate_server}.tar.gz -strip-top-level-dir = true - -[crate:windows] -recipe = hexagonit.recipe.download -url = https://cdn.crate.io/downloads/releases/cratedb/x64_windows/crate-${versions:crate_server}.zip -strip-top-level-dir = true - -[test] -relative-paths = true -recipe = zc.recipe.testrunner -defaults = ['--auto-color'] -eggs = crate [test,sqlalchemy] - -[linter] -recipe = zc.recipe.egg:script -eggs = flake8 -scripts = flake8 -initialization = - sys.argv.extend(['--count', - '${buildout:directory}/src']) diff --git a/bin/sphinx b/bin/sphinx new file mode 100755 index 00000000..31463469 --- /dev/null +++ b/bin/sphinx @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import os +import sys + +join = os.path.join +base = os.path.dirname(os.path.abspath(os.path.realpath(__file__))) +base = os.path.dirname(base) + + +sys.argv.extend(['-b', 'html', '-E', 'docs', './out/html']) +import sphinx.cmd.build # noqa:E402 + + +if __name__ == '__main__': + sys.exit(sphinx.cmd.build.main()) diff --git a/bin/test b/bin/test new file mode 100755 index 00000000..bc720824 --- /dev/null +++ b/bin/test @@ -0,0 +1,16 @@ +#!/usr/bin/env python +import os +import sys +import zope.testrunner + +join = os.path.join +base = os.path.dirname(os.path.abspath(os.path.realpath(__file__))) +base = os.path.dirname(base) + + +sys.argv[0] = os.path.abspath(sys.argv[0]) + +if __name__ == '__main__': + sys.exit(zope.testrunner.run((['--auto-color', '--verbose']) + [ + '--test-path', join(base, 'src'), + ])) diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100644 index 00000000..a2a63afd --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# +# Bootstrap sandbox environment for crate-python +# +# - Create a Python virtualenv +# - Install all dependency packages and modules +# - Install package in editable mode +# - Drop user into an activated virtualenv +# +# Synopsis:: +# +# source bootstrap.sh +# + + +# Trace all invocations. +# set -x + + +function print_header() { + printf '=%.0s' {1..42}; echo + echo "$1" + printf '=%.0s' {1..42}; echo +} + +function ensure_virtualenv() { + # Create a Python virtualenv with current version of Python 3. + # TODO: Maybe take `pyenv` into account. + if [[ ! -d .venv ]]; then + python3 -m venv .venv + fi +} + +function activate_virtualenv() { + # Activate Python virtualenv. + source .venv/bin/activate +} + +function before_setup() { + + # When `wheel` is installed, Python will build `wheel` packages from all + # acquired `sdist` packages and will store them into `~/.cache/pip`, where + # they will be picked up by the caching machinery and will be reused on + # subsequent invocations when run on CI. This makes a *significant* + # difference on total runtime on CI, it is about 2x faster. + # + # Otherwise, there will be admonitions like: + # Using legacy 'setup.py install' for foobar, since package 'wheel' is + # not installed. + # + pip install wheel + + BUILDOUT_VERSION=${BUILDOUT_VERSION:-2.13.7} + pip install "zc.buildout==${BUILDOUT_VERSION}" + +} + +function setup_package() { + + # Install package in editable mode. + pip install --editable=.[sqlalchemy,test,doc] + +} + +function run_buildout() { + buildout -N +} + +function finalize() { + + # Some steps before dropping into the activated virtualenv. + echo + python -c 'import sqlalchemy; print(f"SQLAlchemy version: {sqlalchemy.__version__}")' + +} + +function main() { + ensure_virtualenv + activate_virtualenv + before_setup + setup_package + run_buildout + finalize +} + +function lint() { + flake8 +} + +main diff --git a/buildout.cfg b/buildout.cfg index 172f1803..edd92a7f 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -1,24 +1,20 @@ [buildout] -extends = base.cfg -parts += tox - sphinx - scripts +extends = versions.cfg +versions = versions +show-picked-versions = true +parts = crate -[scripts] -recipe = zc.recipe.egg:script -eggs = wheel - docutils - twine +[crate:linux] +recipe = hexagonit.recipe.download +url = https://cdn.crate.io/downloads/releases/crate-${versions:crate_server}.tar.gz +strip-top-level-dir = true -[tox] -recipe = gp.recipe.tox +[crate:macosx] +recipe = hexagonit.recipe.download +url = https://cdn.crate.io/downloads/releases/cratedb/x64_mac/crate-${versions:crate_server}.tar.gz +strip-top-level-dir = true -[sphinx] -recipe = zc.recipe.egg:script -eggs = sphinx - crate-docs-theme -relative-paths=true -scripts = sphinx-build=sphinx -initialization = - sys.argv.extend(['-N', '-q', '-b', 'html', - '-E', 'docs', '${buildout:directory}/out/html']) +[crate:windows] +recipe = hexagonit.recipe.download +url = https://cdn.crate.io/downloads/releases/cratedb/x64_windows/crate-${versions:crate_server}.zip +strip-top-level-dir = true diff --git a/devtools/create_tag.sh b/devtools/create_tag.sh index 7a53cca1..1ee0f68d 100755 --- a/devtools/create_tag.sh +++ b/devtools/create_tag.sh @@ -48,7 +48,7 @@ fi # check if tag to create has already been created WORKING_DIR=`dirname $0` -VERSION=`$WORKING_DIR/../bin/py setup.py --version` +VERSION=`python setup.py --version` EXISTS=`git tag | grep $VERSION` if [ "$VERSION" == "$EXISTS" ] diff --git a/devtools/setup_ci.sh b/devtools/setup_ci.sh index 6da60665..0cc8139e 100755 --- a/devtools/setup_ci.sh +++ b/devtools/setup_ci.sh @@ -46,23 +46,17 @@ function main() { # Let's go. echo "Invoking tests with CrateDB ${cratedb_version} and SQLAlchemy ${sqlalchemy_version}" - python -m pip install --upgrade pip - - pip install zc.buildout==2.13.4 - - # Replace SQLAlchemy version. - sed -ir "s/SQLAlchemy.*/SQLAlchemy = ${sqlalchemy_version}/g" versions.cfg + # Install designated SQLAlchemy version. + pip install "sqlalchemy==${sqlalchemy_version}" # Replace CrateDB version. if [ ${cratedb_version} = "nightly" ]; then - sed -ir "s/releases/releases\/nightly/g" base.cfg + sed -ir "s/releases/releases\/nightly/g" buildout.cfg sed -ir "s/crate_server.*/crate_server = latest/g" versions.cfg else sed -ir "s/crate_server.*/crate_server = ${cratedb_version}/g" versions.cfg fi - buildout -n -c base.cfg - } main "$@" diff --git a/setup.cfg b/setup.cfg index 12d4730e..d5ca9e8e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,4 +2,4 @@ universal = 1 [flake8] -ignore = E501,C901, W504 +ignore = E501, C901, W504 diff --git a/setup.py b/setup.py index 28eea262..41aed1bb 100644 --- a/setup.py +++ b/setup.py @@ -64,10 +64,17 @@ def read(path): ] }, extras_require=dict( - test=['zope.testing>=4,<5', + sqlalchemy=['sqlalchemy>=1.0,<1.5', + 'geojson>=2.5.0'], + test=['tox>=3,<4', + 'zope.testing>=4,<5', + 'zope.testrunner>=5,<6', 'zc.customdoctests>=1.0.1,<2', - 'stopit>=1.1.2,<2'], - sqlalchemy=['sqlalchemy>=1.0,<1.5', 'geojson>=2.5.0'] + 'createcoverage>=1,<2', + 'stopit>=1.1.2,<2', + 'flake8>=4,<5'], + doc=['sphinx>=3,<4', + 'crate-docs-theme'], ), python_requires='>=3.4', install_requires=requirements, diff --git a/versions.cfg b/versions.cfg index 2a91d62b..ec56d408 100644 --- a/versions.cfg +++ b/versions.cfg @@ -1,65 +1,4 @@ [versions] crate_server = 4.8.0 -flake8 = 3.7.9 -mccabe = 0.6.1 -pep8 = 1.7.1 -pyflakes = 2.1.1 -Jinja2 = 2.11.3 -MarkupSafe = 1.1.1 -Pygments = 2.8.1 -Sphinx = 3.5.2 -SQLAlchemy = 1.3.23 -geojson = 2.5.0 -coverage = 5.5 -crate-docs-theme = 0.13.3 -createcoverage = 1.5 -docutils = 0.16 hexagonit.recipe.download = 1.7.1 -py = 1.10.0 -tox = 3.23.0 -twine = 3.4.0 -pkginfo = 1.7.0 -zc.customdoctests = 1.0.1 -zc.recipe.egg = 2.0.7 -zc.recipe.testrunner = 2.2 -zope.testing = 4.9 -stopit = 1.1.2 - -# Required by: -# clint==0.5.1 -args = 0.1.0 - -# Required by: -# twine==1.8.1 -clint = 0.5.1 - -# Required by: -# zope.testrunner==4.4.3 -six = 1.15.0 - -# Required by: -# crate-docs-theme==0.3.6 -sphinxcontrib-plantuml = 0.19 - -# Required by: -# crate==0.12.3 -urllib3 = 1.26.4 - -# Required by: -# zope.testing==4.1.3 -# zope.testrunner==4.4.3 -zope.exceptions = 4.4 - -# Required by: -# zope.testing==4.1.3 -# zope.testrunner==4.4.3 -zope.interface = 5.2.0 - -# Required by: -# zc.recipe.testrunner==2.0.0 -zope.testrunner = 5.2 -gp.recipe.tox = 0.4 - -requests = 2.25.1 -requests-toolbelt = 0.9.1 From 13a494b3726391247a0455ac7785f21813f2aafd Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Sun, 19 Jun 2022 02:17:41 +0200 Subject: [PATCH 3/3] CI: Use environment variables `CRATEDB_VERSION` and `SQLALCHEMY_VERSION` Instead of using GNU getopt in the `setup_ci.sh` program, the needed information is propagated using environment variables. --- .github/workflows/nightly.yml | 17 +++++++++----- .github/workflows/tests.yml | 21 +++++++++-------- bootstrap.sh | 16 +++++++++---- devtools/setup_ci.sh | 44 +++++++---------------------------- 4 files changed, 42 insertions(+), 56 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ddbff1d4..fd4d5abc 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -18,8 +18,11 @@ jobs: os: [ubuntu-latest] python-version: ['3.7', '3.8', '3.9', '3.10'] cratedb-version: ['nightly'] - sqla-version: ['1.3.24'] + sqla-version: ['1.4.37'] fail-fast: false + env: + CRATEDB_VERSION: ${{ matrix.cratedb-version }} + SQLALCHEMY_VERSION: ${{ matrix.sqla-version }} steps: - uses: actions/checkout@v3 @@ -28,13 +31,15 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Propagate matrix information - run: | - source bootstrap.sh - ./devtools/setup_ci.sh --cratedb-version=${{ matrix.cratedb-version }} --sqlalchemy-version=${{ matrix.sqla-version }} - - name: Invoke tests run: | + + # Bootstrap environment. source bootstrap.sh + + # Propagate build matrix information. + ./devtools/setup_ci.sh + + # Invoke validation tasks. flake8 src bin coverage run bin/test -vv1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c6ce2bfb..4e5fe1e8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,6 +21,9 @@ jobs: cratedb-version: ['4.8.0'] sqla-version: ['1.3.24', '1.4.37'] fail-fast: true + env: + CRATEDB_VERSION: ${{ matrix.cratedb-version }} + SQLALCHEMY_VERSION: ${{ matrix.sqla-version }} steps: - uses: actions/checkout@v3 @@ -29,22 +32,20 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Adjust environment for macOS - if: matrix.os == 'macos-latest' + - name: Invoke tests run: | - brew install gnu-getopt - echo "/usr/local/opt/gnu-getopt/bin" >> $GITHUB_PATH - - name: Propagate matrix information - run: | + # Bootstrap environment. source bootstrap.sh - ./devtools/setup_ci.sh --cratedb-version=${{ matrix.cratedb-version }} --sqlalchemy-version=${{ matrix.sqla-version }} - - name: Invoke tests - run: | - source bootstrap.sh + # Propagate build matrix information. + ./devtools/setup_ci.sh + + # Invoke validation tasks. flake8 src bin coverage run bin/test -vv1 + + # Set the stage for the Codecov step. coverage xml # https://github.com/codecov/codecov-action diff --git a/bootstrap.sh b/bootstrap.sh index a2a63afd..0ad9a914 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -16,6 +16,11 @@ # Trace all invocations. # set -x +# Default variables. +BUILDOUT_VERSION=${BUILDOUT_VERSION:-2.13.7} +CRATEDB_VERSION=${CRATEDB_VERSION:-4.8.1} +SQLALCHEMY_VERSION=${SQLALCHEMY_VERSION:-1.4.37} + function print_header() { printf '=%.0s' {1..42}; echo @@ -50,8 +55,8 @@ function before_setup() { # pip install wheel - BUILDOUT_VERSION=${BUILDOUT_VERSION:-2.13.7} - pip install "zc.buildout==${BUILDOUT_VERSION}" + # Install Buildout with designated version, allowing pre-releases. + pip install --pre "zc.buildout==${BUILDOUT_VERSION}" } @@ -70,7 +75,10 @@ function finalize() { # Some steps before dropping into the activated virtualenv. echo - python -c 'import sqlalchemy; print(f"SQLAlchemy version: {sqlalchemy.__version__}")' + echo "Sandbox environment ready" + echo -n "Using SQLAlchemy version: " + python -c 'import sqlalchemy; print(sqlalchemy.__version__)' + echo } @@ -84,7 +92,7 @@ function main() { } function lint() { - flake8 + flake8 "$@" src bin } main diff --git a/devtools/setup_ci.sh b/devtools/setup_ci.sh index 0cc8139e..e4d96299 100755 --- a/devtools/setup_ci.sh +++ b/devtools/setup_ci.sh @@ -2,59 +2,31 @@ set -e -function args() { - options=$(getopt --long cratedb-version: --long sqlalchemy-version: -- "$@") - [ $? -eq 0 ] || { - echo "Incorrect options provided" - exit 1 - } - eval set -- "$options" - while true; do - case "$1" in - --cratedb-version) - shift; - cratedb_version=$1 - ;; - --sqlalchemy-version) - shift; - sqlalchemy_version=$1 - ;; - --) - shift - break - ;; - esac - shift - done -} - function main() { - # Read command line arguments. - args $0 "$@" - # Sanity checks. - [ -z ${cratedb_version} ] && { + [ -z ${CRATEDB_VERSION} ] && { echo "--cratedb-version must be given" + echo "Environment variable 'CRATEDB_VERSION' needed" exit 1 } - [ -z ${sqlalchemy_version} ] && { - echo "--sqlalchemy-version must be given" + [ -z ${SQLALCHEMY_VERSION} ] && { + echo "Environment variable 'SQLALCHEMY_VERSION' needed" exit 1 } # Let's go. - echo "Invoking tests with CrateDB ${cratedb_version} and SQLAlchemy ${sqlalchemy_version}" + echo "Invoking tests with CrateDB ${CRATEDB_VERSION} and SQLAlchemy ${SQLALCHEMY_VERSION}" # Install designated SQLAlchemy version. - pip install "sqlalchemy==${sqlalchemy_version}" + pip install "sqlalchemy==${SQLALCHEMY_VERSION}" # Replace CrateDB version. - if [ ${cratedb_version} = "nightly" ]; then + if [ ${CRATEDB_VERSION} = "nightly" ]; then sed -ir "s/releases/releases\/nightly/g" buildout.cfg sed -ir "s/crate_server.*/crate_server = latest/g" versions.cfg else - sed -ir "s/crate_server.*/crate_server = ${cratedb_version}/g" versions.cfg + sed -ir "s/crate_server.*/crate_server = ${CRATEDB_VERSION}/g" versions.cfg fi }