From 03b0588fb5a0c6c2cad2c96eb73452e7faf86754 Mon Sep 17 00:00:00 2001 From: Eli Talbert Date: Wed, 15 May 2024 10:13:26 -0400 Subject: [PATCH] unit test workflow --- .github/workflows/unit-tests.yml | 36 ++++++++++++++++++++++++++++++++ README.md | 1 + geochron/__init__.py | 1 + 3 files changed, 38 insertions(+) create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..6112360 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,36 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Unit Tests + +on: + push: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi + + - name: Lint with pylint + run: | + pylint --fail-under=9.0 geochron + + - name: Pytest + run: | + coverage run --source geochron/ -m pytest && coverage report -m --fail-under 99 + + - name: MyPy + run: | + mypy geochron --ignore-missing-imports \ No newline at end of file diff --git a/README.md b/README.md index b10cc2f..71266a7 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Geotime does not require any of the below dependencies to function, however some * networkx (chron-nets) ### Overview +[![Unit Tests](https://github.com/etalbert102/geochron/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/etalbert102/geochron/actions/workflows/unit-tests.yml) Geotime enables various ways of displaying and structuring geo-spatial-temporal data diff --git a/geochron/__init__.py b/geochron/__init__.py index 18fbf9b..140790c 100644 --- a/geochron/__init__.py +++ b/geochron/__init__.py @@ -9,6 +9,7 @@ { 'networkx': 'networkx>=3.0,<4.0', 'plotly': 'plotly>=5,<6', + 'timehash': 'timehash>=1.2,<2', } ) sys.meta_path.append(ConditionalPackageInterceptor) # type: ignore