Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#128 migrate project to pyrpoject toml based package setup #145

Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
a86d51a
Add pyproject.toml
Nicoretti May 30, 2022
35e067a
Add basic project information to pyproject.toml
Nicoretti May 30, 2022
464f7bf
Add dependencies to pyproject.toml
Nicoretti May 30, 2022
e5d8348
Remove deprecated and unused configuration entries
Nicoretti May 30, 2022
ea3cd16
Update include list in pyproject.toml
Nicoretti May 31, 2022
79508ef
Add extension points required for sqlalchemy plugin(s)
Nicoretti May 31, 2022
39b06e8
Remove unused script
Nicoretti May 31, 2022
5de6bbe
Add sync support for project.toml based version
Nicoretti May 31, 2022
db10601
Add version check to ci/verifier action
Nicoretti Jun 1, 2022
96b9c70
Add justification why the pytest config still is part of setup.cfg
Nicoretti Jun 1, 2022
474b898
Remove condaforge reference in README
Nicoretti Jun 1, 2022
286305a
Fix error in setup.cfg
Nicoretti Jun 1, 2022
4ea0d5e
Replace version information mechansim
Nicoretti Jun 1, 2022
6bf3af5
Add poetry lock file
Nicoretti Jun 1, 2022
90c9ab4
Delete deprecated requirements*.txt files
Nicoretti Jun 1, 2022
d7cba05
Remove deprecated setup.py
Nicoretti Jun 1, 2022
55d17cb
Update comment in generated file according to code review
Nicoretti Jun 1, 2022
1485b86
Update CI workflow to use poetry
Nicoretti Jun 1, 2022
2ab87f8
Fix command invocation to use poetry
Nicoretti Jun 1, 2022
362c006
Fix import of version module
Nicoretti Jun 1, 2022
42a4914
Fix installation order
Nicoretti Jun 1, 2022
2309b94
Use python built in mock library
Nicoretti Jun 1, 2022
43c7093
Remove deprecated version parsing
Nicoretti Jun 1, 2022
2329c24
Add missing newline
Nicoretti Jun 1, 2022
7673702
Rename workflow step
Nicoretti Jun 1, 2022
d86bf11
Update .github/workflows/CI.yml
Nicoretti Jun 2, 2022
4d00df4
Update .github/workflows/CI.yml
Nicoretti Jun 2, 2022
ef89874
Add check-links workflow
Nicoretti Jun 2, 2022
8aea7ac
Add packaging dependency explicitly
Nicoretti Jun 2, 2022
d8c6dac
Update ci workflow to support caching
Nicoretti Jun 2, 2022
9cd2051
Fix github workflows to install poetry previous to the python setup
Nicoretti Jun 2, 2022
5065586
Fix check-links workflow
Nicoretti Jun 2, 2022
bad8906
Renamed workflow check-links to link-check
Nicoretti Jun 2, 2022
ce3aadd
Fix issue of wrong selected python version in github action
Nicoretti Jun 3, 2022
64ac386
Rework CI-CD workflow to use poetry
Nicoretti Jul 7, 2022
d50aa32
Remove version file from ignore list
Nicoretti Jul 7, 2022
aec032f
Remove MANIFEST.in file
Nicoretti Jul 7, 2022
d0dc285
Add dependabot updater to repository
Nicoretti Jul 7, 2022
7abe052
Update base python version to 3.8
Nicoretti Jul 7, 2022
c663056
Add pyupgrade commit hook to workspace
Nicoretti Jul 7, 2022
40ddcba
Update python version(s) in github actions
Nicoretti Jul 7, 2022
7aa9761
Bump version to 3.0.0
Nicoretti Jul 7, 2022
fcec34d
Removed verbose flag from pre commit hook
Nicoretti Jul 7, 2022
dd3b839
Show CI instead of CI-CD status in README
Nicoretti Jul 7, 2022
6609704
Update information about minimum python version
Nicoretti Jul 7, 2022
037f906
Update changelog
Nicoretti Jul 7, 2022
0e9455c
Update minimum required python version in developer guide
Nicoretti Jul 7, 2022
e5231dd
Update developer guide
Nicoretti Jul 7, 2022
ee24d9a
Add todo for updating turbodbc dependency
Nicoretti Jul 7, 2022
b6ed83c
Remove link check from test workflow
Nicoretti Jul 7, 2022
beed934
Update version check hook and script
Nicoretti Jul 7, 2022
e00c99b
Remove link check from CI - CD workflow
Nicoretti Jul 7, 2022
54f1a5f
Add git script/module to query available tags
Nicoretti Jul 7, 2022
1681f93
Add release support for new project format to noxfile and CI/CD
Nicoretti Jul 7, 2022
7b18c2b
Prepare 3.0.0 release
Nicoretti Jul 12, 2022
6d9135c
Fix missing check in verify step
Nicoretti Jul 12, 2022
397bfaa
Make sure no unnecessary virtual environments will be created
Nicoretti Jul 12, 2022
e7dd1f7
Update pytest dependency
Nicoretti Jul 12, 2022
a28c946
Address pytest compatibility issue
Nicoretti Jul 12, 2022
835647a
Adjust release task and action
Nicoretti Jul 13, 2022
3e1f196
Remove odbcinst.ini and replace with template
Nicoretti Jul 13, 2022
95d77a9
Harden relase mechanism
Nicoretti Jul 13, 2022
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
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5

