Skip to content

Commit

Permalink
Deprecate Python 3.9 support (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins authored Sep 18, 2024
1 parent 05707d0 commit 3c57c60
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
4 changes: 0 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ linux_aarch64_task:
<<: *BUILD_AND_STORE_WHEELS

matrix:
- env:
PYTHON_VERSION_NAME: python 3.9
CIBW_BUILD: cp39-manylinux*
only_if: $CIRRUS_BRANCH == 'main'
- env:
PYTHON_VERSION_NAME: python 3.10
CIBW_BUILD: cp310-manylinux*
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,11 @@ jobs:
matrix:
os: ["ubuntu-22.04", "macos-13", "macos-14"]
# https://peps.python.org/pep-0425
cpython: ["cp39", "cp310", "cp311", "cp312"]
cpython: ["cp310", "cp311", "cp312"]
is_main_or_release:
- ${{ contains(github.ref, 'main') || startsWith(github.ref, 'refs/tags')}}
# Avoid building all wheels in a PR
exclude:
- is_main_or_release: false
cpython: cp39
- is_main_or_release: false
cpython: cp310
- is_main_or_release: false
Expand Down
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ History

X.Y.Z (YYYY-MM-DD)
------------------
* Deprecate Python 3.9 support (:pr:`125`)
* Upgrade to casacore 3.6.1 (:pr:`124`)
* Build against NumPy 2 (:pr:`122`)
* Add pre-commit hooks, install formatters and linters (:pr:`121`)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [
]
description = "Arrow bindings for casacore"
readme = {file = "README.rst", content-type = "text/x-rst"}
requires_python = ">= 3.9"
requires_python = ">= 3.10"
license = {file = "LICENSE"}
classifiers = [
"License :: OSI Approved :: BSD License",
Expand Down
22 changes: 11 additions & 11 deletions src/arcae/lib/arrow_tables.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from collections.abc import MutableMapping, Sequence
import cython
import json
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, List, Union

from libcpp cimport bool
from libcpp.memory cimport shared_ptr
Expand Down Expand Up @@ -43,7 +43,7 @@ DimIndex = Union[slice, list, np.ndarray]
FullIndex = Union[list[DimIndex], tuple[DimIndex]]


def ms_descriptor(table: str, complete: bool = False) -> dict:
def ms_descriptor(table: str, complete: bool = False) -> Dict:
cdef string ctable = tobytes(table)

with nogil:
Expand Down Expand Up @@ -121,7 +121,7 @@ cdef class Table:
@staticmethod
def from_taql(
taql: str,
tables: Optional[Union[Sequence[Table], Table]] = None
tables: Union[Sequence[Table], Table] | None = None
) -> Table:
cdef:
Table table = Table.__new__(Table)
Expand Down Expand Up @@ -171,8 +171,8 @@ cdef class Table:
def ms_from_descriptor(
filename: str,
subtable: str = "MAIN",
table_desc: Optional[dict] = None,
dminfo: Optional[dict] = None
table_desc: Dict | None = None,
dminfo: Dict | None = None
) -> Table:
cdef:
Table table = Table.__new__(Table)
Expand All @@ -193,7 +193,7 @@ cdef class Table:

def to_arrow(
self,
index: Optional[FullIndex] = None,
index: FullIndex | None = None,
columns: Union[list[str], str] = None
) -> pa.Table:
cdef:
Expand All @@ -220,8 +220,8 @@ cdef class Table:
def getcol(
self,
column: str,
index: Optional[FullIndex] = None,
result: Optional[np.ndarray] = None
index: FullIndex | None = None,
result: np.ndarray | None = None
) -> np.ndarray:
cdef:
string cpp_column = tobytes(column)
Expand All @@ -244,7 +244,7 @@ cdef class Table:
self,
column: str,
data: np.ndarray,
index: Optional[FullIndex] = None
index: FullIndex | None = None
):
cdef:
string cpp_column = tobytes(column)
Expand Down Expand Up @@ -377,7 +377,7 @@ cdef class Table:
with nogil:
GetResultValue(self.c_table.get().AddRows(cnrows))

def addcols(self, columndescs: dict, dminfo: dict | None):
def addcols(self, columndescs: Dict, dminfo: Dict | None):
cdef:
string cjson_columndescs = tobytes(json.dumps(columndescs))
string cjson_dminfo = tobytes(json.dumps(dminfo) if dminfo else "{}")
Expand Down Expand Up @@ -426,7 +426,7 @@ class Configuration(MutableMapping):

return iter([frombytes(k) for k in keys])

def __len__(self):
def __len__(self) -> int:
with nogil:
config: cython.pointer(CConfiguration) = &CServiceLocator.configuration()

Expand Down

0 comments on commit 3c57c60

Please sign in to comment.