Skip to content

Commit

Permalink
support latest python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
hofbi committed Nov 4, 2024
1 parent ee9f888 commit 921e82e
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 49 deletions.
11 changes: 0 additions & 11 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,3 @@ extend-ignore =
E203,
# W503: Ignore "line break before binary operator" because it conflicts with black
W503

# Flake8 config for Jupyter notebooks
[flake8_nb]
max-line-length = 120

extend-ignore =
# E203: Ignore "whitespace before ':'" because it conflicts with black
E203,
# W503: Ignore "line break before binary operator" because it conflicts with black
W503,
E402
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ jobs:
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Pages (Docs and Coverage)
run: make pages
- name: Deploy Docs
uses: JamesIves/github-pages-deploy-action@v4.4.0
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: site
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
31 changes: 12 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
rev: 0.7.18
hooks:
- id: mdformat
additional_dependencies:
Expand Down Expand Up @@ -74,16 +74,17 @@ repos:
- id: yamllint
args: [--strict]
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
rev: 1.19.1
hooks:
- id: blacken-docs
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
# Use tag > v1.7.5 if available
rev: eb1df347edd128b30cd3368dddc3aa65edcfac38
hooks:
- id: docformatter
additional_dependencies: [tomli]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.7.2
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
Expand All @@ -101,37 +102,29 @@ repos:
hooks:
- id: pylint
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py38-plus]
args: [--py39-plus]
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
rev: 0.8.0
hooks:
- id: nbstripout
- repo: https://github.com/s-weigand/flake8-nb
rev: v0.5.3
hooks:
- id: flake8-nb
args:
- --config
- .flake8
additional_dependencies:
- flake8-bugbear # Not fully implemented by ruff
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.7
hooks:
- id: nbqa-ruff
- id: nbqa-pyupgrade
args:
- --py38-plus
- --py39-plus
- id: nbqa-pylint
args: [--rcfile=.pylintrc-nb.ini]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.3
rev: 0.29.4
hooks:
- id: check-github-workflows
- repo: https://github.com/crate-ci/typos
rev: v1.26.0
rev: v1.27.0
hooks:
- id: typos
exclude_types:
Expand Down
2 changes: 0 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Installation

`vibromaf` is compatible with Python 3.8+.

Use `pip` to install the latest stable version of `vibromaf` from [PyPI](https://pypi.org/project/vibromaf):

```shell
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ disable = [

[tool.ruff]
fix = true
target-version = "py38"
target-version = "py39"

[tool.ruff.lint]
select = ["ALL"]
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
],
package_data={
"models": ["model/*"],
},
packages=setuptools.find_packages(include=["vibromaf.*"]),
py_modules=["vibromaf.*"],
python_requires=">=3.7",
python_requires=">=3.9",
)
5 changes: 2 additions & 3 deletions vibromaf/util/matlab.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Utility functions for MATLAB files."""

from pathlib import Path
from typing import List, Tuple

import numpy as np
from scipy import io
Expand All @@ -19,8 +18,8 @@ def load_signal_from_mat(mat_file: Path, signal_name: str) -> np.array:


def load_data_for_metric(
metric: str, test_indices: List[int]
) -> Tuple[np.array, np.array]:
metric: str, test_indices: list[int]
) -> tuple[np.array, np.array]:
"""Load and concatenate the training and test data."""
vcpwq = load_signal_from_mat(
config.DATA_PATH / f"{metric}_VCPWQ.mat", f"{metric}_VCPWQ"
Expand Down

0 comments on commit 921e82e

Please sign in to comment.