# Maintain dependencies for poetry
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 5
66 changes: 30 additions & 36 deletions .github/workflows/CI-CD.yml → .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@ jobs:
strategy:
fail-fast: false
matrix:
python: [3.7, 3.8, 3.9]
python:
- "3.8"
- "3.9"
- "3.10"
connector:
- pyodbc
- turbodbc
# TODO: Reenable once the issue(s) below have been fixed.
# Turbodbc can't be supported using poetry until:
# - https://github.com/blue-yonder/turbodbc/issues/358
# - https://github.com/exasol/sqlalchemy-exasol/issues/146
# are fixed.
# - turbodbc
exasol_version:
- 7.1.6
- 7.0.16
Expand All @@ -31,26 +39,24 @@ jobs:
- name: Setup integration-test-docker-environment
uses: actions/setup-python@v2

- name: Install via apt
run: sudo apt-get install unixodbc unixodbc-dev libboost-date-time-dev libboost-locale-dev libboost-system-dev

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install via apt
run: sudo apt-get install unixodbc unixodbc-dev libboost-date-time-dev libboost-locale-dev libboost-system-dev

- name: Install pipenv
uses: dschep/install-pipenv-action@v1

- name: Pip install test requirements
uses: BSFishy/pip-action@v1
- name: Install poetry
uses: abatilo/actions-poetry@v2.0.0
with:
requirements: requirements_dev.txt
poetry-version: 1.1.13

- name: Pip install extra requirements
uses: BSFishy/pip-action@v1
with:
requirements: requirements_extras.txt
- name: Install python project dependencies
run: poetry install

- name: Install python project dependencies including trubodbc
run: poetry install --extras "turbodbc"
if: ${{ matrix.connector == 'turbodbc' }}

- name: Checkout test environment
Expand All @@ -60,23 +66,18 @@ jobs:
ITDE_URL: "https://github.com/exasol/integration-test-docker-environment.git"
ITDE_TAG: "0.10.0"

- name: Check documentation links ${{ matrix.python }} using ${{ matrix.connector }}
run: nox -s "check-links"

- name: Run Test for Python ${{ matrix.python }} using ${{ matrix.connector }}
run: nox -s "verify(connector='${{ matrix.connector }}')"
run: poetry run nox -s "verify(connector='${{ matrix.connector }}')"

