From 77bc4b2166a9a5e585d9e376a9c6db6597146eb2 Mon Sep 17 00:00:00 2001 From: Jacob Alheid Date: Sun, 8 Jun 2025 16:23:34 -0700 Subject: [PATCH 1/3] chore(pre-commit): updated all hooks to latest --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 87be281..45720df 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,18 +1,18 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v5.0.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - rev: v9.0.0 + rev: v9.22.0 hooks: - id: commitlint stages: [commit-msg] additional_dependencies: ["@open-turo/commitlint-config-conventional"] - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 + rev: v4.0.0-alpha.8 hooks: - id: prettier stages: [pre-commit] @@ -26,13 +26,13 @@ repos: # - id: shellcheck # - id: shfmt - repo: https://github.com/DavidAnson/markdownlint-cli2 - rev: v0.11.0 + rev: v0.18.1 hooks: - id: markdownlint-cli2 args: ["--fix", ".cursorrules"] - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.1.4 + rev: v0.11.13 hooks: # Run the Ruff linter. - id: ruff From 5a7cd6067ba6613f3de0eb8ed6f139548f3e802d Mon Sep 17 00:00:00 2001 From: Jacob Alheid Date: Sun, 8 Jun 2025 16:26:06 -0700 Subject: [PATCH 2/3] ci(readthedocs): fix dependency installs --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index b972c59..3ffcc21 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -17,7 +17,7 @@ build: create_environment: - uv venv "${READTHEDOCS_VIRTUALENV_PATH}" install: - - UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs + - UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --all-extras # Build documentation in the "docs/" directory with Sphinx sphinx: From 6bfa52f708b71e8bc5e7befbba3ce788271203fd Mon Sep 17 00:00:00 2001 From: Jacob Alheid Date: Sun, 8 Jun 2025 16:27:14 -0700 Subject: [PATCH 3/3] chore(lint): updated formatting to make ruff happy --- pytool/__init__.py | 21 +++++++++++---------- pytool/json.py | 1 + pytool/lang.py | 1 + pytool/time.py | 1 + tests/test_text.py | 4 ++-- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/pytool/__init__.py b/pytool/__init__.py index 57718eb..c943317 100644 --- a/pytool/__init__.py +++ b/pytool/__init__.py @@ -1,19 +1,20 @@ """ - Copyright 2012 Jacob Alheid +Copyright 2012 Jacob Alheid - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ + from pytool import ( cmd, json, diff --git a/pytool/json.py b/pytool/json.py index fb76b24..980aaf6 100644 --- a/pytool/json.py +++ b/pytool/json.py @@ -8,6 +8,7 @@ into JSON automatically. """ + from datetime import datetime import simplejson as json diff --git a/pytool/lang.py b/pytool/lang.py index 8bebde6..fc67ca5 100644 --- a/pytool/lang.py +++ b/pytool/lang.py @@ -2,6 +2,7 @@ This module contains items that are "missing" from the Python standard library, that do miscelleneous things. """ + import copy import functools import inspect diff --git a/pytool/time.py b/pytool/time.py index 45e4ea8..842320c 100644 --- a/pytool/time.py +++ b/pytool/time.py @@ -1,6 +1,7 @@ """ This module contains time related things that make life easier. """ + # The regular 'import time' fails, because for some insane reason, Python lets # a module import itself. This is a work around to import the non-relative # module. diff --git a/tests/test_text.py b/tests/test_text.py index 69f778e..4abef80 100644 --- a/tests/test_text.py +++ b/tests/test_text.py @@ -1,6 +1,7 @@ """ Tests for pytool.text. """ + import pytool @@ -58,6 +59,5 @@ def test_wrap_preserves_first_line_whitespace(): text = pytool.text.wrap(text, width=70) assert text == ( - "This tool is used for managing all the " - "splits in dev, test and\nproduction.\n" + "This tool is used for managing all the splits in dev, test and\nproduction.\n" )