Skip to content

Commit

Permalink
Merge pull request #328 from MC-kit/devel
Browse files Browse the repository at this point in the history
enable python3.13
  • Loading branch information
dvp2015 authored Oct 28, 2024
2 parents f4e3a12 + 2b4143c commit ad939ba
Show file tree
Hide file tree
Showing 31 changed files with 3,034 additions and 2,594 deletions.
88 changes: 0 additions & 88 deletions .flake8

This file was deleted.

16 changes: 8 additions & 8 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Create Repository Labels

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
Expand All @@ -10,30 +14,26 @@ on:
- .github/labels.yml
- .github/workflows/labeler.yml
pull_request:
branches:
- main
- master
- devel
paths:
- .github/labels.yaml
- .github/workflows/labeler.yml
schedule:
- cron: "0 0 * * TUE"

jobs:
labels:
labeler:
name: Sycnchronize repository labels
runs-on: ubuntu-latest
steps:
- name: Check out the repository
- name: Checkout
uses: actions/checkout@v4

- name: Sync GitHub Issue Labels
- name: Run labeler
uses: crazy-max/ghaction-github-labeler@v5
with:
github-token: ${{ secrets.MCKIT_GITHUB_TOKEN }}
skip-delete: true
dry-run: ${{ github.event_name != 'pull_request' }}
dry-run: ${{ github.event_name == 'pull_request' }}
exclude: |
help*
*issue
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Release

env:
PYTHON_VERSION: '3.11'
PYTHON_VERSION: '3.13'

on:
workflow_dispatch:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ concurrency:
cancel-in-progress: true

env:
DEFAULT_PYTHON: "3.12"
DEFAULT_PYTHON: "3.13"

jobs:

Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
python-version: [ '3.10', '3.11', '3.12' ]
python-version: [ '3.10', '3.11', '3.12', '3.13' ]

steps:

Expand Down Expand Up @@ -191,6 +191,8 @@ jobs:
with:
name: coverage-data-${{ runner.os }}-${{ matrix.python-version }}
path: ".coverage.*"
include-hidden-files: true
if-no-files-found: error

coverage:
runs-on: ubuntu-latest
Expand Down
74 changes: 46 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@
# https://github.com/pre-commit/pre-commit for more information
# https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.12
python: python3.13

repos:

# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
rev: "v5.0.0"
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
exclude: notebooks
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
exclude: notebooks # jupytext creates python scripts with shebangs but without permissions
Expand All @@ -37,19 +39,28 @@ repos:
- id: end-of-file-fixer
exclude: data|.ipynb$|^\.
- id: name-tests-test
exclude: common.py|help*.*py
args:
- --pytest-test-first
- id: mixed-line-ending
- id: pretty-format-json
args: [--autofix, --no-ensure-ascii, --no-sort-keys]
exclude: data|\.ipynb$
- id: requirements-txt-fixer
- id: trailing-whitespace
exclude: data|.ipynb$
exclude: data|\.ipynb$

# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: "v1.5.4"
rev: "v1.5.5"
hooks:
- id: remove-tabs

- repo: https://github.com/pre-commit/pre-commit
rev: v4.0.1
hooks:
- id: validate_manifest

# Format doc strings
- repo: https://github.com/DanielNoord/pydocstringformatter
rev: "v0.7.3"
Expand All @@ -68,33 +79,30 @@ repos:
- --py310-plus
language: system
types: [ python ]
stages: [ manual ]

# Security check
- id: bandit
name: bandit
entry: bandit
args: ["-c", "pyproject.toml"]
language: system
types: [ python ]
exclude: ^notebooks|^extern
stages: [ manual ]
# # Format Python code
# - id: ruff
# name: ruff-format
# entry: ruff format --force-exclude --config pyproject.toml
# language: system
# types: [ python ]
# exclude: ^notebooks|^extern
#
# # Lint and fix Python code (including import sort)
# - id: ruff
# name: ruff
# entry: ruff check --force-exclude --fix --config pyproject.toml
# language: system
# types: [ python ]
# exclude: ^notebooks|^extern

# Lint and fix Python code (including import sort)
- id: ruff
name: ruff
entry: ruff check --force-exclude --fix --config pyproject.toml
language: system
types: [ python ]
exclude: ^notebooks|^extern

# Format Python code
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
hooks:
- id: ruff
name: ruff-format
entry: ruff format --force-exclude --config pyproject.toml
language: system
types: [ python ]
exclude: ^notebooks|^extern
- id: ruff-format
exclude: ^notebooks|^extern|ipynb$


# CMake formatting
Expand All @@ -113,9 +121,19 @@ repos:
- id: clang-format
types_or: [ c++, c, cuda ]

- repo: https://github.com/python-poetry/poetry
rev: "1.8.0"
hooks:
- id: poetry-check
- id: poetry-lock
stages: [ manual ]
- id: poetry-install
stages: [ manual ]

# Check for common shell mistakes
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.9.0.6"
rev: "v0.10.0.1"
hooks:
- id: shellcheck
args: [ --external-sources ]
stages: [ manual ]
13 changes: 3 additions & 10 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

nox.options.sessions = (
"pre-commit",
"ruff-format",
"ruff",
"tests",
"docs-build",
Expand Down Expand Up @@ -58,8 +59,8 @@ def find_my_name() -> str:
package: Final[str] = find_my_name()
locations: Final[tuple[str, ...]] = f"src/{package}", "tests", "./noxfile.py", "docs/source/conf.py"

supported_pythons: Final[tuple[str, ...]] = "3.10", "3.11", "3.12"
default_python: Final[str] = "3.12"
supported_pythons: Final[tuple[str, ...]] = "3.10", "3.11", "3.12", "3.13"
default_python: Final[str] = "3.13"


def _update_hook(hook: Path, virtualenv: str, s: Session) -> None:
Expand Down Expand Up @@ -150,14 +151,6 @@ def typeguard(s: Session) -> None:
s.run("pytest", "--typeguard-packages=src", *s.posargs, external=True)


@session
def lint(s: Session) -> None:
"""Lint using flake8."""
s.run("poetry", "install", "--no-root", "--only", "flake8", external=True)
args = s.posargs or locations
s.run("flake8", *args)


@session
def mypy(s: Session) -> None:
"""Type-check using mypy."""
Expand Down
Loading

0 comments on commit ad939ba

Please sign in to comment.