Skip to content

Commit 48acc4c

Browse files
authored
chore: remove Python 3.8 support (#12)
1 parent dc11709 commit 48acc4c

9 files changed

+54
-43
lines changed

.github/workflows/pypi-publish.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python 3.9
18-
uses: actions/setup-python@v2
16+
- uses: actions/checkout@v4
17+
- name: Set up Python 3.11
18+
uses: actions/setup-python@v5
1919
with:
20-
python-version: 3.9
20+
python-version: 3.11
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip

.github/workflows/pypi-test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
18+
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
1919

2020
name: Python ${{ matrix.python-version }}
2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2323
- name: Setup Python
24-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v5
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727
cache: 'pip'

.pre-commit-config.yaml

+13-12
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,27 @@ repos:
1717
- id: mixed-line-ending
1818
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows
1919

20-
- repo: https://github.com/PyCQA/docformatter
21-
rev: v1.7.5
22-
hooks:
23-
- id: docformatter
24-
additional_dependencies: [tomli]
25-
args: [--in-place, --wrap-descriptions=120, --wrap-summaries=120]
26-
# --config, ./pyproject.toml
20+
# - repo: https://github.com/PyCQA/docformatter
21+
# rev: master
22+
# hooks:
23+
# - id: docformatter
24+
# additional_dependencies: [tomli]
25+
# args: [--in-place, --wrap-descriptions=120, --wrap-summaries=120]
26+
# # --config, ./pyproject.toml
2727

28-
- repo: https://github.com/psf/black
29-
rev: 24.8.0
30-
hooks:
31-
- id: black
32-
language_version: python3
28+
# - repo: https://github.com/psf/black
29+
# rev: 24.8.0
30+
# hooks:
31+
# - id: black
32+
# language_version: python3
3333

3434
- repo: https://github.com/astral-sh/ruff-pre-commit
3535
# Ruff version.
3636
rev: v0.6.8
3737
hooks:
3838
- id: ruff
3939
args: [--fix, --exit-non-zero-on-fix]
40+
- id: ruff-format
4041

4142
## If like to embrace black styles even in the docs:
4243
# - repo: https://github.com/asottile/blacken-docs

CHANGELOG.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Changelog
22

3-
## Version 0.1 (development)
3+
## Version 0.2.0
44

5-
- Feature A added
6-
- FIX: nasty bug #1729 fixed
7-
- add your changes here!
5+
- chore: Remove Python 3.8 (EOL)
6+
- precommit: Replace docformatter with ruff's formatter
7+
8+
## Version 0.1.o
9+
10+
- Initial version of the package.

docs/conf.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"sphinx.ext.ifconfig",
7373
"sphinx.ext.mathjax",
7474
"sphinx.ext.napoleon",
75+
"sphinx_autodoc_typehints",
7576
]
7677

7778
# Add any paths that contain templates here, relative to this directory.
@@ -166,12 +167,23 @@
166167
# If this is True, todo emits a warning for each TODO entries. The default is False.
167168
todo_emit_warnings = True
168169

170+
autodoc_default_options = {
171+
# 'members': 'var1, var2',
172+
# 'member-order': 'bysource',
173+
"special-members": True,
174+
"undoc-members": True,
175+
"exclude-members": "__weakref__, __dict__, __str__, __module__",
176+
}
177+
178+
autosummary_generate = True
179+
autosummary_imported_members = True
180+
169181

170182
# -- Options for HTML output -------------------------------------------------
171183

172184
# The theme to use for HTML and HTML Help pages. See the documentation for
173185
# a list of builtin themes.
174-
html_theme = "alabaster"
186+
html_theme = "furo"
175187

176188
# Theme options are theme-specific and customize the look and feel of a theme
177189
# further. For a list of options available for each theme, see the

docs/requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
furo
2+
myst-nb
13
# Requirements file for ReadTheDocs, check .readthedocs.yml.
24
# To build the module reference correctly, make sure every external package
35
# under `install_requires` in `setup.cfg` is also listed here!
46
# sphinx_rtd_theme
57
myst-parser[linkify]
68
sphinx>=3.2.1
9+
sphinx-autodoc-typehints

