Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 Test on Python 3.13 and update pre-commit hooks #82

Merged
merged 2 commits into from
Oct 9, 2024
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
10 changes: 4 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,14 +31,12 @@ jobs:
- name: Pip cache
uses: actions/cache@v4
with:
save-always: true
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements/*.txt') }}

- name: Pre-commit cache
uses: actions/cache@v4
with:
save-always: true
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ matrix.python-version }}-${{ hashFiles('**/requirements/ci.txt') }}-${{ hashFiles('.pre-commit-config.yaml')
}}
Expand All @@ -49,14 +47,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
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
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]
- id: ruff-format

# 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]
Expand All @@ -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:
Expand All @@ -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]
Expand All @@ -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
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Expand Down
1 change: 1 addition & 0 deletions src/mapply/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/mapply/mapply.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

df["squared"] = mapply(df.A, lambda x: x ** 2, progressbar=False)
"""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions src/mapply/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def some_heavy_computation(x, power):
)
)
"""

from __future__ import annotations

import logging
Expand Down
3 changes: 2 additions & 1 deletion tests/test_mapply.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
1 change: 1 addition & 0 deletions tests/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause
import pytest

from mapply.parallel import multiprocessing_imap


Expand Down