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

Refactor setup.py into poetry #39

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
48 changes: 20 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,16 @@ jobs:

- name: Install python dependencies
run: |
python -m pip install --user --upgrade pip
python -m pip install -r dev-requirements.txt
python -m pip --version
pre-commit --version
mypy --version
dbt --version
python -m pip install poetry
poetry install -v
poetry run pre-commit --version
poetry run pyright --version
poetry run dbt --version

- name: Run pre-commit hooks
run: pre-commit run --all-files --show-diff-on-failure
run: |
poetry run pyright --createstub "agate"
poetry run pre-commit run --all-files

build:
name: build packages
Expand All @@ -83,21 +84,18 @@ jobs:
python-version: 3.8

- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
with:
path: "./dev-requirements.txt"
run: |
python -m pip install poetry
python -m pip install twine
poetry install -v

- name: Build distributions
run: |
chmod u+x ./scripts/build-dist.sh
./scripts/build-dist.sh

- name: Show distributions
run: ls -lh dist/
poetry build

- name: Check distribution descriptions
run: |
twine check dist/*
poetry run twine check dist/*

- uses: actions/upload-artifact@v3
with:
Expand All @@ -106,7 +104,9 @@ jobs:
test-build:
name: verify packages / python ${{ matrix.python-version }} / ${{ matrix.os }}

needs: build
needs:
- build
- code-quality

runs-on: ${{ matrix.os }}

Expand All @@ -124,31 +124,23 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel twine check-wheel-contents
pip --version
python -m pip install poetry

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: dist
path: dist/

- name: Show distributions
run: ls -lh dist/

- name: Install wheel distributions
run: |
find ./dist/*.whl -maxdepth 1 -type f | xargs pip install --force-reinstall --find-links=dist/
find ./dist/*.whl -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
- name: Check wheel distributions
run: |
dbt --version
- name: Install source distributions
run: |
find ./dist/*.gz -maxdepth 1 -type f | xargs pip install --force-reinstall --find-links=dist/
- name: Check source distributions
run: |
dbt --version
find ./dist/*.gz -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
publish:
name: Publish python package to PyPi repository
needs: test-build
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,6 @@ dmypy.json

# Logs
logs/

# Pyright type checker
typings/
15 changes: 3 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,7 @@ repos:
args: ['--ignore=E203,W503'] # see https://github.com/psf/black/issues/315 https://github.com/psf/black/issues/52
alias: flake8-check
stages: [manual]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.782
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.280
hooks:
- id: mypy
args: [--show-error-codes, --ignore-missing-imports]
files: ^dbt/adapters/.*
language: system
- id: mypy
alias: mypy-check
stages: [manual]
args: [--show-error-codes, --pretty, --ignore-missing-imports]
files: ^dbt/adapters
language: system
- id: pyright
3 changes: 0 additions & 3 deletions mypy.ini

This file was deleted.

Loading