From cf37a19aaacffb23a5101e0854a8b5b7f8a50a7a Mon Sep 17 00:00:00 2001 From: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> Date: Fri, 27 Dec 2024 20:14:57 +0200 Subject: [PATCH 1/2] Update workflows, configs, and dependencies Switched Dependabot update schedule to daily and added MyPy to code-checks. Upgraded pre-commit hooks and adjusted their configurations. Introduced new Makefile targets, including `update`, and updated `install` logic for better dependency management. Signed-off-by: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> --- .github/dependabot.yml | 2 +- .github/workflows/ci.yml | 4 ++-- .github/workflows/code-checks.yml | 1 + .pre-commit-config.yaml | 10 +++++----- Makefile | 14 +++++++++++--- pyproject.toml | 8 ++++---- uv.lock | 2 +- 7 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 32a1031..91648e8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,4 +12,4 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: weekly + interval: daily diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d6048b..a0b370f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,11 +2,11 @@ name: CI on: pull_request: paths: - - 'my_pkg/**' + - 'my_pkg/**' # todo: change to your package name - 'tests/**' - '.github/workflows/ci.yml' - 'pyproject.toml' - - 'poetry.lock' + - 'uv.lock' workflow_dispatch: jobs: tests: diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index ec00620..4cae12f 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -16,3 +16,4 @@ jobs: - run: uv python install 3.11 - run: make - run: make check + - run: make mypy diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9fc4ec0..dd7b7df 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,20 +1,20 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v5.0.0 hooks: - id: debug-statements - id: end-of-file-fixer - id: trailing-whitespace - id: no-commit-to-branch - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.4 + rev: v0.8.4 hooks: - id: ruff-format - args: [ --preview ] + args: [ --preview, --config=pyproject.toml ] - id: ruff - args: [ --preview, --fix] + args: [ --preview, --fix,--unsafe-fixes, --config=pyproject.toml ] - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.5.4 + rev: 0.5.13 hooks: - id: uv-lock diff --git a/Makefile b/Makefile index 6a45b45..a068277 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,16 @@ .PHONY: help +.PHONY: default +default: install + install: - uv sync --all-extras --frozen + uv sync --all-extras --all-groups --frozen uv tool install pre-commit --with pre-commit-uv --force-reinstall -.PHONY: default -default: install +update: + uv lock + uvx pre-commit autoupdate + $(MAKE) install test: uv run pytest @@ -15,3 +20,6 @@ check: coverage: uv run pytest --cov=ml_orchestrator --cov-report=xml + +mypy: + uv tool run mypy . --config-file pyproject.toml diff --git a/pyproject.toml b/pyproject.toml index e398a8f..8871123 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,9 @@ [project] -name = "my-pkg" +name = "my-pkg" # todo: change to your package name dynamic = ["version"] description = "" authors = [ - {name = "DanielAvdar", email = "66269169+DanielAvdar@users.noreply.github.com"}, + {name = "DanielAvdar", email = "66269169+DanielAvdar@users.noreply.github.com"}, # todo: change to your name and email ] license = {text = "MIT"} readme = "README.md" @@ -27,11 +27,11 @@ dev = [ ] [tool.hatch.build.targets.sdist] -only-include = ["my_pkg",] +only-include = ["my_pkg",] # todo: change to your package name source = "." [tool.hatch.build.targets.wheel] -only-include = ["my_pkg",] +only-include = ["my_pkg",] # todo: change to your package name source = "." diff --git a/uv.lock b/uv.lock index 6485658..940bb5c 100644 --- a/uv.lock +++ b/uv.lock @@ -169,7 +169,7 @@ wheels = [ [[package]] name = "my-pkg" -version = "0.0.0.post16.dev0+19e05be" +version = "0.0.0.post21.dev0+aa35205" source = { editable = "." } [package.dev-dependencies] From 35970b346888aa401fb58f20e3fe65bc653ffb27 Mon Sep 17 00:00:00 2001 From: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> Date: Fri, 27 Dec 2024 20:16:10 +0200 Subject: [PATCH 2/2] Update package version and remove unused isort config Bumped the version of "my-pkg" in uv.lock to the latest dev version. Removed an unused `section-order` setting from the isort configuration in pyproject.toml to streamline configuration. Signed-off-by: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> --- pyproject.toml | 1 - uv.lock | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8871123..930f0b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,6 @@ fixable = ["ALL"] [tool.ruff.lint.isort] combine-as-imports = true -section-order = ["future", "standard-library", "first-party", "local-folder", "third-party"] [tool.mypy] python_version = "3.11" disallow_untyped_defs = true diff --git a/uv.lock b/uv.lock index 940bb5c..3642be9 100644 --- a/uv.lock +++ b/uv.lock @@ -169,7 +169,7 @@ wheels = [ [[package]] name = "my-pkg" -version = "0.0.0.post21.dev0+aa35205" +version = "0.0.0.post22.dev0+cf37a19" source = { editable = "." } [package.dev-dependencies]