Skip to content

Commit af5f967

Browse files
committed
Split dialect from driver, part 3: Re-activate integration-/doctests
1 parent c86a4b3 commit af5f967

23 files changed

+432
-434
lines changed

.github/workflows/nightly.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ on:
88

99
jobs:
1010
nightly:
11-
name: "Python: ${{ matrix.python-version }}
12-
SQLA: ${{ matrix.sqla-version }}
13-
CrateDB: ${{ matrix.cratedb-version }}
14-
on ${{ matrix.os }}"
11+
name: "
12+
Python: ${{ matrix.python-version }}
13+
SQLAlchemy: ${{ matrix.sqla-version }}
14+
CrateDB: ${{ matrix.cratedb-version }}
15+
"
1516
runs-on: ${{ matrix.os }}
1617
strategy:
1718
matrix:
@@ -37,29 +38,41 @@ jobs:
3738
PIP_ALLOW_PRERELEASE: ${{ matrix.pip-allow-prerelease }}
3839

3940
steps:
40-
- uses: actions/checkout@v4
41+
42+
- name: Acquire sources
43+
uses: actions/checkout@v4
44+
45+
- name: Run CrateDB
46+
run: docker compose -f tests/docker-compose.yml up -d
47+
4148
- name: Set up Python ${{ matrix.python-version }}
4249
uses: actions/setup-python@v5
4350
with:
4451
python-version: ${{ matrix.python-version }}
52+
architecture: x64
4553
cache: 'pip'
46-
cache-dependency-path: 'setup.py'
54+
cache-dependency-path:
55+
pyproject.toml
4756

48-
- name: Invoke tests
57+
- name: Set up project
4958
run: |
5059
51-
# Propagate build matrix information.
52-
./devtools/setup_ci.sh
60+
# `setuptools 0.64.0` adds support for editable install hooks (PEP 660).
61+
# https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6400
62+
pip install "setuptools>=64" --upgrade
63+
64+
# Install package in editable mode.
65+
pip install --use-pep517 --prefer-binary --editable='.[develop,test]'
66+
67+
- name: Invoke tests
68+
run: |
5369
5470
# Bootstrap environment.
5571
source bootstrap.sh
5672
5773
# Report about the test matrix slot.
5874
echo "Invoking tests with CrateDB ${CRATEDB_VERSION} and SQLAlchemy ${SQLALCHEMY_VERSION}"
5975
60-
# Run linter.
61-
flake8 src bin
62-
63-
# Run tests.
76+
# Run linters and software tests.
6477
export SQLALCHEMY_WARN_20=1
65-
bin/test -vvv
78+
poe check

.github/workflows/tests.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,30 @@ concurrency:
1212

1313
jobs:
1414
test:
15-
name: "Python: ${{ matrix.python-version }}
16-
SQLA: ${{ matrix.sqla-version }}
17-
on ${{ matrix.os }}"
15+
name: "
16+
Python: ${{ matrix.python-version }}
17+
SQLAlchemy: ${{ matrix.sqla-version }}
18+
"
1819
runs-on: ${{ matrix.os }}
1920
strategy:
2021
matrix:
21-
os: ['ubuntu-latest', 'macos-latest']
22+
os: ['ubuntu-latest']
2223
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
23-
cratedb-version: ['5.4.5']
24+
cratedb-version: ['5.5.1']
2425
sqla-version: ['<1.4', '<1.5', '<2.1']
2526
pip-allow-prerelease: ['false']
2627

2728
exclude:
28-
# To save resources, only use the most recent Python versions on macOS.
29-
- os: 'macos-latest'
30-
python-version: '3.7'
31-
- os: 'macos-latest'
32-
python-version: '3.8'
33-
- os: 'macos-latest'
34-
python-version: '3.9'
35-
- os: 'macos-latest'
36-
python-version: '3.10'
3729
# SQLAlchemy 1.3 is not supported on Python 3.12 and higher.
3830
- os: 'ubuntu-latest'
3931
python-version: '3.12'
4032
sqla-version: '<1.4'
41-
- os: 'macos-latest'
42-
python-version: '3.12'
43-
sqla-version: '<1.4'
4433

4534
# Another CI test matrix slot to test against prerelease versions of Python packages.
4635
include:
4736
- os: 'ubuntu-latest'
4837
python-version: '3.12'
49-
cratedb-version: '5.4.5'
38+
cratedb-version: '5.5.1'
5039
sqla-version: 'latest'
5140
pip-allow-prerelease: 'true'
5241

@@ -59,7 +48,12 @@ jobs:
5948
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6049

6150
steps:
62-
- uses: actions/checkout@v4
51+
52+
- name: Acquire sources
53+
uses: actions/checkout@v4
54+
55+
- name: Run CrateDB
56+
run: docker compose -f tests/docker-compose.yml up -d
6357

6458
- name: Set up Python ${{ matrix.python-version }}
6559
uses: actions/setup-python@v5

DEVELOP.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,21 @@ This command should automatically install all prerequisites for the
1212
development sandbox and drop you into the virtualenv, ready for invoking
1313
further commands.
1414

15-
## Running tests
15+
## Running Tests
1616

17-
All tests will be invoked using the Python interpreter that was used
18-
when creating the Python virtualenv.
19-
20-
Some examples how to invoke the test runner are outlined below.
21-
22-
Run all tests:
17+
Verify code by running all linters and software tests:
2318

19+
docker compose -f tests/docker-compose.yml up
2420
poe check
2521

2622
Run specific tests:
2723

2824
pytest -k SqlAlchemyCompilerTest
2925
pytest -k test_score
3026

27+
# Integration tests, written as doctests.
28+
python -m unittest -vvv tests/integration.py
29+
3130
Format code:
3231

3332
poe format

bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# set -x
1818

1919
# Default variables.
20-
CRATEDB_VERSION=${CRATEDB_VERSION:-5.2.2}
20+
CRATEDB_VERSION=${CRATEDB_VERSION:-5.5.1}
2121
SQLALCHEMY_VERSION=${SQLALCHEMY_VERSION:-<2.1}
2222

2323

docs/by-example/sqlalchemy/advanced-querying.rst renamed to docs/advanced-querying.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
.. _sqlalchemy-advanced-querying:
1+
.. _advanced-querying:
22

3-
=============================
4-
SQLAlchemy: Advanced querying
5-
=============================
3+
=================
4+
Advanced querying
5+
=================
66

77
This section of the documentation demonstrates running queries using a fulltext
88
index with an analyzer, queries using counting and aggregations, and support for

docs/by-example/index.rst

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)