From bc80e34922f5ae9a96bc8ca959b3d18ebecbe270 Mon Sep 17 00:00:00 2001 From: Robert Richer Date: Fri, 24 Nov 2023 15:58:51 +0100 Subject: [PATCH] updated ci tools --- .github/workflows/test-and-lint.yml | 2 +- hpc_helper/_hpc_helper.py | 3 +-- pyproject.toml | 2 +- .ruff.toml => ruff.toml | 36 ++++++++++++++--------------- 4 files changed, 21 insertions(+), 22 deletions(-) rename .ruff.toml => ruff.toml (76%) diff --git a/.github/workflows/test-and-lint.yml b/.github/workflows/test-and-lint.yml index d7aff1a..07f3b87 100644 --- a/.github/workflows/test-and-lint.yml +++ b/.github/workflows/test-and-lint.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v2 diff --git a/hpc_helper/_hpc_helper.py b/hpc_helper/_hpc_helper.py index af60770..78cc297 100644 --- a/hpc_helper/_hpc_helper.py +++ b/hpc_helper/_hpc_helper.py @@ -4,9 +4,8 @@ import subprocess import sys import warnings -from collections.abc import Sequence from pathlib import Path -from typing import Literal, Optional, get_args +from typing import Literal, Optional, Sequence, get_args from hpc_helper._types import path_t diff --git a/pyproject.toml b/pyproject.toml index 989b3fe..b42d340 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,6 +58,6 @@ lint = { cmd = "ruff hpc_helper --fix", help = "Lint all files with ruff." } _lint_ci = "ruff hpc_helper --output-format=github" _check_format = "ruff format . --check" ci_check = { sequence = ["_check_format", "_lint_ci"], help = "Check all potential format and linting issues." } -test = {cmd = "pytest --cov=hpc-helper --cov-report=xml", help = "Run Pytest with coverage." } +test = {cmd = "pytest --cov=hpc_helper --cov-report=xml", help = "Run Pytest with coverage." } update_version = {"script" = "_tasks:task_update_version"} default = {sequence = ["format", "lint", "test"], help = "Run the default pipeline, consisting of formatting, linting, and testing."} diff --git a/.ruff.toml b/ruff.toml similarity index 76% rename from .ruff.toml rename to ruff.toml index 03cd053..b9b340a 100644 --- a/.ruff.toml +++ b/ruff.toml @@ -1,5 +1,5 @@ line-length = 120 -target-version = "py39" +target-version = "py38" select = [ # pyflakes @@ -57,18 +57,12 @@ select = [ "TRY", # flake8-use-pathlib "PTH", - "RUF", - # Numpy rules - "NPY", - # Implicit namespace packages - "INP", - # No relative imports - "TID252", - # f-strings over string concatenation - "FLY", + "RUF" ] ignore = [ + # No explicit stacklevel keyword argument found in logging calls + "B028", # controversial "B006", # controversial @@ -80,22 +74,25 @@ ignore = [ "EM101", "EM102", "EM103", - # Exception strings - "TRY003", + # Multiline docstring summary + "D213", # Varaibles before return "RET504", # Abstract raise into inner function "TRY301", + # Avoid specifying long messages outside the exception class + "TRY003", + # Use type-checking block + "TCH001", + "TCH002", + "TCH003", + # .pivot_table is preferred to .pivot or .unstack; provides same functionality + "PD010", # df as varaible name "PD901", # melt over stack "PD013", - # No Any annotations - "ANN401", - # To many arguments - "PLR0913", - # Ignore because of formatting - "ISC001", + "ISC001" # Implicit string concatenation ] @@ -105,8 +102,11 @@ exclude = [ "doc/temp/*.py", ".eggs/*.py", "example_data", + "examples" ] +[pylint] +max-args = 15 [pydocstyle] convention = "numpy"