Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v3
with:
python-version: '3.9'

Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,21 @@ jobs:
os: [ubuntu-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
cratedb-version: ['nightly']
sqla-version: ['1.4.37']
sqla-version: ['1.3.24']
fail-fast: false
env:
CRATEDB_VERSION: ${{ matrix.cratedb-version }}
SQLALCHEMY_VERSION: ${{ matrix.sqla-version }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Invoke tests
- name: Install dependencies
run: |
./devtools/setup_ci.sh --cratedb-version=${{ matrix.cratedb-version }} --sqlalchemy-version=${{ matrix.sqla-version }}

# Bootstrap environment.
source bootstrap.sh

# Propagate build matrix information.
./devtools/setup_ci.sh

# Invoke validation tasks.
flake8 src bin
coverage run bin/test -vv1
- name: Invoke tests
run: |
bin/flake8
bin/coverage run bin/test -vv1
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v3
with:
python-version: '3.9'

Expand Down
34 changes: 18 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: ['macos-10.15', 'macos-11', 'macos-12']
python-version: ['3.7', '3.8', '3.9', '3.10']
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 }}
fail-fast: false

steps:
- uses: actions/checkout@v3
Expand All @@ -32,21 +29,26 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Invoke tests
- name: Adjust environment for macOS
run: |
brew install gnu-getopt
echo "/usr/local/opt/gnu-getopt/bin" >> $GITHUB_PATH

# Bootstrap environment.
source bootstrap.sh

# Propagate build matrix information.
./devtools/setup_ci.sh
- name: Debug environment on macOS
run: |
sw_vers -productVersion
export SYSTEM_VERSION_COMPAT=1
sw_vers -productVersion

# Invoke validation tasks.
flake8 src bin
coverage run bin/test -vv1
- name: Install dependencies
run: |
./devtools/setup_ci.sh --cratedb-version=${{ matrix.cratedb-version }} --sqlalchemy-version=${{ matrix.sqla-version }}

# Set the stage for the Codecov step.
coverage xml
- name: Invoke tests
run: |
bin/flake8
bin/coverage run bin/test -vv1
bin/coverage xml

# https://github.com/codecov/codecov-action
- name: Upload coverage results to Codecov
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ coverage.xml
.tox/
*.DS_Store
*.pyc
bin/*
!bin/test
!bin/sphinx
bin/
build/
crate-python.iml
crate.egg-info
Expand Down
32 changes: 18 additions & 14 deletions DEVELOP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,27 @@ Developer guide
Setup
=====

To start things off, bootstrap the sandbox environment::
This project uses buildout_ to set up the development environment.

source bootstrap.sh
To start things off, create a Python virtualenv and install buildout::

This command should automatically install all prerequisites for the development
sandbox and drop you into the virtualenv, ready for invoking further commands.
python3 -m venv .venv
source .venv/bin/activate

# 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`_.

Some examples are outlined below. In order to learn about more details,
see, for example, `useful command-line options for zope-testrunner`_.
creating the Python virtualenv. The test runner is zope.testrunner_.

Run all tests::

Expand All @@ -36,18 +41,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_::

tox
./bin/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::

tox -e py37
./bin/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.

Expand Down Expand Up @@ -116,6 +121,5 @@ 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
.. _useful command-line options for zope-testrunner: https://pypi.org/project/zope.testrunner/#some-useful-command-line-options-to-get-you-started
.. _zope.testrunner: https://pypi.python.org/pypi/zope.testrunner/4.4.1
.. _versions hosted on ReadTheDocs: https://readthedocs.org/projects/crate-python/versions/
.. _zope.testrunner: https://pypi.org/project/zope.testrunner/
49 changes: 49 additions & 0 deletions base.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[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'])
15 changes: 0 additions & 15 deletions bin/sphinx

This file was deleted.

16 changes: 0 additions & 16 deletions bin/test

This file was deleted.

98 changes: 0 additions & 98 deletions bootstrap.sh

This file was deleted.

Loading