Skip to content

Commit

Permalink
feat: implement file writer (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgpayne authored Sep 20, 2023
1 parent 339a843 commit 380db3f
Show file tree
Hide file tree
Showing 29 changed files with 8,925 additions and 329 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/pre-comit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: pre-commit

on:
merge_group:
pull_request:
push:
branches: [main]
workflow_dispatch:
inputs: {}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev libssl-dev
- name: Checkout the repository
uses: actions/checkout@v4

- name: Cache pre-commit environments
uses: actions/cache@v3
with:
key: pre-commit-config-${{ hashFiles('.pre-commit-config.yaml') }}
path: ~/.cache/pre-commit

- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
architecture: x64

- name: Install Poetry
run: |
pipx install poetry
poetry --version
- name: Configure Poetry
run: |
poetry env use 3.11
poetry debug info
- name: Install dependencies
run: poetry install

- name: pre-commit
run: poetry run pre-commit run --show-diff-on-failure --color=always --all-files
49 changes: 0 additions & 49 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,6 @@ name: Test python-singerlake
on: [push]

jobs:
linting:

runs-on: ubuntu-latest
strategy:
matrix:
# Only lint using the primary version used for dev
python-version: ["3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry==1.2.*
- name: Install dependencies
run: |
poetry install --with dev
- name: Run lint command from tox.ini
run: |
poetry run tox -e lint
mypy:

runs-on: ubuntu-latest
strategy:
matrix:
# Only lint using the primary version used for dev
python-version: ["3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry==1.2.*
- name: Install dependencies
run: |
poetry install --with dev
- name: Run type command from tox.ini
run: |
poetry run tox -e type

pytest:

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.vscode/
.DS_Store
.singerlake/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -161,4 +162,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
#.idea/
59 changes: 59 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
ci:
autofix_prs: true
autoupdate_schedule: weekly
autoupdate_commit_msg: "chore: pre-commit autoupdate"

repos:
- repo: local
hooks:
- id: check-poetry-lock
# `pre-commit autoupdate` will update to older Poetry versions, so we
# use a local hook to avoid that bug:
# https://github.com/meltano/meltano/pull/7238#issuecomment-1409434351
name: check that `poetry.lock` conforms to `pyproject.toml`
entry: poetry lock --check
language: python
pass_filenames: false
additional_dependencies:
- "poetry==1.6.1"

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
hooks:
- id: check-json
exclude: \.vscode/launch.json$
- id: check-toml
- id: check-yaml
exclude: ^(.+/)?template\.ya?ml$
- id: check-merge-conflict
- id: end-of-file-fixer
exclude: (.*\.svg)
- id: trailing-whitespace
exclude: ^(.bumpversion.cfg)$

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: "v1.5.4"
hooks:
- id: remove-crlf
- id: remove-tabs
args: ["--whitespaces-count", "4"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.289"
hooks:
- id: ruff
args: ["--fix", "--exit-non-zero-on-fix", "--show-fixes"]
- id: ruff
name: Ruff format
entry: ruff format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.5.1"
hooks:
- id: mypy
exclude: |
(?x)^(
.*tests.*|
)$
additional_dependencies:
- "types-PyYAML==6.0.12.2"
2 changes: 0 additions & 2 deletions mypy.ini

This file was deleted.

Loading

0 comments on commit 380db3f

Please sign in to comment.