Skip to content

Commit

Permalink
feat: add new tests, type hinting, resolve issues (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrk authored Apr 5, 2024
1 parent fcac46c commit 945ce2e
Show file tree
Hide file tree
Showing 40 changed files with 2,033 additions and 773 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: CI/CD Workflow

on:
push:
branches: ['*']
pull_request:
branches: [ main ]

jobs:
type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12.2'
- name: Install Poetry
run: pip install poetry
- name: Install dependencies
run: poetry install
- name: Perform type checking
run: poetry run mypy .
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12.2'
- name: Install Poetry
run: pip install poetry
- name: Install dependencies
run: poetry install
- name: Execute tests
run: poetry run pytest

code-style-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12.2'
- name: Install Poetry
run: pip install poetry
- name: Install dependencies
run: poetry install
- name: Check code style
run: poetry run ruff check

release:
needs: [run-tests, code-style-check, type-check]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12.2'
- name: Install Dependencies
run: |
pip install poetry
poetry install
- name: Semantic Release
run: poetry run semantic-release publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}


# publish:
# needs: [run-tests, code-style-check, type-check]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.12.2'
# - name: Install Poetry
# run: pip install poetry
# - name: Install dependencies
# run: poetry install
# - name: Publish package
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
48 changes: 48 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
ci:
skip: [pytest]

default_language_version:
python: python3.12

repos:
# general checks (see here: https://pre-commit.com/hooks.html)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
args: [--allow-multiple-documents]
- id: end-of-file-fixer
- id: trailing-whitespace

# black - formatting
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
name: black
args:
- "--config"
- "./pyproject.toml"

# ruff - linting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.0"
hooks:
- id: ruff
name: ruff

# mypy - lint-like type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
name: mypy

- repo: local
hooks:
- id: pytest
name: pytest
entry: poetry run pytest --cov=src tests
language: system
types: [python]
pass_filenames: false
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

36 changes: 0 additions & 36 deletions docs/make.bat

This file was deleted.

23 changes: 0 additions & 23 deletions docs/source/about.rst

This file was deleted.

Loading

0 comments on commit 945ce2e

Please sign in to comment.