Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
49 changes: 49 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will install Python dependencies, run pre-commit checks, and run tests with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: PR verify

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"

- name: Run pre-commit checks
uses: pre-commit/action@v2.0.3
with:
extra_args: --all-files

- name: Type check with mypy
run: |
# Remove missing import override after firebolt-sdk release 0.2.1+
mypy --ignore-missing-imports src

- name: Test with pytest
run: |
pytest tests/unit

- name: Convetional Commits Pull Request Title
uses: jef/conventional-commits-pr-action@v1.0.0
if: github.event_name == 'pull_request'
with:
token: ${{ secrets.GITHUB_TOKEN }}
39 changes: 38 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,41 @@ share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
MANIFEST

# Byte-compiled / optimized / DLL files
__pycache__/

# Unit tests / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
coverage-reports/*

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# VS Code
.vscode/*
*.code-workspace

# mypy
.mypy_cache/
.dmypy.json
dmypy.json
47 changes: 47 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-merge-conflict

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.17.0
hooks:
- id: setup-cfg-fmt

- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args:
- -i
- -r
- --remove-all-unused-imports
- --ignore-init-module-imports
- --remove-duplicate-keys
- --remove-unused-variables

- repo: https://github.com/PyCQA/isort
rev: 5.9.3
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 21.7b0
hooks:
- id: black
language-version: 3.9

- repo: https://github.com/dfm/black_nbconvert
rev: v0.3.0
hooks:
- id: black_nbconvert

- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
additional_dependencies:
- flake8-tidy-imports
- flake8-quotes
20 changes: 19 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,22 @@ requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"

# configure isort to be compatible with black
# source: https://black.readthedocs.io/en/stable/compatible_configs.html#configuration
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true

[tool.black]
exclude = '''
/(
\.git
| \.venv
| dist
)/
'''
57 changes: 48 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,24 +1,63 @@
[metadata]
name = firebolt-sqlalchemy
name = firebolt_sqlalchemy
version = 0.0.9
author = Firebolt
author_email = pypi@firebolt.io
description = Sqlalchemy adapter for Firebolt
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/firebolt-db/firebolt-sqlalchemy
project_urls =
Bug Tracker = https://github.com/firebolt-db/firebolt-sqlalchemy
author = Firebolt
author_email = pypi@firebolt.io
license = Apache-2.0
license_file = LICENSE
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: Apache Software License
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
download_url = https://github.com/firebolt-db/firebolt-sqlalchemy/archive/refs/tags/0.0.9.tar.gz
entry_points =
sqlalchemy.dialects :
firebolt = firebolt_db.firebolt_dialect:FireboltDialect
project_urls =
Bug Tracker = https://github.com/firebolt-db/firebolt-sqlalchemy

[options]
package_dir =
= src
packages = find:
install_requires =
firebolt-sdk
sqlalchemy>=1.0.0
python_requires = >=3.6
package_dir =
= src

[options.packages.find]
where = src
where = src

[options.extras_require]
dev =
devtools==0.7.0
mypy==0.910
pre-commit==2.15.0
pytest==6.2.5
sqlalchemy-stubs

[mypy]
disallow_untyped_defs = True
show_error_codes = True
plugins = sqlmypy

[pydantic-mypy]
warn_required_dynamic_aliases = True
warn_untyped_fields = True

[flake8]
max-line-length = 88
per-file-ignores = __init__.py:F401
ignore = E203, W503
ban-relative-imports = True
inline-quotes = "
36 changes: 0 additions & 36 deletions setup.py

This file was deleted.

5 changes: 2 additions & 3 deletions src/firebolt_db/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from firebolt.db import connect
from firebolt.common.exception import (
DatabaseError,
DataError,
Expand All @@ -11,7 +10,7 @@
ProgrammingError,
Warning,
)

from firebolt.db import connect

__all__ = [
"connect",
Expand All @@ -34,4 +33,4 @@
apilevel = "2.0"
# Threads may share the module and connections
threadsafety = 1
paramstyle = "pyformat"
paramstyle = "pyformat"
Loading