Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8288195
2025-12-31 21:23:17 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
c4fc170
2025-12-31 21:26:33 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
0b77fbf
2025-12-31 21:27:31 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
9806dac
2025-12-31 21:28:45 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
70c087a
2025-12-31 21:35:25 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
f5cf195
2025-12-31 21:41:09 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
c083d77
2025-12-31 21:41:59 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
02661b3
2025-12-31 21:42:13 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
48e3851
2025-12-31 21:55:00 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
16383d3
2025-12-31 21:57:20 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
cb0a061
2025-12-31 21:58:53 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
b49dc8e
2025-12-31 22:00:40 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
9eb27a7
2025-12-31 22:00:48 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
07eb87d
2025-12-31 22:01:32 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
c2a307e
2025-12-31 22:09:58 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
09fa4ee
2025-12-31 22:16:06 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
0649df0
2025-12-31 22:25:45 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
155d029
2025-12-31 22:28:19 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
1caa54f
2025-12-31 22:29:52 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
667e1b5
2025-12-31 23:43:40 (Wed) > DW-Mac > derekwan
dycw Dec 31, 2025
71e0553
2026-01-01 00:11:14 (Thu) > DW-Mac > derekwan
dycw Dec 31, 2025
c9d9c06
2026-01-01 00:11:24 (Thu) > DW-Mac > derekwan
dycw Dec 31, 2025
5b4518e
2026-01-01 00:21:55 (Thu) > DW-Mac > derekwan
dycw Dec 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[tool.bumpversion]
allow_dirty = true
current_version = "0.175.0"

[[tool.bumpversion.files]]
filename = "pyproject.toml"
replace = "version = \"{new_version}\""
search = "version = \"{current_version}\""

[[tool.bumpversion.files]]
filename = "src/utilities/__init__.py"
replace = "__version__ = \"{new_version}\""
search = "__version__ = \"{current_version}\""
38 changes: 38 additions & 0 deletions .coveragerc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[coverage_conditional_plugin]
[coverage_conditional_plugin.rules]
skipif-ci = '"CI" in os_environ'
skipif-ci-and-mac = '("CI" in os_environ) and (sys_platform == "darwin")'
skipif-ci-and-not-linux = '("CI" in os_environ) and (sys_platform != "linux")'
skipif-ci-or-mac = '("CI" in os_environ) or (sys_platform == "darwin")'
skipif-linux = 'sys_platform == "linux"'
skipif-mac = 'sys_platform == "darwin"'
skipif-not-linux = 'sys_platform != "linux"'
skipif-not-macos = 'sys_platform != "darwin"'
skipif-not-windows = 'sys_platform != "windows"'
skipif-windows = 'sys_platform == "darwin"'

[html]
directory = ".coverage/html"

[report]
exclude_also = [
"@overload",
"assert_never",
"case never:",
"if TYPE_CHECKING:",
]
fail_under = 100.0
skip_covered = true
skip_empty = true

[run]
branch = true
data_file = ".coverage/data"
omit = [
"src/utilities/__init__.py",
"src/utilities/pytest_plugins/*.py",
"src/utilities/streamlit.py",
]
parallel = true
plugins = ["coverage_conditional_plugin"]
source = ["src/utilities"]
65 changes: 65 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: pull-request
on:
pull_request:
branches:
- master
schedule:
- cron: 0 0 * * *
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Run 'pre-commit'
uses: dycw/action-pre-commit@latest
with:
token: ${{secrets.GITHUB_TOKEN}}
repos: |-
dycw/pre-commit-hook-nitpick
pre-commit/pre-commit-hooks
pyright:
runs-on: ubuntu-latest
steps:
- name: Run 'pyright'
uses: dycw/action-pyright@latest
with:
token: ${{secrets.GITHUB_TOKEN}}
python-version: "3.12"
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
steps:
- name: Run 'pytest'
uses: dycw/action-pytest@latest
with:
token: ${{secrets.GITHUB_TOKEN}}
python-version: ${{matrix.python-version}}
resolution: ${{matrix.resolution}}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
python-version:
- "3.12"
- "3.13"
- "3.14"
resolution:
- highest
timeout-minutes: 10
ruff:
runs-on: ubuntu-latest
steps:
- name: Run 'ruff'
uses: dycw/action-ruff@latest
with:
token: ${{secrets.GITHUB_TOKEN}}
68 changes: 0 additions & 68 deletions .github/workflows/pull-request.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: push
on:
push:
branches:
- master
jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Tag latest commit
uses: dycw/action-tag@latest
with:
token: ${{secrets.GITHUB_TOKEN}}
38 changes: 0 additions & 38 deletions .github/workflows/push.yml

This file was deleted.

110 changes: 68 additions & 42 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,36 @@
repos:
# fixers
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
- repo: https://github.com/dycw/pre-commit-hook-nitpick
rev: 0.7.9
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.18
hooks:
- id: uv-lock
args: [--upgrade]
- repo: https://github.com/compwa/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
args:
[
--option,
indent_tables=true,
--option,
indent_entries=true,
--option,
reorder_keys=true,
]
- repo: https://github.com/dycw/pre-commit-hooks
rev: 0.13.26
hooks:
- id: format-requirements
- id: replace-sequence-str
- id: run-bump-my-version
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.12.0-2
hooks:
- id: shfmt
# linters
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
# fixers/linters
- args:
# - --coverage
- --description=Miscellaneous Python utilities
- --github--pull-request--pre-commit
- --github--pull-request--pyright
- --github--pull-request--pytest--os--macos
- --github--pull-request--pytest--os--ubuntu
- --github--pull-request--pytest--python-version--3-12
- --github--pull-request--pytest--python-version--3-13
- --github--pull-request--pytest--python-version--3-14
- --github--pull-request--pytest--resolution--highest
- --github--pull-request--ruff
- --github--push--tag
- --package-name=dycw-utilities
- --pre-commit--prettier
- --pre-commit--ruff
- --pre-commit--taplo
- --pre-commit--uv
- --pyproject
- --pyright
- --pytest
- --pytest--asyncio
- --pytest--timeout=600
- --python-package-name=utilities
- --python-version=3.12
- --readme
- --repo-name=python-utilities
- --ruff
id: nitpick
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
Expand All @@ -50,8 +41,43 @@ repos:
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
args:
- --fix=lf
- id: no-commit-to-branch
- id: pretty-format-json
args: [--autofix]
args:
- --autofix
- id: trailing-whitespace
- repo: local
hooks:
- id: prettier
name: prettier
entry: npx prettier --write
language: system
types_or:
- markdown
- yaml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
hooks:
- id: ruff-check
args:
- --fix
- id: ruff-format
- repo: https://github.com/compwa/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
args:
- --option
- indent_tables=true
- --option
- indent_entries=true
- --option
- reorder_keys=true
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.21
hooks:
- id: uv-lock
args:
- --upgrade
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
[![PyPI version](https://badge.fury.io/py/dycw-utilities.svg)](https://badge.fury.io/py/dycw-utilities)
# `python-utilities`

# `dycw-utilities`

[All the Python functions I don't want to write twice.](https://github.com/nvim-lua/plenary.nvim)

## Installation

- `pip install dycw-utilities`

or with [extras](https://github.com/dycw/python-utilities/blob/master/pyproject.toml).
Miscellaneous Python utilities
Loading
Loading