upload_to_pypi:
runs-on: ubuntu-latest
needs: run_tests
if: startsWith(github.event.ref, 'refs/tags')
strategy:
matrix:
python: [3.7]
connector:
- pyodbc
python: [3.8]

name: Upload to PyPI (Python-${{ matrix.python }}, Connector-${{ matrix.connector }})
name: Build & Upload Package [PYPI]

steps:

Expand All @@ -91,17 +92,10 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Install pipenv
uses: dschep/install-pipenv-action@v1

- name: Install Wheel
run: pip install wheel

- name: Build sdist and wheel packages
run: python setup.py sdist bdist_wheel

- name: Push package to Pypi
uses: pypa/gh-action-pypi-publish@release/v1
- name: Install poetry
uses: abatilo/actions-poetry@v2.0.0
with:
user: __token__
password: ${{ secrets.pypi_token }}
poetry-version: 1.1.13

- name: Build and push package to PYPI
run: POETRY_PYPI_TOKEN_PYPI="${{ secrets.pypi_token }}" poetry run nox -s release
Nicoretti marked this conversation as resolved.
Show resolved Hide resolved
63 changes: 30 additions & 33 deletions .github/workflows/CI.yml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ jobs:
strategy:
fail-fast: false
matrix:
python: [3.7, 3.8, 3.9]
python:
- "3.8"
- "3.9"
- "3.10"
connector:
- pyodbc
- turbodbc
# TODO: Reenable once the issue(s) below have been fixed.
# Turbodbc can't be supported using poetry until:
# - https://github.com/blue-yonder/turbodbc/issues/358
# - https://github.com/exasol/sqlalchemy-exasol/issues/146
# are fixed.
# - turbodbc
exasol_version:
- 7.1.6
- 7.0.16
Expand All @@ -32,29 +40,24 @@ jobs:
- name: Fetch sqlalchemy_exasol code from repository
uses: actions/checkout@v2

- name: Setup integration-test-docker-environment
uses: actions/setup-python@v2
- name: Install via apt
run: sudo apt-get install unixodbc unixodbc-dev libboost-date-time-dev libboost-locale-dev libboost-system-dev

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}

- name: Install via apt
run: sudo apt-get install unixodbc unixodbc-dev libboost-date-time-dev libboost-locale-dev libboost-system-dev

- name: Install pipenv
uses: dschep/install-pipenv-action@v1

- name: Pip install requirements
uses: BSFishy/pip-action@v1
- name: Install poetry
uses: abatilo/actions-poetry@v2.0.0
with:
requirements: requirements_dev.txt
poetry-version: 1.1.13

- name: Pip install extra requirements
uses: BSFishy/pip-action@v1
with:
requirements: requirements_extras.txt
- name: Install python project dependencies
run: poetry install

- name: Install python project dependencies including trubodbc
run: poetry install --extras "turbodbc"
if: ${{ matrix.connector == 'turbodbc' }}

- name: Checkout test environment
Expand All @@ -64,22 +67,17 @@ jobs:
ITDE_URL: "https://github.com/exasol/integration-test-docker-environment.git"
ITDE_TAG: "0.10.0"

- name: Check documentation links ${{ matrix.python }} using ${{ matrix.connector }}
run: nox -s "check-links"

- name: Run Test for Python ${{ matrix.python }} using ${{ matrix.connector }}
run: nox -s "verify(connector='${{ matrix.connector }}')"
run: poetry run nox -s "verify(connector='${{ matrix.connector }}')"

build_package:
runs-on: ubuntu-latest
needs: run_tests
strategy:
matrix:
python: [3.7]
connector:
- pyodbc
python: [3.8]

name: Build Package (Python-${{ matrix.python }}, Connector-${{ matrix.connector }})
name: Build Package

steps:

