Skip to content

Commit

Permalink
github typing action
Browse files Browse the repository at this point in the history
  • Loading branch information
debpal committed Sep 15, 2024
1 parent 295e5d0 commit cd5d398
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/typing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: mypy

on:
push:
branches:
- main # Your branch name
paths:
- '**/*.py' # Trigger only for changes in Python files
pull_request:
branches:
- main # Your branch name
paths:
- '**/*.py' # Trigger only for changes in Python files

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install mypy
- name: Type check with mypy
run: |
mypy BharatFinTrack
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ For detailed information, see the [documentation](http://suomigeodata.readthedoc
| <big>Status</big> | <big>Description</big> |
| --- | --- |
| **PyPI**| ![PyPI - Version](https://img.shields.io/pypi/v/SuomiGeoData) ![PyPI - Status](https://img.shields.io/pypi/status/SuomiGeoData) ![PyPI - Wheel](https://img.shields.io/pypi/wheel/SuomiGeoData) |
| **GitHub** | ![GitHub last commit](https://img.shields.io/github/last-commit/debpal/SuomiGeoData) ![GitHub repo size](https://img.shields.io/github/repo-size/debpal/SuomiGeoData) |
| **GitHub** | ![GitHub last commit](https://img.shields.io/github/last-commit/debpal/SuomiGeoData) [![flake8](https://github.com/debpal/SuomiGeoData/actions/workflows/linting.yml/badge.svg?branch=main)](https://github.com/debpal/SuomiGeoData/actions/workflows/linting.yml) ![GitHub repo size](https://img.shields.io/github/repo-size/debpal/SuomiGeoData) |
| **Codecov** | |
| **Read**_the_**Docs** | [![Documentation Status](https://readthedocs.org/projects/suomigeodata/badge/?version=latest)](https://suomigeodata.readthedocs.io/en/latest/?badge=latest) |
| **License** | ![PyPI - License](https://img.shields.io/pypi/l/SuomiGeoData) |
Expand Down
9 changes: 9 additions & 0 deletions tests/test_paituli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ def test_save_indexmap_tdb(
with pytest.raises(Exception) as exc_info:
class_instance.save_indexmap_tdb('invalid_file_extension.sh')
assert exc_info.value.args[0] == 'Could not OGR format driver from the file path.'


def test_is_valid_label_dem(
class_instance
):

# pass test
assert class_instance.is_valid_label_dem('K3244G') is True
assert class_instance.is_valid_label_dem('invalid_label') is False


def test_is_valid_label_tdb(
Expand Down

0 comments on commit cd5d398

Please sign in to comment.