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
16 changes: 12 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
strategy:
matrix:
include:
- python-version: "3.9"
setuptools: "setuptools==77.0.3"
- python-version: "3.11"
setuptools: "setuptools==77.0.3"
- python-version: "3.14"
setuptools: "setuptools"
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -45,11 +45,19 @@ jobs:
fail-fast: true
matrix:
include:
- python-version: "3.9"
- python-version: "3.11"
pandas-version: "minimum"
pyarrow-version: "minimum"
polars-version: "none"
- python-version: "3.10"
- python-version: "3.12"
pandas-version: "latest"
pyarrow-version: "latest"
polars-version: "none"
- python-version: "3.13"
pandas-version: "latest"
pyarrow-version: "latest"
polars-version: "none"
- python-version: "3.14"
pandas-version: "latest"
pyarrow-version: "latest"
polars-version: "none"
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Do not tell the user you are "done" or that changes are "complete" until both pa

- Use ruff for linting
- Configuration is in `pyproject.toml` under `[tool.ruff]`
- Target Python version: 3.9+ (CI matrix runs 3.9 / 3.10 / 3.11)
- Target Python version: 3.11+ (CI matrix runs 3.11 through 3.14)

## Project Shape

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ into columns.
python -m pip install gtfparse
```

Python 3.9 or later is required. For optional Polars output, install
Python 3.11 or later is required. For optional Polars output, install
`gtfparse[polars]`.

## Read an annotation and find genes
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/compare_releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import statistics
import subprocess
import sys
from datetime import datetime, timezone
from datetime import UTC, datetime
from pathlib import Path


Expand Down Expand Up @@ -120,7 +120,7 @@ def main():
)
result = {
"description": "Complete production readers; imports/checksums outside wall time; sequential fresh processes",
"date": datetime.now(timezone.utc).isoformat(),
"date": datetime.now(UTC).isoformat(),
"threads": args.threads,
"inputs": {
path.name: {
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ attribute values such as gene and transcript IDs expanded into columns.
python -m pip install gtfparse
```

Python 3.9 or later is required. For optional Polars output, install
Python 3.11 or later is required. For optional Polars output, install
`gtfparse[polars]`.

## Read an annotation and find genes
Expand Down
2 changes: 1 addition & 1 deletion gtfparse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)
from .write_gtf import write_gtf

__version__ = "3.0.4"
__version__ = "3.0.5"

__all__ = [
"GENCODE_BIOTYPE_ALIASES",
Expand Down
4 changes: 2 additions & 2 deletions gtfparse/write_gtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from collections.abc import Iterable
from itertools import repeat
from pathlib import Path
from typing import TYPE_CHECKING, Optional, Union
from typing import TYPE_CHECKING, Union

import pandas as pd

Expand Down Expand Up @@ -74,7 +74,7 @@ def _lines(df):
def write_gtf(
df: Union[pd.DataFrame, "polars.DataFrame"],
path: Union[str, Path],
header_lines: Optional[Iterable[str]] = None,
header_lines: Iterable[str] | None = None,
) -> None:
"""
Write a DataFrame of genomic features back out to a GTF file.
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "gtfparse"
requires-python = ">=3.9"
requires-python = ">=3.11"
authors = [ {name="Alex Rubinsteyn", email="alex.rubinsteyn@unc.edu" } ]
description = "Parsing library for extracting data frames of genomic features from GTF files"
license = "Apache-2.0"
Expand All @@ -16,10 +16,10 @@ classifiers = [
"Intended Audience :: Science/Research",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
readme = "README.md"
Expand All @@ -46,7 +46,7 @@ dependencies = {file = ["requirements.txt"]}
packages = ["gtfparse"]

[tool.ruff]
target-version = "py39"
target-version = "py311"
line-length = 100
src = ["gtfparse", "tests"]
exclude = [
Expand Down Expand Up @@ -78,7 +78,7 @@ ignore = [
"B008", # do not perform function calls in argument defaults
"B905", # zip() without explicit strict
"SIM108", # use ternary operator instead of if-else
"UP007", # use X | Y for type unions (need Python 3.10+)
"UP007", # retain the established Union annotation style
"UP031", # %-format strings
]

Expand Down
31 changes: 31 additions & 0 deletions tasks/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,3 +521,34 @@ PR #93: lint passed, all 213 tests passed, all three executable documentation
examples passed, and the strict MkDocs build passed.
PR #95: merged the refreshed parent; version 3.0.4, lint, 213 tests, and the
strict MkDocs build passed.

# Python 3.11 support floor (#96)

## Specification

Require Python 3.11 or newer with no upper bound. Test Python 3.11–3.14 in CI,
retaining the existing pandas, PyArrow, and optional Polars compatibility
combinations. Keep support for both pandas 2 and 3 because this change only
raises the Python floor. Align package metadata, docs, tooling, and repository
guidance; bump the patch version to 3.0.5. Preserve parsing behavior.

## Plan

- [x] Read issue, package requirements, CI matrix, repo guidance, and tests.
- [x] Check plan before implementation: retain compatibility jobs on 3.11 and
add 3.12–3.14 jobs with current dependencies; move packaging endpoints to
3.11 and 3.14.
- [x] Update metadata, docs, CI, target version, and package version.
- [x] Run `./lint.sh` and `./test.sh` in an isolated environment.
- [x] Verify installed metadata/dependencies and tests on Python 3.11 and 3.14;
review the diff.
- [ ] Open PR, pass CI, merge, deploy from clean master, verify publication.

## Review

`./lint.sh` passed. `./test.sh -W error::DeprecationWarning` passed all 213
tests with pandas 3.0.6, PyArrow 26, and Polars 2.0.0 on both Python 3.11.12
and 3.14.6 (97% coverage). Isolated dependency checks passed at both endpoints.
Installed metadata reports version 3.0.5, `Requires-Python: >=3.11`, and the
existing pandas 2-compatible dependency floor. Ruff's new Python target enabled
two safe Python 3.11 syntax updates; no parsing behavior changed.
Loading