From b36383b8d1275aab39e008f21d69ac0f5f0be32b Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Wed, 21 Jan 2026 06:56:59 +0900 Subject: [PATCH 1/6] 2026-01-21 06:56:59 (Wed) > DW-Mac > derekwan From 9a2b605ae1ca5fc90300081ca58baa4574e7c4fb Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Wed, 21 Jan 2026 07:27:56 +0900 Subject: [PATCH 2/6] 2026-01-21 07:27:56 (Wed) > DW-Mac > derekwan --- .bumpversion.toml | 2 +- .gitattributes | 2 + .github/workflows/pull-request.yaml | 14 +- .github/workflows/push.yaml | 15 +- .gitignore | 1 - .pre-commit-config.yaml | 243 +++++++++++++++------------- pyproject.toml | 16 +- pytest.toml | 2 + src/utilities/__init__.py | 2 +- uv.lock | 10 +- 10 files changed, 165 insertions(+), 142 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 8a38a1a7d5..142a0f2179 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,6 +1,6 @@ [tool.bumpversion] allow_dirty = true - current_version = "0.184.4" + current_version = "0.184.5" [[tool.bumpversion.files]] filename = "pyproject.toml" diff --git a/.gitattributes b/.gitattributes index 7fc0b6024a..c4599dea4d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,3 @@ src/utilities/__init__.py linguist-generated=true + +.bumpversion.toml linguist-generated=true diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index b3631d76f2..e02f40a595 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -1,5 +1,5 @@ name: pull-request -on: +"on": pull_request: branches: - master @@ -16,15 +16,9 @@ jobs: pytest: env: CI: "1" - name: pytest (${{matrix.os}}, ${{matrix.python-version}}, - ${{matrix.resolution}}) - runs-on: ${{matrix.os}} - services: - redis: - image: ${{ matrix.os == 'ubuntu-latest' && 'redis/redis-stack:latest' || - '' }} - ports: - - 6379:6379 + name: pytest (${{matrix.os}}, ${{matrix.python-version}}, ${{matrix.resolution}}) + runs-on: + - ${{matrix.os}} steps: - name: Run 'pytest' uses: dycw/action-pytest@latest diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index c13711f00d..e4f2dba079 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -1,10 +1,15 @@ name: push -on: +"on": push: branches: - master jobs: - publish-github: + tag: + runs-on: ubuntu-latest + steps: + - name: Tag the latest commit + uses: dycw/action-tag-commit@latest + publish: environment: name: pypi permissions: @@ -13,8 +18,4 @@ jobs: steps: - name: Build and publish the package uses: dycw/action-publish-package@latest - tag: - runs-on: ubuntu-latest - steps: - - name: Tag the latest commit - uses: dycw/action-tag-commit@latest + with: {} diff --git a/.gitignore b/.gitignore index 3bad797a60..cf79c5f0cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ #### STANDARD GITIGNORE ####################################################### - # Byte-compiled / optimized / DLL files __pycache__/ *.py[codz] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b79fbdb800..09b0365245 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,80 +1,120 @@ repos: - - repo: https://github.com/dycw/actions - rev: 0.15.8 + - repo: https://github.com/dycw/pre-commit-hooks + rev: 0.14.102 hooks: - - args: - - --ci--pull-request--pyright - - --ci--pull-request--pytest--all-versions - - --ci--pull-request--pytest--macos - - --ci--pull-request--pytest--ubuntu - - --ci--pull-request--ruff - - --ci--push--publish--github - - --ci--push--tag - # - --coverage + - id: add-hooks + args: + - --ci-github - --description=Miscellaneous Python utilities - - --envrc - - --envrc--uv - - --gitignore - - --package-name=dycw-utilities - - --pre-commit--prettier - - --pre-commit--python - - --pre-commit--ruff - - --pre-commit--shell - - --pre-commit--taplo - - --pre-commit--uv - - --pyproject - - --pyright - - --pytest - - --pytest--asyncio - - --pytest--timeout=600 - - --python-package-name=utilities - - --python-version=3.12 - - --readme + - --prettier + - --python + - --python-package-name-external=dycw-utilities + - --python-package-name-internal=utilities - --repo-name=python-utilities - - --ruff - id: conformalize-repo + - --shell + - --toml priority: 10 + - id: add-future-import-annotations + priority: 20 + - id: check-versions-consistent + priority: 40 + - id: format-pre-commit-config + priority: 30 - id: format-requirements + priority: 30 + - id: pin-cli-requirements + priority: 20 + - id: replace-sequence-str + priority: 20 + - id: run-prek-autoupdate priority: 10 - - id: replace-sequence-strs - priority: 10 - - id: touch-empty-py - priority: 10 - - id: touch-py-typed + - id: run-version-bump + priority: 20 + - id: setup-bump-my-version + args: + - --python-package-name-internal=utilities + priority: 20 + - id: setup-ci-pull-request + args: + - --repo-name=python-utilities + priority: 20 + - id: setup-ci-push + args: + - --python + priority: 20 + - id: setup-coverage + priority: 20 + - id: setup-direnv + args: + - --python + priority: 20 + - id: setup-git + args: + - --python + priority: 20 + - id: setup-pre-commit priority: 10 + - id: setup-pyproject + args: + - --description=Miscellaneous Python utilities + - --python-package-name-external=dycw-utilities + - --python-package-name-internal=utilities + priority: 20 + - id: setup-pyright + priority: 20 + - id: setup-pytest + args: + - --python-package-name-internal=utilities + priority: 20 + - id: setup-readme + args: + - --repo-name=python-utilities + - --description=Miscellaneous Python utilities + priority: 20 + - id: setup-ruff + priority: 20 + - id: update-ci-action-versions + priority: 20 + - id: update-ci-extensions + priority: 20 - id: update-requirements - priority: 10 - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 + priority: 20 + - repo: builtin hooks: + - id: check-added-large-files + priority: 40 + - id: check-case-conflict + priority: 40 - id: check-executables-have-shebangs + priority: 40 + - id: check-json + priority: 40 + - id: check-json5 + priority: 40 - id: check-merge-conflict + priority: 40 - id: check-symlinks - - id: destroyed-symlinks - priority: 20 + priority: 40 + - id: check-toml + priority: 40 + - id: check-xml + priority: 40 + - id: check-yaml + priority: 40 - id: detect-private-key + priority: 40 - id: end-of-file-fixer + priority: 20 + - id: fix-byte-order-marker + priority: 20 - id: mixed-line-ending args: - --fix=lf + priority: 20 - id: no-commit-to-branch - - id: pretty-format-json - args: - - --autofix - priority: 10 + priority: 40 - id: trailing-whitespace - - id: check-illegal-windows-names priority: 20 - - repo: local - hooks: - - id: prettier - name: prettier - entry: npx prettier --write - language: system - types_or: - - markdown - - yaml - priority: 10 - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.14.13 hooks: @@ -83,16 +123,17 @@ repos: - --fix priority: 20 - id: ruff-format - priority: 10 - - repo: https://github.com/scop/pre-commit-shfmt - rev: v3.12.0-2 - hooks: - - id: shfmt - priority: 10 - - repo: https://github.com/koalaman/shellcheck-precommit - rev: v0.11.0 + priority: 30 + - repo: https://github.com/astral-sh/uv-pre-commit + rev: 0.9.26 hooks: - - id: shellcheck + - id: uv-lock + args: + - --upgrade + - --resolution + - highest + - --prerelease + - disallow priority: 20 - repo: https://github.com/compwa/taplo-pre-commit rev: v0.9.3 @@ -105,51 +146,35 @@ repos: - indent_entries=true - --option - reorder_keys=true - priority: 10 - - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.9.26 + priority: 40 + - repo: https://github.com/koalaman/shellcheck-precommit + rev: v0.11.0 hooks: - - id: uv-lock - args: - - --upgrade - - --resolution - - highest - - --prerelease - - disallow - priority: 10 - - repo: builtin + - id: shellcheck + priority: 40 + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 hooks: - - id: check-added-large-files - priority: 20 - - id: check-case-conflict - priority: 20 - - id: check-executables-have-shebangs - priority: 20 - - id: check-json - priority: 20 - - id: check-json5 - priority: 20 - - id: check-merge-conflict - priority: 20 - - id: check-symlinks - priority: 20 - - id: check-toml - priority: 20 - - id: check-xml - priority: 20 - - id: check-yaml - priority: 20 - - id: detect-private-key - priority: 20 - - id: end-of-file-fixer - priority: 10 - - id: fix-byte-order-marker - priority: 10 - - id: mixed-line-ending + - id: check-illegal-windows-names + priority: 40 + - id: destroyed-symlinks + priority: 40 + - id: pretty-format-json args: - - --fix=lf - priority: 10 - - id: no-commit-to-branch + - --autofix priority: 20 - - id: trailing-whitespace - priority: 10 + - repo: https://github.com/scop/pre-commit-shfmt + rev: v3.12.0-2 + hooks: + - id: shfmt + priority: 30 + - repo: local + hooks: + - id: prettier + name: prettier + entry: npx prettier --write + language: unsupported + types_or: + - markdown + - yaml + priority: 30 diff --git a/pyproject.toml b/pyproject.toml index 3751b2a896..fd5ac11f40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ [dependency-groups] altair = ["altair>=6.0.0"] - altair-test = ["polars>=1.37.1", "img2pdf>=0.6.3", "vl-convert-python>=1.9.0"] + altair-test = ["img2pdf>=0.6.3", "polars>=1.37.1", "vl-convert-python>=1.9.0"] atools = ["atools>=0.14.2"] cachetools = ["cachetools>=6.2.4"] click = ["click>=8.3.1"] @@ -51,7 +51,7 @@ more-itertools = ["more-itertools>=10.8.0"] numpy = ["numpy>=2.4.1"] operator = ["polars>=1.37.1"] - optuna = ["optuna>=4.6.0"] + optuna = ["optuna>=4.7.0"] orjson = ["orjson>=3.11.5"] orjson-test = ["polars>=1.37.1"] packaging = ["packaging>=25.0"] @@ -69,11 +69,11 @@ pydantic-settings-test = ["pyyaml>=6.0.3", "tomlkit>=0.14.0"] pyinstrument = ["pyinstrument>=5.1.2"] pytest = [ - "pytest>=9.0.2", "pytest-asyncio>=1.3.0", "pytest-randomly>=4.0.1", "pytest-timeout>=2.4.0", "pytest-xdist>=3.8.0", + "pytest>=9.0.2", ] pytest-regressions = ["pytest-regressions>=2.9.1"] pytest-regressions-test = ["orjson>=3.11.5", "polars>=1.37.1"] @@ -82,7 +82,7 @@ "pytest-rerunfailures>=16.1", "pytest-rng>=1.0.0", ] - redis = ["redis>=7.1.0", "orjson>=3.11.5"] + redis = ["orjson>=3.11.5", "redis>=7.1.0"] redis-test = ["pytest-rerunfailures>=16.1"] reprlib-test = ["rich>=14.2.0"] scipy = ["scipy>=1.17.0"] @@ -90,8 +90,8 @@ sklearn = ["scikit-learn>=1.8.0"] slack-sdk = ["slack-sdk>=3.39.0"] slack-sdk-test = ["aiohttp>=3.13.3"] - sqlalchemy = ["sqlalchemy>=2.0.45", "psycopg>=3.3.2"] - sqlalchemy-polars = ["sqlalchemy>=2.0.45", "polars>=1.37.1"] + sqlalchemy = ["psycopg>=3.3.2", "sqlalchemy>=2.0.45"] + sqlalchemy-polars = ["polars>=1.37.1", "sqlalchemy>=2.0.45"] sqlalchemy-polars-test = [ "aiosqlite>=0.22.1", "asyncpg>=0.31.0", @@ -116,7 +116,7 @@ name = "dycw-utilities" readme = "README.md" requires-python = ">= 3.12" - version = "0.184.4" + version = "0.184.5" [project.entry-points.pytest11] pytest-randomly = "utilities.pytest_plugins.pytest_randomly" @@ -127,7 +127,6 @@ test = [ "dycw-pytest-only>=2.1.1", "hypothesis>=6.150.2", - "pytest>=9.0.2", "pytest-asyncio>=1.3.0", "pytest-cov>=7.0.0", "pytest-instafail>=0.5.0", @@ -139,6 +138,7 @@ "pytest-rng>=1.0.0", "pytest-timeout>=2.4.0", "pytest-xdist>=3.8.0", + "pytest>=9.0.2", ] [tool] diff --git a/pytest.toml b/pytest.toml index 9c2f83aa0f..552243c2c6 100644 --- a/pytest.toml +++ b/pytest.toml @@ -17,6 +17,8 @@ "error", "ignore::ResourceWarning", "ignore:Automatically deduplicated selection parameter with identical configuration:UserWarning", # altair + "ignore::DeprecationWarning", + "ignore::RuntimeWarning", ] minversion = "9.0" strict = true diff --git a/src/utilities/__init__.py b/src/utilities/__init__.py index 95aac91052..99ed12d9fe 100644 --- a/src/utilities/__init__.py +++ b/src/utilities/__init__.py @@ -1,3 +1,3 @@ from __future__ import annotations -__version__ = "0.184.4" +__version__ = "0.184.5" diff --git a/uv.lock b/uv.lock index cb43b6a735..1b94244e51 100644 --- a/uv.lock +++ b/uv.lock @@ -625,7 +625,7 @@ wheels = [ [[package]] name = "dycw-utilities" -version = "0.184.4" +version = "0.184.5" source = { editable = "." } dependencies = [ { name = "atomicwrites" }, @@ -983,7 +983,7 @@ memory-profiler = [{ name = "memory-profiler", specifier = ">=0.61.0" }] more-itertools = [{ name = "more-itertools", specifier = ">=10.8.0" }] numpy = [{ name = "numpy", specifier = ">=2.4.1" }] operator = [{ name = "polars", specifier = ">=1.37.1" }] -optuna = [{ name = "optuna", specifier = ">=4.6.0" }] +optuna = [{ name = "optuna", specifier = ">=4.7.0" }] orjson = [{ name = "orjson", specifier = ">=3.11.5" }] orjson-test = [{ name = "polars", specifier = ">=1.37.1" }] packaging = [{ name = "packaging", specifier = ">=25.0" }] @@ -2042,7 +2042,7 @@ wheels = [ [[package]] name = "optuna" -version = "4.6.0" +version = "4.7.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "alembic" }, @@ -2053,9 +2053,9 @@ dependencies = [ { name = "sqlalchemy" }, { name = "tqdm" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/6b/81/08f90f194eed78178064a9383432eca95611e2c5331e7b01e2418ce4b15a/optuna-4.6.0.tar.gz", hash = "sha256:89e38c2447c7f793a726617b8043f01e31f0bad54855040db17eb3b49404a369", size = 477444, upload-time = "2025-11-10T05:14:30.151Z" } +sdist = { url = "https://files.pythonhosted.org/packages/58/b2/b5e12de7b4486556fe2257611b55dbabf30d0300bdb031831aa943ad20e4/optuna-4.7.0.tar.gz", hash = "sha256:d91817e2079825557bd2e97de2e8c9ae260bfc99b32712502aef8a5095b2d2c0", size = 479740, upload-time = "2026-01-19T05:45:52.604Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/58/de/3d8455b08cb6312f8cc46aacdf16c71d4d881a1db4a4140fc5ef31108422/optuna-4.6.0-py3-none-any.whl", hash = "sha256:4c3a9facdef2b2dd7e3e2a8ae3697effa70fae4056fcf3425cfc6f5a40feb069", size = 404708, upload-time = "2025-11-10T05:14:28.6Z" }, + { url = "https://files.pythonhosted.org/packages/75/d1/6c8a4fbb38a9e3565f5c36b871262a85ecab3da48120af036b1e4937a15c/optuna-4.7.0-py3-none-any.whl", hash = "sha256:e41ec84018cecc10eabf28143573b1f0bde0ba56dba8151631a590ecbebc1186", size = 413894, upload-time = "2026-01-19T05:45:50.815Z" }, ] [[package]] From e4582baab6d2a20eaf85bacfd8d71d47a3c516c2 Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Wed, 21 Jan 2026 07:36:06 +0900 Subject: [PATCH 3/6] 2026-01-21 07:36:06 (Wed) > DW-Mac > derekwan --- .github/workflows/pull-request.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index e02f40a595..335ec2fe27 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -25,6 +25,12 @@ jobs: with: python-version: ${{matrix.python-version}} resolution: ${{matrix.resolution}} + services: + redis: + image: ${{ matrix.os == 'ubuntu-latest' && 'redis/redis-stack:latest' || + '' }} + ports: + - 6379:6379 strategy: fail-fast: false matrix: From d7c02fb7b9e5f8f9c45b861542220d760103a8a7 Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Wed, 21 Jan 2026 07:36:20 +0900 Subject: [PATCH 4/6] 2026-01-21 07:36:20 (Wed) > DW-Mac > derekwan --- .gitattributes | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index c4599dea4d..6ca1bff865 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,2 @@ -src/utilities/__init__.py linguist-generated=true - .bumpversion.toml linguist-generated=true +src/utilities/__init__.py linguist-generated=true From b526a18c02beba60519e2eb13a9a3c94b8a7a8e3 Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Wed, 21 Jan 2026 07:37:07 +0900 Subject: [PATCH 5/6] 2026-01-21 07:37:07 (Wed) > DW-Mac > derekwan --- .github/workflows/pull-request.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 335ec2fe27..3f5d895b60 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -19,18 +19,18 @@ jobs: name: pytest (${{matrix.os}}, ${{matrix.python-version}}, ${{matrix.resolution}}) runs-on: - ${{matrix.os}} - steps: - - name: Run 'pytest' - uses: dycw/action-pytest@latest - with: - python-version: ${{matrix.python-version}} - resolution: ${{matrix.resolution}} services: redis: image: ${{ matrix.os == 'ubuntu-latest' && 'redis/redis-stack:latest' || '' }} ports: - 6379:6379 + steps: + - name: Run 'pytest' + uses: dycw/action-pytest@latest + with: + python-version: ${{matrix.python-version}} + resolution: ${{matrix.resolution}} strategy: fail-fast: false matrix: From d72e9f6ff52bda95f97dfb1c4a864f9044373e12 Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Wed, 21 Jan 2026 09:29:38 +0900 Subject: [PATCH 6/6] 2026-01-21 09:29:38 (Wed) > DW-Mac > derekwan --- src/tests/test_throttle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/test_throttle.py b/src/tests/test_throttle.py index 451bf58dbf..f7b8b4de52 100644 --- a/src/tests/test_throttle.py +++ b/src/tests/test_throttle.py @@ -7,7 +7,7 @@ import utilities.asyncio import utilities.time -from utilities.constants import SECOND +from utilities.constants import IS_CI, SECOND from utilities.os import temp_environ from utilities.throttle import ( _ThrottleMarkerFileError, @@ -21,7 +21,7 @@ from whenever import TimeDelta -_DURATION: TimeDelta = 0.1 * SECOND +_DURATION: TimeDelta = (5 if IS_CI else 1) * 0.1 * SECOND _MULTIPLE: int = 10