Skip to content

Commit

Permalink
cleaned up dependencies, typing, changed actions
Browse files Browse the repository at this point in the history
  • Loading branch information
charlottekostelic committed Apr 4, 2024
1 parent 7b8f75f commit eb6bd36
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 91 deletions.
30 changes: 12 additions & 18 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,25 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python

- name: Set up poetry
run: pipx install poetry

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r dev-requirements.txt
run:
poetry install

- name: Run tests
run: python -m pytest --cov=acc_lcsh_check/

- name: Send report to Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
github-token: ${{ secrets.GITHUB_TOKEN}}
finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
github-token: ${{ secrets.GITHUB_TOKEN}}
4 changes: 2 additions & 2 deletions acc_lcsh_check/checker.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import datetime
import csv
import os
from rich import print
from typing import Generator
from acc_lcsh_check.lcsh import LCTerm


def read_data(file: str):
def read_data(file: str) -> Generator:
with open(file, "r") as csvfile:
reader = csv.reader(csvfile)
for item in reader:
Expand Down
2 changes: 1 addition & 1 deletion acc_lcsh_check/lcsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class LCTerm:
def __init__(self, id: str, old_heading: str, id_type: str):
def __init__(self, id: str, old_heading: str, id_type: str) -> None:
self.id = id
self.old_heading = old_heading
self.id_type = id_type
Expand Down
70 changes: 1 addition & 69 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ types-requests = "^2.31.0.20240311"
pytest = "^8.1.1"
pytest-cov = "^5.0.0"
pytest-mock = "^3.14.0"
rich = "^13.7.1"

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_checker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
import pytest
from typing import Generator

from acc_lcsh_check.checker import read_data, get_data

Expand All @@ -9,6 +10,7 @@ def test_read_data():
for term in data:
assert term[0].strip('" ') == "Foo"
assert term[1].strip('" ') == "sh00000000"
assert isinstance(data, Generator)


@pytest.mark.parametrize("heading_type", ["subjects", "names", "demographicTerms"])
Expand Down

0 comments on commit eb6bd36

Please sign in to comment.