Skip to content

Commit

Permalink
Split dialect from driver, part 1
Browse files Browse the repository at this point in the history
- 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`
  • Loading branch information
amotl committed Dec 20, 2023
1 parent 0fe5412 commit 23aba9f
Show file tree
Hide file tree
Showing 27 changed files with 165 additions and 665 deletions.
6 changes: 0 additions & 6 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
[report]
omit =
*/virtualenv/*
*/.buildout/eggs/*
bin/test
buildout-cache/eggs/*
eggs/*
parts/*
src/crate/client/_pep440.py
exclude_lines =
# pragma: no cover
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "CodeQL"

on:
push:
branches: [ "master" ]
branches: [ "main" ]
pull_request:
branches: [ "master" ]
branches: [ "main" ]
schedule:
- cron: "46 2 * * 5"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request: ~
push:
branches:
- master
- main
schedule:
- cron: '0 7 * * *'

Expand Down
38 changes: 23 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Tests

on:
push:
branches: [ master ]
branches: [ main ]
pull_request: ~
workflow_dispatch:

Expand Down Expand Up @@ -53,37 +53,45 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
cache-dependency-path: setup.py
cache-dependency-path:
pyproject.toml

- name: Invoke tests
- name: Set up project
run: |
# Propagate build matrix information.
./devtools/setup_ci.sh
# `setuptools 0.64.0` adds support for editable install hooks (PEP 660).
# https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6400
pip install "setuptools>=64" --upgrade
# Install package in editable mode.
pip install --use-pep517 --prefer-binary --editable='.[develop,test]'
- name: Invoke tests
run: |
# Bootstrap environment.
source bootstrap.sh
# Report about the test matrix slot.
echo "Invoking tests with CrateDB ${CRATEDB_VERSION} and SQLAlchemy ${SQLALCHEMY_VERSION}"
# Run linter.
flake8 src bin
# Run tests.
# Run linters and software tests.
export SQLALCHEMY_WARN_20=1
coverage run bin/test -vvv
# Set the stage for uploading the coverage report.
coverage xml
poe check
# https://github.com/codecov/codecov-action
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: ./coverage.xml
flags: main
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
21 changes: 4 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
.venv*
.coverage
coverage.xml
.idea/
.installed.cfg
.tox/
.venv*
*.DS_Store
*.egg-info
*.pyc
bin/*
!bin/test
!bin/sphinx
build/
crate-python.iml
crate.egg-info
develop-eggs/
.coverage
coverage.xml
dist/
eggs/
htmlcov/
out/
parts/
tmp/
env/
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Contributing

Thank you for your interest in contributing.

Please see the [CrateDB contribution guide] for more information.
Everything in the CrateDB contribution guide applies to this repository.


[CrateDB contribution guide]: https://github.com/crate/crate/blob/master/CONTRIBUTING.rst
10 changes: 0 additions & 10 deletions CONTRIBUTING.rst

This file was deleted.

67 changes: 67 additions & 0 deletions DEVELOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# CrateDB Python developer guide

## Setup

To start things off, bootstrap the sandbox environment:

git clone https://github.com/crate-workbench/sqlalchemy-cratedb
cd sqlalchemy-cratedb
source bootstrap.sh

This command should automatically install all prerequisites for the
development sandbox and drop you into the virtualenv, ready for invoking
further commands.

## Running tests

All tests will be invoked using the Python interpreter that was used
when creating the Python virtualenv.

Some examples how to invoke the test runner are outlined below.

Run all tests:

pytest

Run specific tests:

pytest -k SqlAlchemyCompilerTest
pytest -k test_score


## Preparing a release

In the release branch:

- Update `__version__` in `src/crate/client/__init__.py`
- Add a section for the new version in the `CHANGES.txt` file
- Commit your changes with a message like \"prepare release x.y.z\"
- Push to origin/\<release_branch\>
- Create a tag by running `./devtools/create_tag.sh`. This will
trigger a GitHub action which releases the new version to PyPi.

On branch `main`:

- Update the release notes to reflect the release


## Writing documentation

The docs live under the `docs` directory.

The docs are written with [ReStructuredText] and Markdown,
and will be processed with [Sphinx].

Build the docs by running:

./bin/sphinx

The output can then be found in the `out/html` directory.

The docs are automatically built from Git by [Read the Docs]. There is
nothing special you need to do to get the live docs to update.


[Read the Docs]: http://readthedocs.org
[ReStructuredText]: https://docutils.sourceforge.net/rst.html
[Sphinx]: https://sphinx-doc.org/
152 changes: 0 additions & 152 deletions DEVELOP.rst

This file was deleted.

Loading

0 comments on commit 23aba9f

Please # to comment.