Skip to content

Commit c9a7dbe

Browse files
committed
Drop support for python 3.8
1 parent 65d596e commit c9a7dbe

File tree

6 files changed

+38
-24
lines changed

6 files changed

+38
-24
lines changed

.github/workflows/testing.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ env:
88
CARGO_TERM_COLOR: always
99
RUST_BACKTRACE: 1
1010
RUSTFLAGS: "-D warnings"
11+
PYTHON_VERSION: "3.9"
1112
jobs:
1213
clippy:
1314
name: Clippy
@@ -33,11 +34,37 @@ jobs:
3334
uses: Swatinem/[email protected]
3435
- name: Run cargo fmt
3536
run: cargo fmt --all -- --check
37+
python-linting:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: install Just
42+
uses: taiki-e/install-action@just
43+
- name: Install uv
44+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
45+
- name: Set up Python
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: ${{ env.PYTHON_VERSION }}
49+
- name: Restore uv cache
50+
uses: actions/cache@v4
51+
with:
52+
path: ${{ env.UV_CACHE_DIR }}
53+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
54+
restore-keys: |
55+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
56+
uv-${{ runner.os }}
57+
- name: Install Dependencies
58+
run: just install
59+
- name: mypy check
60+
run: just mypy
61+
- name: Minimize uv cache
62+
run: uv cache prune --ci
3663
test:
3764
strategy:
3865
fail-fast: false
3966
matrix:
40-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
67+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
4168
os: [ubuntu-latest, windows-latest, macos-latest]
4269
runs-on: ${{ matrix.os }}
4370
steps:

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ pip install prelude-parser
1616

1717
Optionally the `pandas` extra can be installed to parse to a Pandas `DataFrame`
1818

19-
Note: Pandas only supports Python 3.9+ so this is not available in Python 3.8.
20-
2119
```sh
2220
pip install prelude-parser[pandas]
2321
```

prelude_parser/pandas.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
import sys
43
from pathlib import Path
54

65
from prelude_parser._prelude_parser import _parse_flat_file_to_pandas_dict
@@ -13,9 +12,6 @@ class UnsupportedPythonVersionError(Exception):
1312
try:
1413
import pandas as pd
1514
except ImportError as e: # pragma: no cover
16-
if sys.version_info < (3, 9): # pargma: no cover
17-
raise UnsupportedPythonVersionError("Pandas only supports Python 3.9+") from e
18-
1915
raise ImportError(
2016
"prelude-parser must be installed with the pandas or all extra to use pandas"
2117
) from e

prelude_parser/types.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
from __future__ import annotations
2+
13
from datetime import date, datetime
2-
from typing import Dict, List, Union
34

4-
FieldInfo = Union[str, int, float, date, datetime, None]
5-
FlatFormInfo = List[Dict[str, FieldInfo]]
5+
FieldInfo = str | int | float | date | datetime | None
6+
FlatFormInfo = list[dict[str, FieldInfo]]

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ build-backend = "maturin"
44

55
[project]
66
name = "prelude-parser"
7-
requires-python = ">=3.8"
7+
requires-python = ">=3.9"
88
description = "Parses XML files exported from Prelude EDC into formats usable by Python."
99
authors = [{name = "Paul Sanders", email = "[email protected]"}]
1010
keywords = ["parser", "prelude-edc", "xml", "pandas", "polars"]
1111
classifiers = [
1212
"Programming Language :: Rust",
1313
"Programming Language :: Python :: Implementation :: CPython",
14-
"Programming Language :: Python :: 3.8",
1514
"Programming Language :: Python :: 3.9",
1615
"Programming Language :: Python :: 3.10",
1716
"Programming Language :: Python :: 3.11",
@@ -29,9 +28,9 @@ documentation = "https://github.com/pbs-data-solutions/prelude-parser"
2928
dependencies = ["camel-converter>=3.0.0"]
3029

3130
[project.optional-dependencies]
32-
pandas = ['pandas>=2.1.0; python_version>"3.8"']
31+
pandas = ["pandas>=2.1.0"]
3332
polars = ["polars>=0.17.14"]
34-
all = ['pandas>=2.1.0; python_version>"3.8"', "polars>=0.17.14"]
33+
all = ["pandas>=2.1.0", "polars>=0.17.14"]
3534

3635
[tool.maturin]
3736
module-name = "prelude_parser._prelude_parser"
@@ -52,7 +51,7 @@ disallow_untyped_defs = false
5251

5352
[tool.ruff]
5453
line-length = 100
55-
target-version = "py38"
54+
target-version = "py39"
5655
fix = true
5756

5857
[tool.ruff.lint]

tests/test_pandas.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
import sys
1+
import pandas as pd
22

3-
import pytest
3+
from prelude_parser.pandas import to_dataframe
44

5-
if sys.version_info >= (3, 9):
6-
import pandas as pd
75

8-
from prelude_parser.pandas import to_dataframe
9-
10-
11-
@pytest.mark.skipif(sys.version_info < (3, 9), reason="Pandas only supports 3.9+")
126
def test_pandas_to_dataframe(test_file_1):
137
result = to_dataframe(test_file_1)
148
data = {
@@ -32,7 +26,6 @@ def test_pandas_to_dataframe(test_file_1):
3226
assert expected.equals(result)
3327

3428

35-
@pytest.mark.skipif(sys.version_info < (3, 9), reason="Pandas only supports 3.9+")
3629
def test_pandas_to_dataframe_short_names(test_file_4):
3730
result = to_dataframe(test_file_4, short_names=True)
3831
data = {

0 commit comments

Comments
 (0)