From 27cf34c75d9f61822ec67e88c2f63f9f2b5d34c1 Mon Sep 17 00:00:00 2001 From: Markus Binsteiner Date: Wed, 18 Dec 2024 14:57:57 +0100 Subject: [PATCH] chore: sync project template --- .cruft.json | 2 +- .github/workflows/build-darwin.yaml | 2 +- .github/workflows/build-linux.yaml | 10 ++-- .github/workflows/build-windows.yaml | 2 +- .pre-commit-config.yaml | 21 ++----- pyproject.toml | 87 +++++++++++++--------------- 6 files changed, 53 insertions(+), 71 deletions(-) diff --git a/.cruft.json b/.cruft.json index 0479d4a..e1ae905 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/DHARPA-Project/kiara_plugin.develop.git", - "commit": "8aa22f1d306a334a38b4a7c35aea3481622860aa", + "commit": "de71bdfbfb07e024811fd65146dd75aa6f34a34e", "checkout": null, "context": { "cookiecutter": { diff --git a/.github/workflows/build-darwin.yaml b/.github/workflows/build-darwin.yaml index ef40b91..0f2c6e5 100644 --- a/.github/workflows/build-darwin.yaml +++ b/.github/workflows/build-darwin.yaml @@ -11,7 +11,7 @@ jobs: runs-on: macos-14 strategy: matrix: - python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python_version: ["3.9", "3.10", "3.11", "3.12"] steps: - name: "Set up Python ${{ matrix.python_version }}" uses: actions/setup-python@v5 diff --git a/.github/workflows/build-linux.yaml b/.github/workflows/build-linux.yaml index d505eb3..19beaa2 100644 --- a/.github/workflows/build-linux.yaml +++ b/.github/workflows/build-linux.yaml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - name: "Set up Python ${{ matrix.python_version }}" uses: actions/setup-python@v5 @@ -71,7 +71,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - name: "Set up Python ${{ matrix.python_version }}" uses: actions/setup-python@v5 @@ -174,7 +174,7 @@ jobs: with: fetch-depth: 0 - name: install kiara_plugin.develop - run: pip install kiara_plugin.develop + run: pip install -U git+https://github.com/DHARPA-project/kiara_plugin.develop@develop - name: build conda package run: kiara build conda pkg --channel dharpa --channel conda-forge --patch-data ci/conda/conda-pkg-patch.yaml --output-folder build-dir . - name: upload artifacts @@ -184,7 +184,7 @@ jobs: path: build-dir/ release_conda_package: - name: publish python package to anaconda + name: publish conda package to anaconda if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') runs-on: ubuntu-latest needs: @@ -212,7 +212,7 @@ jobs: name: conda-pkgs path: build-dir/ - name: release conda package - run: kiara build conda publish --user dharpa --channel dharpa --token ${{ secrets.ANACONDA_PUSH_TOKEN }} build-dir + run: kiara build conda publish --user dharpa --channel main --token ${{ secrets.ANACONDA_PUSH_TOKEN }} build-dir merge_tag_to_main: name: merge current tag to main branch diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index f8abc4d..b2febc6 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -8,7 +8,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python_version: ["3.9", "3.10", "3.11", "3.12"] steps: - name: "Set up Python ${{ matrix.python_version }}" uses: actions/setup-python@v5 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 940b50e..85de02e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,19 +4,14 @@ default_language_version: repos: - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - rev: 'v9.15.0' + rev: 'v9.20.0' hooks: - id: commitlint stages: [commit-msg] additional_dependencies: ['@commitlint/config-conventional'] -- repo: https://github.com/psf/black - rev: 24.3.0 - hooks: - - id: black - - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.9.0' # Use the sha / tag you want to point at + rev: 'v1.13.0' # Use the sha / tag you want to point at hooks: - id: mypy files: "^src/" @@ -26,21 +21,15 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.4.1 + rev: v0.8.3 hooks: - # Run the linter. - id: ruff args: [ --fix ] # Run the formatter. - #- id: ruff-format - -- repo: https://github.com/Kludex/no-optional - rev: 0.4.0 - hooks: - - id: no_optional +# - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 'v4.5.0' + rev: 'v4.6.0' hooks: - id: trailing-whitespace exclude: 'setup.cfg' diff --git a/pyproject.toml b/pyproject.toml index 28c22a4..777d066 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ authors = [ {name = "Markus Binsteiner", email = "markus@frkl.io"} ] readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" keywords = ["kiara"] license = {text = "MPL-2.0"} classifiers = [ @@ -40,15 +40,14 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "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" ] dependencies = [ - "kiara>=0.5.11,<0.6.0", - "kiara_plugin.core_types>=0.5.1,<0.6.0", + "kiara>=0.5.13,<0.6.0", + "kiara_plugin.core_types>=0.5.2,<0.6.0", "httpx>=0.23.0", "pyzenodo3>=1.0.2", "PyGithub>=1.58.0", @@ -148,32 +147,9 @@ line-length = 88 src = ["src", "tests"] -select = [ - "E", - "F", - "RUF", - "I001", - "YTT", - "S", - "C4", - "T10", - "ISC", - "ICN", - "T20", - "Q", - "TID", - "PD", - "PLC", - "PLE", - "PLR", - "PLW", - "PIE", -] -ignore = ["E501", "S101", "SIM118", "SIM108", "PLR2004", "PLR0913", "S110", "PLR0912", "PLR0915", "PIE810"] - fix = true -fixable = ["E", "F", "RUF100", "I001", "Q"] +# Exclude a variety of commonly ignored directories. exclude = [ ".bzr", ".direnv", @@ -194,35 +170,52 @@ exclude = [ "dist", "node_modules", "venv", + "docs", + ".venv" ] -per-file-ignores = { } - -# Allow unused variables when underscore-prefixed. -dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" # Assume Python 3.10. target-version = "py310" -[tool.ruff.mccabe] -# Unlike Flake8, default to a complexity level of 10. -max-complexity = 10 +[tool.ruff.lint] +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" +fixable = ["E", "F", "RUF100", "I001", "Q", "D"] -[tool.ruff.isort] -known-first-party = ["kiara", "kiara_plugin"] +select = [ + "E", + "F", + "RUF", + "I001", + "YTT", + "S", + "C4", + "T10", + "ISC", + "ICN", + "T20", + "Q", + "TID", + "PD", + "PLC", + "PLE", + "PLR", + "PLW", + "PIE", +] -[tool.ruff.pydocstyle] -convention = "google" +ignore = ["E501", "S101", "SIM118", "SIM108", "PLR2004", "PLR0913", "S110", "PIE810", "PLR0911", "PLR0915", "PLR0912", "D", "D401", "PLW0603", "PLR5501", "PLW2901", "S603", "S608", "ISC001", "PLC0206", "RUF022"] +per-file-ignores = { } -[tool.pyright] -include = ["src"] -exclude = ["**/__pycache__"] -ignore = [] +[tool.ruff.lint.isort] +known-first-party = ["kiara", "kiara_plugin"] -reportMissingImports = true -reportMissingTypeStubs = false -executionEnvironments = [ -] +[tool.ruff.lint.mccabe] +# Unlike Flake8, default to a complexity level of 10. +max-complexity = 10 + +[tool.ruff.lint.pydocstyle] +convention = "google" [tool.mypy] python_version = "3.9"