Skip to content

Commit

Permalink
PyPI deploy v0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
t0momi219 committed Jan 5, 2024
1 parent 2df3a86 commit bdee41e
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 55 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Pull Request

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand All @@ -17,10 +19,14 @@ jobs:
with:
python-version: "3.11"
cache: 'pip'
- name: Install dependencies
- name: Install dependencies for test
run: |
python -m pip install --upgrade pip
if [ -f .github/workflows/test-requirements.txt ]; then pip install -r .github/workflows/test-requirements.txt; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with mypy
run: |
mypy .
- name: Test with pytest
run: |
pytest .
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
release:
types: [published]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.11"
cache: 'pip'
- name: Install dependencies for test
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
autoflake>=2.2.1
black>=23.12.1
esbonio>=0.16.3
isort>=5.13.2
mypy>=1.8.0
networkx-stubs>=0.0.1
pandas-stubs>=2.1.4.231227
pytest>=7.4.3
pytest-cov>=4.1.0
pytest-mock>=3.12.0
sphinx>=7.2.6
sphinx-press-theme>=0.8.0
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ tmp
tmp.zip
dbt

.DS_Store

.python-version
.vscode

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Tableau Prepで作成されたフローをdbtモデルに変換するツールです。

ドキュメント
https://hogehoge
- https://hogehoge

ソースコード
https://github.com/t0momi219/prep2dbt
- https://github.com/t0momi219/prep2dbt

サンプル(Superstoreを本ツールでdbtに変換)
https://t0momi219.github.io/prep2dbt-demo/#!/overview
- https://t0momi219.github.io/prep2dbt-demo/#!/overview

## モチベーション

Tableau PrepはGUIで簡易なデータパイプラインを作成・操作することに焦点が当てられたツールです。フローが複雑化してきた場合や複数人でフローを利用する場合には、これを維持・管理するために大きな労力を支払わなければなりません。
Expand Down Expand Up @@ -46,7 +46,7 @@ Tableau PrepはGUIで簡易なデータパイプラインを作成・操作す
フローが利用している機能の一覧と、統計情報を出力します。これはフロー移行前に難易度や見積もりの測定を行ったり、リファクタリングのヒントとして活用するために利用できます。


# インストール
## インストール

pipからインストールできます。

Expand Down
3 changes: 2 additions & 1 deletion prep2dbt/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from prep2dbt.cli import cli

cli()
if __name__ == '__main__':
cli()
2 changes: 1 addition & 1 deletion prep2dbt/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.1"
__version__ = "0.0.3"
2 changes: 1 addition & 1 deletion prep2dbt/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def validate_dialect(ctx, param, value: str) -> str:
dialect = click.option(
"--dialect",
"-d",
help="SQLのダイアレクト。サポートしているDBはドキュメントを確認してください。",
help="SQLのダイアレクト。サポートしているDBは'snowflake', 'porstgre', 'duckdb'です。デフォルトではduckdbです。",
default="duckdb",
callback=validate_dialect,
)
Expand Down
38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
[build-system]
requires = ["wheel", "setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "prep2dbt"
dynamic = ["version"]
authors = [
{name = "Tomomi Kodama", email = "[email protected]"}
]
description = "Tools for converting Tableau Prep flows to dbt models"
readme = "README.md"
license = {file = "LICENSE"}
keywords = ["Tableau", "dbt"]
classifiers =[
"Development Status :: 3 - Alpha"
]
dependencies = [
"click>=8.1.7",
"networkx>=3.2.1",
"pandas>=2.1.4",
"ruamel.yaml>=0.18.5",
"snowflake-sqlalchemy>=1.5.1",
"sqlalchemy[mypy]>=1.4.50",
]
requires-python = ">= 3.11"

[project.urls]
Documentation = "https://github.com/t0momi219/prep2dbt"
Changelog = "https://github.com/t0momi219/prep2dbt"
Repository = "https://github.com/t0momi219/prep2dbt"
Issues = "https://github.com/t0momi219/prep2dbt"

[project.scripts]
prep2dbt = "prep2dbt.cli:cli"

[tool.setuptools.dynamic]
version = {attr = "prep2dbt.__version__.__version__"}

[tool.setuptools]
packages = ["prep2dbt"]
46 changes: 0 additions & 46 deletions setup.cfg

This file was deleted.

0 comments on commit bdee41e

Please sign in to comment.