Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,27 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
# Checkout repo
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
# Install uv with cache
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
# Sync dependencies
- name: Sync dependencies
run: uv sync
run: uv sync --python ${{ matrix.python-version }}
# Run tests without updating uv.lock
- name: Run tests
run: uv run --frozen pytest
run: uv run --frozen --python ${{ matrix.python-version }} pytest
# Code coverage to codecov.io
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
Expand All @@ -60,10 +61,10 @@ jobs:
steps:
# Checkout repo
- name: Checkout
uses: actions/checkout@v3
# Install uv with cache
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
uses: actions/checkout@v4
# Install uv
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
# Sync dependencies
Expand Down
18 changes: 18 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import nox

nox.options.default_venv_backend = "uv"

PYTHON_VERSIONS = [
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
]


@nox.session(python=PYTHON_VERSIONS)
def tests(session: nox.Session) -> None:
"""Run the test suite."""
session.install("-e", ".", "--group", "dev")
session.run("pytest")
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ authors = [
{ name = "dylanjmcconnell", email = "dylan.mcconnell@unsw.edu.au" }
]
dependencies = [
"pandas>=2.2.2",
"pandas>=2.2.2,<3.0.0",
"openpyxl>=3.1.5",
"pydantic>=2.8.2",
"pydantic>=2.12.0",
"pyyaml>=6.0.1",
"thefuzz>=0.22.1",
"rapidfuzz>=3.14.0",
"numpy>=2.1.0; python_version>='3.13'",
"numpy>=2.3.0; python_version>='3.14'",
]
readme = "README.md"
requires-python = ">= 3.9"
requires-python = ">=3.10"

[build-system]
requires = ["setuptools>=61.0", "wheel"]
Expand Down
7 changes: 3 additions & 4 deletions src/isp_workbook_parser/config_model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from pathlib import Path
from typing import Dict, List, Optional

import yaml
from pydantic import BaseModel
Expand Down Expand Up @@ -49,11 +48,11 @@ class TableConfig(BaseModel):

name: str
sheet_name: str
header_rows: int | List[int]
header_rows: int | list[int]
end_row: int
column_range: str
skip_rows: Optional[int | List[int] | Dict[str, int]] = None
columns_with_merged_rows: Optional[str | List[str]] = None
skip_rows: int | list[int] | dict[str, int] | None = None
columns_with_merged_rows: str | list[str] | None = None
forward_fill_values: bool = True


Expand Down
6 changes: 2 additions & 4 deletions src/isp_workbook_parser/read_table.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import List, Union

import numpy as np
import openpyxl
import openpyxl.utils
Expand Down Expand Up @@ -213,7 +211,7 @@ def _build_cleaned_dataframe(


def _skip_rows_in_dataframe(
df: pd.DataFrame, config_skip_rows: Union[int, List[int]], last_header_row: int
df: pd.DataFrame, config_skip_rows: int | list[int], last_header_row: int
) -> pd.DataFrame:
"""
Drop rows specified by `skip_rows` by applying an offset from the header and
Expand All @@ -233,7 +231,7 @@ def _skip_rows_in_dataframe(

def _handle_merged_rows(
df: pd.DataFrame,
config_cols_with_merged_rows: Union[str, List[str]],
config_cols_with_merged_rows: str | list[str],
column_range: str,
) -> pd.DataFrame:
"""
Expand Down
Loading
Loading