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

feat: add new tests, type hinting, resolve issues #17

Merged
merged 15 commits into from
Apr 5, 2024
Merged
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