-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added git workflow for precommit checks. * add black pipeline * LINT * Added pull_request.yml and renamed pre-commit-checks.yml. * Add mypy to pre-commit checks in git workflows. * Added setup.cfg file. * Changed the package directory in setup.cfg. * Updated setup.cfg to include correct dev tools. Removed __init__.py at top level. Bumped version number. * Updated pull_request.yml. * move version to __init__.py file * move setup parameters to setup.cfg * fix package definition * add pull-request code-checks * cleanup requirements * update setup.py * remove mypy code check * remove old linting workflow * minor improvements Co-authored-by: swanderz <[email protected]> Co-authored-by: Stepan Burlakov <[email protected]>
- Loading branch information
1 parent
e66b88d
commit 7ce74f2
Showing
9 changed files
with
113 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Python code checks | ||
|
||
on: | ||
workflow_call: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
check-code: | ||
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/[email protected] | ||
with: | ||
extra_args: --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Pull request | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
code-checkers: | ||
uses: firebolt-db/dbt-firebolt/.github/workflows/code-check.yml@main | ||
check-title: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check title name convention | ||
uses: jef/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.21.6' | ||
__version__ = '0.21.8' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version = '0.21.7' | ||
from dbt.adapters.firebolt import __version__ as version # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[metadata] | ||
name = dbt_firebolt | ||
version = attr: dbt.adapters.firebolt.__version__ | ||
description = The Firebolt adapter plugin for dbt (data build tool) | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
url = https://github.com/firebolt-db/dbt-firebolt | ||
author = Firebolt | ||
author_email = [email protected] | ||
license = Apache-2.0 | ||
license_file = LICENSE | ||
classifiers = | ||
License :: OSI Approved :: Apache Software License | ||
Operating System :: OS Independent | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3 :: Only | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
project_urls = | ||
Bug Tracker = https://github.com/firebolt-db/dbt-firebolt/issues | ||
|
||
[options] | ||
packages = find_namespace: | ||
install_requires = | ||
jaydebeapi | ||
python_requires = >=3.7 | ||
include_package_data = True | ||
package_dir = | ||
= dbt | ||
|
||
[options.packages.find] | ||
where = dbt | ||
|
||
[options.extras_require] | ||
dev = | ||
mypy>=0.910 | ||
pre-commit==2.15.0 | ||
pytest==6.2.5 | ||
pytest-dbt-adapter==0.6.0 | ||
|
||
[mypy] | ||
disallow_untyped_defs = True | ||
show_error_codes = True | ||
|
||
[flake8] | ||
max-line-length = 88 | ||
per-file-ignores = __init__.py:F401 | ||
ignore = E203, W503 | ||
ban-relative-imports = True | ||
inline-quotes = ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,10 @@ | ||
#!/usr/bin/env python | ||
import os | ||
import re | ||
from setuptools import setup | ||
from setuptools.config import read_configuration | ||
|
||
from setuptools import find_namespace_packages, setup | ||
config = read_configuration('setup.cfg') | ||
version = config['metadata']['version'] | ||
dbt_version = version.rsplit('.', 1)[0] | ||
install_requires = [f'dbt-core~={dbt_version}', config['options']['install_requires']] | ||
|
||
this_directory = os.path.abspath(os.path.dirname(__file__)) | ||
with open(os.path.join(this_directory, 'README.md')) as f: | ||
long_description = f.read() | ||
|
||
|
||
def _dbt_synapse_version(): | ||
""" | ||
get version from __version__.py so that version is accessible via: | ||
- `dbt --version` and | ||
- dbt debug | ||
""" | ||
_version_path = os.path.join( | ||
this_directory, 'dbt', 'adapters', 'firebolt', '__version__.py' | ||
) | ||
_version_pattern = r"""version\s*=\s*["'](.+)["']""" | ||
with open(_version_path) as f: | ||
match = re.search(_version_pattern, f.read().strip()) | ||
if match is None: | ||
raise ValueError(f'invalid version at {_version_path}') | ||
return match.group(1) | ||
|
||
|
||
package_name = 'dbt-firebolt' | ||
package_version = _dbt_synapse_version() | ||
description = 'The Firebolt adapter plugin for dbt (data build tool)' | ||
dbt_version = '0.21' | ||
|
||
# the package version should be the dbt version, with maybe some things on the | ||
# ends of it. (0.18.1 vs 0.18.1a1, 0.18.1.1, ...) | ||
if not package_version.startswith(dbt_version): | ||
raise ValueError( | ||
f'Invalid setup.py: package_version={package_version} must start with ' | ||
f'dbt_version={dbt_version}' | ||
) | ||
|
||
setup( | ||
name=package_name, | ||
version=package_version, | ||
description=description, | ||
long_description=description, | ||
long_description_content_type='text/markdown', | ||
author='Shahar Shalev, Eric Ford, and Anders Swanson', | ||
author_email='[email protected]', | ||
url='https://github.com/firebolt-db/dbt-firebolt', | ||
packages=find_namespace_packages(include=['dbt', 'dbt.*']), | ||
include_package_data=True, | ||
install_requires=[ | ||
'dbt-core~={}'.format(dbt_version), | ||
'jaydebeapi', | ||
], | ||
) | ||
setup(install_requires=install_requires) |