diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4d24efd..cf612d3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -5,31 +5,40 @@ on: [push] jobs: linux-test: runs-on: ubuntu-20.04 + env: + DATABASE: test continue-on-error: true + services: + monetdb: + image: "monetdb/dev-builds:Aug2024" + env: + MDB_CREATE_DBS: '${{ env.DATABASE }}' + MDB_DB_ADMIN_PASS: monetdb + ports: + - 50000:50000 strategy: matrix: branch: [default] - python-version: [3.8, 3.9, '3.10', '3.11'] - container: monetdb/dev-builds:${{ matrix.branch }} + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Checkout - uses: actions/checkout@v3 - + uses: actions/checkout@v4 + - name: Install Debian packages + run: | + sudo apt-get update -qq + sudo apt-get install -y software-properties-common curl make + curl https://www.monetdb.org/downloads/MonetDB-GPG-KEY | sudo apt-key add - + sudo add-apt-repository 'deb http://dev.monetdb.org/downloads/deb/ focal monetdb' + sudo apt-get update -qq + sudo apt-get install -y monetdb-client + - name: Initialize MonetDB database + run: | + sudo -u monetdb mclient -d "monetdb://localhost:50000/${{ env.DATABASE }}?user=monetdb&password=monetdb" -s "create schema test_schema;" + sudo -u monetdb mclient -d "monetdb://localhost:50000/${{ env.DATABASE }}?user=monetdb&password=monetdb" -s "create schema test_schema2;" + sudo -u monetdb mclient -d "monetdb://localhost:50000/${{ env.DATABASE }}?user=monetdb&password=monetdb" -s "alter user monetdb set schema test_schema2;" - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - # - name: Setup database - # run: | - # cd test - # ./initfarm.sh - # ./initdb.sh - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install tox tox-gh-actions - - - name: Run Tox - run: tox + - name: Run tests + run: make pytest diff --git a/.gitignore b/.gitignore index 65a9ae8..3a93844 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,6 @@ pip-log.txt # Unit test / coverage reports .coverage -.tox nosetests.xml # Translations diff --git a/Makefile b/Makefile index 9dbac6c..46bddb4 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,9 @@ - venv/: python3 -m venv venv + venv/bin/pip install --upgrade pip wheel setuptools venv/bin/pytest: venv/ venv/bin/pip install -e ".[test]" pytest: venv/bin/pytest venv/bin/pytest -r A - -venv/bin/tox: venv/ - venv/bin/pip install tox - -tox: venv/bin/tox - venv/bin/tox - -setup: venv/ - venv/bin/pip install -e ".[test]" - -test: tox - -clean: - rm -rf .tox/ build/ diff --git a/README.rst b/README.rst index 6815398..6711e47 100644 --- a/README.rst +++ b/README.rst @@ -34,4 +34,3 @@ More info * http://www.sqlalchemy.org/ * http://www.monetdb.org/ - diff --git a/setup.cfg b/setup.cfg index 3290b5a..1e63832 100644 --- a/setup.cfg +++ b/setup.cfg @@ -44,7 +44,7 @@ sqlalchemy.dialects = [options.extras_require] -testing = +test = pytest>=7.4.0 pytest-cov>=4.1.0 coverage>=7.3.0 diff --git a/sqlalchemy_monetdb/dialect.py b/sqlalchemy_monetdb/dialect.py index 4db891d..5b07407 100644 --- a/sqlalchemy_monetdb/dialect.py +++ b/sqlalchemy_monetdb/dialect.py @@ -903,7 +903,7 @@ def get_unique_constraints( return res - def get_check_constraints(self, connection: "Connection", table_name: str, schema: str | None = None, **kw:Any) -> List[ReflectedCheckConstraint]: + def get_check_constraints(self, connection, table_name, schema, **kw): """Return information about check constraints in `table_name`. Given a string `table_name` and an optional string `schema`, return diff --git a/test/README.rst b/test/README.rst index 9832d16..6fcac00 100644 --- a/test/README.rst +++ b/test/README.rst @@ -15,7 +15,6 @@ Create a test schema:: Now you can run the test suite:: - $ tox - + $ pytest test The ``--db`` flag selects one of the preconfigured database URLs defined in setup.cfg. diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 79bd1c8..0000000 --- a/tox.ini +++ /dev/null @@ -1,28 +0,0 @@ -[tox] -minversion = 4.11.3 -envlist = py{38, 39, 310, 311}, flake8 - -[gh-actions] -python = - 3.8: py38 - 3.9: py39 - 3.10: py310 - 3.11: py311, flake8 - -[testenv] -setenv = - PYTHONPATH = {toxinidir} -deps = - -r{toxinidir}/requirements_dev.txt -allowlist_externals = - {toxinidir}/test/*.sh -commands = - {toxinidir}/test/initfarm.sh - {toxinidir}/test/initdb.sh - pytest --cov=sqlalchemy_monetdb {posargs} - {toxinidir}/test/destroyfarm.sh - -[testenv:flake8] -basepython = python3.11 -deps = flake8 -commands = flake8 sqlalchemy_monetdb