diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f958947..41f6432 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,12 +11,12 @@ concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72 jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 permissions: id-token: write # codecov/codecov-action strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 @@ -49,14 +49,14 @@ jobs: make install - name: Lint - if: matrix.python-version == 3.12 + if: matrix.python-version == '3.13' run: make lint - name: Test run: make test - name: Docs - if: matrix.python-version == 3.12 + if: matrix.python-version == '3.13' run: SPHINXOPTS=-W make builddocs - uses: codecov/codecov-action@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4e587ec..d498cd4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.2 + rev: v0.6.9 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -9,13 +9,13 @@ repos: # should be replaced in the future ref https://github.com/astral-sh/ruff/issues/458 - repo: https://github.com/jsh9/pydoclint - rev: 0.4.1 + rev: 0.5.9 hooks: - id: pydoclint - repo: https://github.com/Yelp/detect-secrets # for new repo init run: `detect-secrets scan > .secrets.baseline` - rev: v1.4.0 + rev: v1.5.0 hooks: - id: detect-secrets args: [--baseline, .secrets.baseline] @@ -24,10 +24,10 @@ repos: # should be replaced in the future ref https://github.com/astral-sh/ruff/issues/3792 - repo: https://github.com/asottile/blacken-docs - rev: 1.16.0 + rev: 1.19.0 hooks: - id: blacken-docs - additional_dependencies: [black==24.2.0] + additional_dependencies: [black==24.10.0] - repo: local hooks: @@ -51,7 +51,7 @@ repos: args: [--mapping=2, --sequence=2, --offset=0] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: mixed-line-ending args: [--fix=lf] @@ -66,7 +66,7 @@ repos: - id: debug-statements - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.28.0 + rev: 0.29.3 hooks: - id: check-dependabot - id: check-github-workflows diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 2f9a218..ee889bd 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -8,7 +8,7 @@ version: 2 # Set the OS, Python version and other tools you might need build: - os: ubuntu-22.04 + os: ubuntu-24.04 tools: python: '3.12' diff --git a/pyproject.toml b/pyproject.toml index 3577df3..15a6011 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ] diff --git a/src/mapply/__init__.py b/src/mapply/__init__.py index 6269378..41013ee 100644 --- a/src/mapply/__init__.py +++ b/src/mapply/__init__.py @@ -49,6 +49,7 @@ df["squared"] = df.A.mapply(lambda x: x ** 2) """ + import contextlib from functools import partialmethod from importlib.metadata import PackageNotFoundError, version diff --git a/src/mapply/mapply.py b/src/mapply/mapply.py index 13107e1..9767d05 100644 --- a/src/mapply/mapply.py +++ b/src/mapply/mapply.py @@ -42,6 +42,7 @@ df["squared"] = mapply(df.A, lambda x: x ** 2, progressbar=False) """ + from __future__ import annotations import warnings diff --git a/src/mapply/parallel.py b/src/mapply/parallel.py index 171bccc..f519343 100644 --- a/src/mapply/parallel.py +++ b/src/mapply/parallel.py @@ -50,6 +50,7 @@ def some_heavy_computation(x, power): ) ) """ + from __future__ import annotations import logging diff --git a/tests/test_mapply.py b/tests/test_mapply.py index 2a851f2..5006997 100644 --- a/tests/test_mapply.py +++ b/tests/test_mapply.py @@ -30,11 +30,12 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # SPDX-License-Identifier: BSD-3-Clause -import mapply import numpy as np import pandas as pd import pytest +import mapply + def test_df_mapply(): """Assert DataFrame behaviour is equivalent.""" diff --git a/tests/test_parallel.py b/tests/test_parallel.py index 5fb0257..5719fa0 100644 --- a/tests/test_parallel.py +++ b/tests/test_parallel.py @@ -31,6 +31,7 @@ # # SPDX-License-Identifier: BSD-3-Clause import pytest + from mapply.parallel import multiprocessing_imap