Expand All @@ -90,15 +88,14 @@ jobs:
run: git fetch origin +refs/tags/*:refs/tags/*

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}

- name: Install pipenv
uses: dschep/install-pipenv-action@v1

- name: Install Wheel
run: pip install wheel
- name: Install poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.1.13

- name: Build sdist and wheel packages
run: python setup.py sdist bdist_wheel
run: poetry build
40 changes: 40 additions & 0 deletions .github/workflows/link-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check Links

on:
push:
branches-ignore:
- 'master'
pull_request:
branches-ignore:
- 'master'

jobs:
run_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: [3.8]

name: Check Links (Python-${{ matrix.python }})

steps:

- name: Fetch sqlalchemy_exasol code from repository
uses: actions/checkout@v2

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}

- name: Install poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.1.13

- name: Install python project dependencies
run: poetry install --no-root

- name: Check documentation links ${{ matrix.python }} using ${{ matrix.connector }}
run: poetry run nox -s "check-links"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
odbcconfig/odbcinst.ini

*.py[cod]

.build_output
Expand All @@ -24,7 +26,6 @@ develop-eggs
.installed.cfg
lib
lib64
sqlalchemy_exasol/_version.py

# Installer logs
pip-log.txt
Expand Down
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
default_stages: [commit]
repos:
- repo: local
hooks:

- id: version-check
name: Check if version(s) are in sync
always_run: true
language: system
entry: python scripts/version_check.py --fix sqlalchemy_exasol/version.py

- repo: https://github.com/asottile/pyupgrade
rev: v2.34.0
hooks:
- id: pyupgrade
args: ['--py38-plus']
types: [python]
13 changes: 13 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 3.0.0
⚠️ ATTENTION ⚠️
* The support of the turbodbc feature have been suspended, until the following issues have been addressed
* https://github.com/blue-yonder/turbodbc/issues/358
* https://github.com/exasol/sqlalchemy-exasol/issues/146

Note: If you depend on turbodbc we suggest you to use the latest version supporting it (2.4.0)

* Dropped python 3.7 support
* If you still depend on python 3.7 use the 2.x version line
* Update project setup/structure to pyproject.toml based project setup (poetry)
* Removed conda forge support

# 2.4.0
* Fixed bug when accessing underlying odbc connection while using NullPool based engine
(Note: this addresses the superset [issue-20105](https://github.com/apache/superset/issues/20105))
Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

7 changes: 2 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ SQLAlchemy Dialect for EXASOL DB


.. image:: https://github.com/exasol/sqlalchemy_exasol/workflows/CI-CD/badge.svg?branch=master
:target: https://github.com/exasol/sqlalchemy_exasol/actions?query=workflow%3ACI-CD
:target: https://github.com/exasol/sqlalchemy_exasol/actions?query=workflow%3ACI
.. image:: https://img.shields.io/pypi/v/sqlalchemy_exasol
:target: https://pypi.org/project/sqlalchemy-exasol/
:alt: PyPI Version
.. image:: https://img.shields.io/conda/vn/conda-forge/sqlalchemy_exasol.svg
:target: https://anaconda.org/conda-forge/sqlalchemy_exasol
:alt: Conda Version

This is an SQLAlchemy dialect for the EXASOL database.

Expand Down Expand Up @@ -40,7 +37,7 @@ On Linux/Unix like systems you need:
Turbodbc support
````````````````

- You can use Turbodbc with sqlalchemy_exasol if you use a python version >= 3.7.
- You can use Turbodbc with sqlalchemy_exasol if you use a python version >= 3.8.
- Multi row update is not supported, see
`test/test_update.py <test/test_update.py>`_ for an example

Expand Down
7 changes: 7 additions & 0 deletions TODOs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FINAL TASKS:
------------
* ATTENTION: Update turbodbc driver to latest including installation fix!
* make sure automated publish via GH action still works with poetry
* CLOSE: https://github.com/exasol/sqlalchemy-exasol/issues/135
* CLOSE: https://github.com/exasol/sqlalchemy-exasol/issues/146
* CLOSE: https://github.com/exasol/sqlalchemy-exasol/issues/128
Loading