pyproject.toml

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ extend-ignore = ["F821"]
1717
[tool.ruff.pydocstyle]
1818
convention = "google"
1919

20+
[tool.ruff.format]
21+
docstring-code-format = true
22+
docstring-code-line-length = 20
23+
2024
[tool.ruff.per-file-ignores]
2125
"__init__.py" = ["E402", "F401"]
2226

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ package_dir =
4141
=src
4242

4343
# Require a min/specific Python version (comma-separated conditions)
44-
python_requires = >=3.8
44+
python_requires = >=3.9
4545

4646
# Add here dependencies of your project (line-separated), e.g. requests>=2.2,<3.0.
4747
# Version specifiers like >=2.2,<3.0 avoid problems due to API changes in

src/tiledbarray/TileDBArraySeed.py

+6-18
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ def __init__(self, path: str, attribute_name: str) -> None:
4444
_all_attr.append(_schema.attr(i).name)
4545

4646
if self._attribute_name not in _all_attr:
47-
raise ValueError(
48-
f"Attribute '{self._attribute_name}' not in the tiledb schema."
49-
)
47+
raise ValueError(f"Attribute '{self._attribute_name}' not in the tiledb schema.")
5048

5149
_attr_schema = _schema.attr(self._attribute_name)
5250
self._dtype = _attr_schema.dtype
@@ -166,15 +164,11 @@ def _extract_array(x: TileDbArraySeed, subset: Tuple[Sequence[int], ...]):
166164
_parsed_subset,
167165
)
168166

169-
return (len(_first_subset), len(_second_subset)), numpy.array(
170-
_data[x._attribute_name]
171-
)
167+
return (len(_first_subset), len(_second_subset)), numpy.array(_data[x._attribute_name])
172168

173169

174170
@extract_dense_array.register
175-
def extract_dense_array_TileDbArraySeed(
176-
x: TileDbArraySeed, subset: Tuple[Sequence[int], ...]
177-
) -> numpy.ndarray:
171+
def extract_dense_array_TileDbArraySeed(x: TileDbArraySeed, subset: Tuple[Sequence[int], ...]) -> numpy.ndarray:
178172
"""See :py:meth:`~delayedarray.extract_dense_array.extract_dense_array`.
179173
180174
Subset parameter is passed to tiledb's
@@ -184,9 +178,7 @@ def extract_dense_array_TileDbArraySeed(
184178
return _output
185179

186180

187-
def _SparseNdarray_contents_from_coordinates(
188-
rows, cols, vals, shape, val_dtype, parsed_subset
189-
):
181+
def _SparseNdarray_contents_from_coordinates(rows, cols, vals, shape, val_dtype, parsed_subset):
190182
output = [None] * shape[-1]
191183
for i, val in enumerate(vals):
192184
_offset_col = parsed_subset[1].index(cols[i])
@@ -214,9 +206,7 @@ def _SparseNdarray_contents_from_coordinates(
214206

215207

216208
@extract_sparse_array.register
217-
def extract_sparse_array_TileDbArraySeed(
218-
x: TileDbArraySeed, subset: Tuple[Sequence[int], ...]
219-
) -> SparseNdarray:
209+
def extract_sparse_array_TileDbArraySeed(x: TileDbArraySeed, subset: Tuple[Sequence[int], ...]) -> SparseNdarray:
220210
"""See :py:meth:`~delayedarray.extract_sparse_array.extract_sparse_array`.
221211
222212
Subset parameter is passed to tiledb's
@@ -233,9 +223,7 @@ def extract_sparse_array_TileDbArraySeed(
233223
_output[3],
234224
)
235225

236-
return SparseNdarray(
237-
shape=_subset_shape, contents=_content, dtype=x._dtype, index_dtype=numpy.int32
238-
)
226+
return SparseNdarray(shape=_subset_shape, contents=_content, dtype=x._dtype, index_dtype=numpy.int32)
239227

240228

241229
class TileDbArray(DelayedArray):

0 commit comments

Comments
 (0)