Skip to content

Commit 23aba9f

Browse files
committed
Split dialect from driver, part 1
- Remove old infrastructure - Convert a few documents from rST to Markdown - Trim and modernize CI - Trim .gitignore, and LICENSE file - Remove buildout - Establish module namespace `sqlalchemy_cratedb`
1 parent 0fe5412 commit 23aba9f

27 files changed

+165
-665
lines changed

.coveragerc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
[report]
22
omit =
3-
*/virtualenv/*
4-
*/.buildout/eggs/*
5-
bin/test
6-
buildout-cache/eggs/*
7-
eggs/*
8-
parts/*
93
src/crate/client/_pep440.py
104
exclude_lines =
115
# pragma: no cover

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: [ "main" ]
66
pull_request:
7-
branches: [ "master" ]
7+
branches: [ "main" ]
88
schedule:
99
- cron: "46 2 * * 5"
1010

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request: ~
66
push:
77
branches:
8-
- master
8+
- main
99
schedule:
1010
- cron: '0 7 * * *'
1111

.github/workflows/tests.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Tests
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ main ]
66
pull_request: ~
77
workflow_dispatch:
88

@@ -53,37 +53,45 @@ jobs:
5353

5454
steps:
5555
- uses: actions/checkout@v4
56+
5657
- name: Set up Python ${{ matrix.python-version }}
57-
uses: actions/setup-python@v4
58+
uses: actions/setup-python@v5
5859
with:
5960
python-version: ${{ matrix.python-version }}
61+
architecture: x64
6062
cache: 'pip'
61-
cache-dependency-path: setup.py
63+
cache-dependency-path:
64+
pyproject.toml
6265

63-
- name: Invoke tests
66+
- name: Set up project
6467
run: |
6568
66-
# Propagate build matrix information.
67-
./devtools/setup_ci.sh
69+
# `setuptools 0.64.0` adds support for editable install hooks (PEP 660).
70+
# https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6400
71+
pip install "setuptools>=64" --upgrade
72+
73+
# Install package in editable mode.
74+
pip install --use-pep517 --prefer-binary --editable='.[develop,test]'
75+
76+
- name: Invoke tests
77+
run: |
6878
6979
# Bootstrap environment.
7080
source bootstrap.sh
7181
7282
# Report about the test matrix slot.
7383
echo "Invoking tests with CrateDB ${CRATEDB_VERSION} and SQLAlchemy ${SQLALCHEMY_VERSION}"
7484
75-
# Run linter.
76-
flake8 src bin
77-
78-
# Run tests.
85+
# Run linters and software tests.
7986
export SQLALCHEMY_WARN_20=1
80-
coverage run bin/test -vvv
81-
82-
# Set the stage for uploading the coverage report.
83-
coverage xml
87+
poe check
8488
8589
# https://github.com/codecov/codecov-action
8690
- name: Upload coverage results to Codecov
8791
uses: codecov/codecov-action@v3
8892
with:
89-
fail_ci_if_error: true
93+
files: ./coverage.xml
94+
flags: main
95+
env_vars: OS,PYTHON
96+
name: codecov-umbrella
97+
fail_ci_if_error: false

.gitignore

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
1-
.venv*
2-
.coverage
3-
coverage.xml
41
.idea/
52
.installed.cfg
6-
.tox/
3+
.venv*
74
*.DS_Store
5+
*.egg-info
86
*.pyc
9-
bin/*
10-
!bin/test
11-
!bin/sphinx
12-
build/
13-
crate-python.iml
14-
crate.egg-info
15-
develop-eggs/
7+
.coverage
8+
coverage.xml
169
dist/
17-
eggs/
18-
htmlcov/
19-
out/
20-
parts/
21-
tmp/
22-
env/

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Contributing
2+
3+
Thank you for your interest in contributing.
4+
5+
Please see the [CrateDB contribution guide] for more information.
6+
Everything in the CrateDB contribution guide applies to this repository.
7+
8+
9+
[CrateDB contribution guide]: https://github.com/crate/crate/blob/master/CONTRIBUTING.rst

CONTRIBUTING.rst

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

DEVELOP.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# CrateDB Python developer guide
2+
3+
## Setup
4+
5+
To start things off, bootstrap the sandbox environment:
6+
7+
git clone https://github.com/crate-workbench/sqlalchemy-cratedb
8+
cd sqlalchemy-cratedb
9+
source bootstrap.sh
10+
11+
This command should automatically install all prerequisites for the
12+
development sandbox and drop you into the virtualenv, ready for invoking
13+
further commands.
14+
15+
## Running tests
16+
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:
23+
24+
pytest
25+
26+
Run specific tests:
27+
28+
pytest -k SqlAlchemyCompilerTest
29+
pytest -k test_score
30+
31+
32+
## Preparing a release
33+
34+
In the release branch:
35+
36+
- Update `__version__` in `src/crate/client/__init__.py`
37+
- Add a section for the new version in the `CHANGES.txt` file
38+
- Commit your changes with a message like \"prepare release x.y.z\"
39+
- Push to origin/\<release_branch\>
40+
- Create a tag by running `./devtools/create_tag.sh`. This will
41+
trigger a GitHub action which releases the new version to PyPi.
42+
43+
On branch `main`:
44+
45+
- Update the release notes to reflect the release
46+
47+
48+
## Writing documentation
49+
50+
The docs live under the `docs` directory.
51+
52+
The docs are written with [ReStructuredText] and Markdown,
53+
and will be processed with [Sphinx].
54+
55+
Build the docs by running:
56+
57+
./bin/sphinx
58+
59+
The output can then be found in the `out/html` directory.
60+
61+
The docs are automatically built from Git by [Read the Docs]. There is
62+
nothing special you need to do to get the live docs to update.
63+
64+
65+
[Read the Docs]: http://readthedocs.org
66+
[ReStructuredText]: https://docutils.sourceforge.net/rst.html
67+
[Sphinx]: https://sphinx-doc.org/

DEVELOP.rst

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

0 commit comments

Comments
 (0)