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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ We supply the extension [prepackaged](https://github.com/mlin/GenomicSQLite/rele
Programming language support:

* C/C++
* Python ≥3.6
* Python ≥3.10
* Java & JVM languages
* Rust

Expand All @@ -54,7 +54,7 @@ cmake --build build -j 4 --target genomicsqlite

* htslib ≥ 1.9, samtools, and tabix
* pigz
* Python ≥ 3.6 and packages: pytest pytest-xdist pre-commit ruff
* Python ≥ 3.10 and packages: pytest pytest-xdist pre-commit ruff
* JDK, mvn, rust
* clang-format & cppcheck

Expand Down
2 changes: 1 addition & 1 deletion bindings/python/conda/genomicsqlite/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ requirements:
- python
- pip
run:
- python >=3.6
- python >=3.10
- sqlite >=3.31.0

test:
Expand Down
40 changes: 20 additions & 20 deletions bindings/python/genomicsqlite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import platform
import sqlite3
import sys
from typing import Any, Dict, NamedTuple, Optional # noqa: UP035
from typing import Any, NamedTuple

_HERE = os.path.dirname(__file__)
_YES = ("1", "true", "t", "yes", "y")
Expand Down Expand Up @@ -110,7 +110,7 @@ def create_genomic_range_index_sql(
rid: str,
beg: str,
end: str,
floor: Optional[int] = None,
floor: int | None = None,
) -> str:
return _execute1(
conn, "SELECT create_genomic_range_index_sql(?,?,?,?,?)", (table, rid, beg, end, floor)
Expand All @@ -120,11 +120,11 @@ def create_genomic_range_index_sql(
def genomic_range_rowids_sql(
conn: sqlite3.Connection,
indexed_table: str,
qrid: Optional[str] = None,
qbeg: Optional[str] = None,
qend: Optional[str] = None,
ceiling: Optional[int] = None,
floor: Optional[int] = None,
qrid: str | None = None,
qbeg: str | None = None,
qend: str | None = None,
ceiling: int | None = None,
floor: int | None = None,
) -> str:
"""
Generate SQL subquery selecting the rowids of indexed_table entries overlapping a range.
Expand All @@ -145,7 +145,7 @@ def genomic_range_rowids_sql(


def put_reference_assembly_sql(
conn: sqlite3.Connection, assembly: str, schema: Optional[str] = None
conn: sqlite3.Connection, assembly: str, schema: str | None = None
) -> str:
return _execute1(conn, "SELECT put_genomic_reference_assembly_sql(?,?)", (assembly, schema))

Expand All @@ -154,11 +154,11 @@ def put_reference_sequence_sql(
conn: sqlite3.Connection,
name: str,
length: int,
assembly: Optional[str] = None,
refget_id: Optional[str] = None,
meta: Optional[Dict[str, Any]] = None,
rid: Optional[int] = None,
schema: Optional[str] = None,
assembly: str | None = None,
refget_id: str | None = None,
meta: dict[str, Any] | None = None,
rid: int | None = None,
schema: str | None = None,
):
meta_json = json.dumps(meta) if meta else None
return _execute1(
Expand All @@ -172,14 +172,14 @@ class ReferenceSequence(NamedTuple):
rid: int
name: str
length: int
assembly: Optional[str]
refget_id: Optional[str]
meta: Dict[str, Any]
assembly: str | None
refget_id: str | None
meta: dict[str, Any]


def get_reference_sequences_by_rid(
con: sqlite3.Connection, assembly: Optional[str] = None, schema: Optional[str] = None
) -> Dict[int, ReferenceSequence]:
con: sqlite3.Connection, assembly: str | None = None, schema: str | None = None
) -> dict[int, ReferenceSequence]:
table = "_gri_refseq"
if schema:
table = f"{schema}.{table}"
Expand Down Expand Up @@ -208,8 +208,8 @@ def get_reference_sequences_by_rid(


def get_reference_sequences_by_name(
con: sqlite3.Connection, assembly: Optional[str] = None, schema: Optional[str] = None
) -> Dict[str, ReferenceSequence]:
con: sqlite3.Connection, assembly: str | None = None, schema: str | None = None
) -> dict[str, ReferenceSequence]:
ans = {}
for item in get_reference_sequences_by_rid(con, assembly, schema).values():
assert item.name not in ans, "genomicsqlite: non-unique reference sequence names"
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
README = f.read()

setup(
python_requires=">=3.6",
python_requires=">=3.10",
name="genomicsqlite",
version=get_version(),
url="https://github.com/mlin/GenomicSQLite",
Expand Down
6 changes: 2 additions & 4 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
# Opt out of specific rules only where warranted; each opt-out is documented
# inline. No rule sets are selected or opted into.
line-length = 100 # exception to the ruff default (88): matches this codebase's black -l 100 formatting; avoids a whole-tree reformat
target-version = "py310" # matches the package's declared floor (python_requires>=3.10); binding annotations are evaluated at runtime

[lint]
ignore = [
"UP006", # non-pep585-annotation: binding annotations are evaluated at runtime; package declares python_requires>=3.6
"UP045", # non-pep604-annotation-optional: same runtime-annotation / python>=3.6 constraint as UP006
]
ignore = [] # no global opt-outs; per-file opt-outs for the vendored file are scoped below

[lint.per-file-ignores]
# bindings/python/version.py is vendored (third-party, public domain) and not
Expand Down
Loading