From b2ce700e99c793f4db847ac0e36eb9b6f43f656e Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Sun, 25 Jan 2026 16:55:24 +0900 Subject: [PATCH 1/4] 2026-01-25 16:55:24 (Sun) > DW-Mac > derekwan From 655749a3509e67613ab8644199cf429fb117cfed Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Sun, 25 Jan 2026 16:57:54 +0900 Subject: [PATCH 2/4] 2026-01-25 16:57:54 (Sun) > DW-Mac > derekwan --- .gitattributes | 1 + .github/workflows/push.yaml | 6 +- .gitignore | 26 ++++++ .pre-commit-config.yaml | 160 +++++++++++++++--------------------- uv.lock | 44 ++++++---- 5 files changed, 123 insertions(+), 114 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1938c8c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.bumpversion.toml linguist-generated=true diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index a098ca7..bb746ce 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -1,5 +1,5 @@ name: push -on: +true: push: branches: - master @@ -9,3 +9,7 @@ jobs: steps: - name: Tag the latest commit uses: dycw/action-tag-commit@latest +"on": + push: + branches: + - master diff --git a/.gitignore b/.gitignore index 3bad797..9ea310a 100644 --- a/.gitignore +++ b/.gitignore @@ -242,3 +242,29 @@ shelves/ tmp/ #### END OF CUSTOM GITIGNORE ################################################## + +#### GENERIC GITIGNORE ######################################################### + +**/*.csv +**/*.db +**/*.gz +**/*.html +**/*.ipc +**/*.ipynb +**/*.pdf +**/*.pickle +**/*.shelf +**/*.sqlite +**/*.tar.gz +**/*.tar.lz +**/*.tmp +.direnv/ +.logs/ +htmls/ +ipcs/ +pdfs/ +pickles/ +shelves/ +tmp/ + +#### END OF GENERIC GITIGNORE ################################################# diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f20efb3..a9f067d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,139 +1,109 @@ repos: - - repo: https://github.com/dycw/actions - rev: 0.15.5 + - repo: https://github.com/dycw/pre-commit-hooks + rev: 0.14.118 hooks: - - id: conformalize-repo + - id: add-hooks args: - - --ci--pull-request--pyright - - --ci--pull-request--pytest--macos - - --ci--pull-request--pytest--ubuntu - - --ci--pull-request--pytest--all-versions - - --ci--pull-request--ruff - - --ci--push--tag + - --ci-github - --description=Template for Python packages - - --envrc - - --envrc--uv - - --gitignore - - --package-name=dycw-template-python - - --pre-commit--prettier - - --pre-commit--python - - --pre-commit--ruff - - --pre-commit--shell - - --pre-commit--taplo - - --pre-commit--uv - - --pyproject - - --pyright - - --pytest - - --readme + - --prettier + - --python-package-name-external=dycw-template-python + - --python-package-name-internal=template-python + - --repo-name=template-generic - --repo-name=template-python - - --ruff + - --toml priority: 10 - - id: format-requirements + - id: check-versions-consistent + priority: 40 + - id: format-pre-commit-config + priority: 30 + - id: run-prek-autoupdate priority: 10 - - id: replace-sequence-strs - priority: 10 - - id: touch-empty-py - priority: 10 - - id: touch-py-typed - priority: 10 - - id: update-requirements + - id: run-version-bump + priority: 20 + - id: setup-bump-my-version + priority: 20 + - id: setup-ci-push + priority: 20 + - id: setup-git + priority: 20 + - id: setup-pre-commit priority: 10 + - id: setup-readme + args: + - --repo-name=template-python + - --description=Template for Python packages + priority: 20 + - id: update-ci-action-versions + priority: 20 + - id: update-ci-extensions + priority: 20 - repo: builtin hooks: - id: check-added-large-files - priority: 20 + priority: 40 - id: check-case-conflict - priority: 20 + priority: 40 - id: check-executables-have-shebangs - priority: 20 + priority: 40 - id: check-json - priority: 20 + priority: 40 - id: check-json5 - priority: 20 + priority: 40 - id: check-merge-conflict - priority: 20 + priority: 40 - id: check-symlinks - priority: 20 + priority: 40 - id: check-toml - priority: 20 + priority: 40 - id: check-xml - priority: 20 + priority: 40 - id: check-yaml - priority: 20 + priority: 40 - id: detect-private-key - priority: 20 + priority: 40 - id: end-of-file-fixer - priority: 10 + priority: 20 - id: fix-byte-order-marker - priority: 10 + priority: 20 - id: mixed-line-ending args: - --fix=lf - priority: 10 - - id: no-commit-to-branch priority: 20 + - id: no-commit-to-branch + priority: 40 - id: trailing-whitespace - priority: 10 + priority: 20 + - 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 + priority: 40 - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 hooks: - id: check-illegal-windows-names - priority: 20 + priority: 40 - id: destroyed-symlinks - priority: 20 + priority: 40 - id: pretty-format-json args: - --autofix - priority: 10 + priority: 20 - repo: local hooks: - id: prettier name: prettier entry: npx prettier --write - language: system + language: unsupported types_or: - markdown - yaml - priority: 10 - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.13 - hooks: - - id: ruff-check - args: - - --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 - hooks: - - id: shellcheck - priority: 20 - - 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 - priority: 10 - - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.9.26 - hooks: - - id: uv-lock - args: - - --upgrade - - --resolution - - highest - - --prerelease - - disallow - priority: 10 + priority: 30 diff --git a/uv.lock b/uv.lock index 5a1d4b5..c398d14 100644 --- a/uv.lock +++ b/uv.lock @@ -5,12 +5,6 @@ requires-python = ">=3.14" [options] prerelease-mode = "disallow" -[[package]] -name = "atomicwrites" -version = "1.4.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/87/c6/53da25344e3e3a9c01095a89f16dbcda021c609ddb42dd6d7c0528236fb2/atomicwrites-1.4.1.tar.gz", hash = "sha256:81b2c9071a49367a7f770170e5eec8cb66567cfbbc8c73d20ce5ca4a8d71cf11", size = 14227, upload-time = "2022-07-08T18:31:40.459Z" } - [[package]] name = "colorama" version = "0.4.6" @@ -55,6 +49,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/cc/48/d9f421cb8da5afaa1a64570d9989e00fb7955e6acddc5a12979f7666ef60/coverage-7.13.1-py3-none-any.whl", hash = "sha256:2016745cb3ba554469d02819d78958b571792bb68e31302610e898f80dd3a573", size = 210722, upload-time = "2025-12-28T15:42:54.901Z" }, ] +[[package]] +name = "coverage-conditional-plugin" +version = "0.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "coverage" }, + { name = "packaging" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/2e/6e/82f411d325a38cc24289060ca5f80d990ee8d026f4de9782006acf061f9b/coverage_conditional_plugin-0.9.0.tar.gz", hash = "sha256:6893dab0542695dbd5ea714281dae0dfec8d0e36480ba32d839e9fa7344f8215", size = 10579, upload-time = "2023-06-02T10:25:10.166Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/06/83/df10dd1911cb1695274da836e786ade7eaace9ed625b14056eb0bd6117d8/coverage_conditional_plugin-0.9.0-py3-none-any.whl", hash = "sha256:1b37bc469019d2ab5b01f5eee453abe1846b3431e64e209720c2a9ec4afb8130", size = 7317, upload-time = "2023-06-02T10:25:08.177Z" }, +] + [[package]] name = "dycw-pytest-only" version = "2.1.1" @@ -94,20 +101,21 @@ dev = [ [[package]] name = "dycw-utilities" -version = "0.183.4" +version = "0.186.6" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "atomicwrites" }, { name = "typing-extensions" }, + { name = "tzdata" }, { name = "tzlocal" }, { name = "whenever" }, ] wheels = [ - { url = "https://files.pythonhosted.org/packages/69/a2/10ae93f47062195d3e6433eebeb10cd7e8c64f33f3214518c1248520ddca/dycw_utilities-0.183.4-py3-none-any.whl", hash = "sha256:a0f2ab9c8f78b8536c00abeebe32447e3280fb6731b49a99eace713aa23b3e52", size = 214142, upload-time = "2026-01-17T14:17:38.823Z" }, + { url = "https://files.pythonhosted.org/packages/49/be/7e6e9d29bc111e8be3d181b1bfb17e39db2946a34de74f3ae4847290cc98/dycw_utilities-0.186.6-py3-none-any.whl", hash = "sha256:65408fba3c14ec60247f8be376a11d3fa06044e778e89dab7e06106cedb7e0e5", size = 208478, upload-time = "2026-01-25T06:11:47.85Z" }, ] [package.optional-dependencies] test = [ + { name = "coverage-conditional-plugin" }, { name = "dycw-pytest-only" }, { name = "hypothesis" }, { name = "pytest" }, @@ -135,14 +143,14 @@ wheels = [ [[package]] name = "hypothesis" -version = "6.150.2" +version = "6.150.3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "sortedcontainers" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/d2/19/a4eee0c98e2ec678854272f79646f34943f8fbbc42689cc355b530c5bc96/hypothesis-6.150.2.tar.gz", hash = "sha256:deb043c41c53eaf0955f4a08739c2a34c3d8040ee3d9a2da0aa5470122979f75", size = 475250, upload-time = "2026-01-13T17:09:22.146Z" } +sdist = { url = "https://files.pythonhosted.org/packages/86/eb/1b0359b52d2136a7f4b8112e60148ef8b5ba480d450f409ed63e18d4c8d2/hypothesis-6.150.3.tar.gz", hash = "sha256:32c88d4b7df3a8483e69877561b520320bf7779b0709c11869e392025e9279d4", size = 475542, upload-time = "2026-01-23T07:53:09.716Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b3/5e/21caad4acf45db7caf730cca1bc61422283e4c4e841efbc862d17ab81a21/hypothesis-6.150.2-py3-none-any.whl", hash = "sha256:648d6a2be435889e713ba3d335b0fb5e7a250f569b56e6867887c1e7a0d1f02f", size = 542712, upload-time = "2026-01-13T17:09:19.945Z" }, + { url = "https://files.pythonhosted.org/packages/69/6b/c94ca780814aa4e73b52a8d5e9092f0b83f4732a9ecb3d1f8333c93ac131/hypothesis-6.150.3-py3-none-any.whl", hash = "sha256:5577c0f8eff5ac54a8aff1ce32e30c5454167c29360fdabf1bfea0539b1689f9", size = 542960, upload-time = "2026-01-23T07:53:07.309Z" }, ] [[package]] @@ -215,11 +223,11 @@ wheels = [ [[package]] name = "packaging" -version = "25.0" +version = "26.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } +sdist = { url = "https://files.pythonhosted.org/packages/65/ee/299d360cdc32edc7d2cf530f3accf79c4fca01e96ffc950d8a52213bd8e4/packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4", size = 143416, upload-time = "2026-01-21T20:50:39.064Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, + { url = "https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl", hash = "sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529", size = 74366, upload-time = "2026-01-21T20:50:37.788Z" }, ] [[package]] @@ -448,15 +456,15 @@ wheels = [ [[package]] name = "rich" -version = "14.2.0" +version = "14.3.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "markdown-it-py" }, { name = "pygments" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/fb/d2/8920e102050a0de7bfabeb4c4614a49248cf8d5d7a8d01885fbb24dc767a/rich-14.2.0.tar.gz", hash = "sha256:73ff50c7c0c1c77c8243079283f4edb376f0f6442433aecb8ce7e6d0b92d1fe4", size = 219990, upload-time = "2025-10-09T14:16:53.064Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a1/84/4831f881aa6ff3c976f6d6809b58cdfa350593ffc0dc3c58f5f6586780fb/rich-14.3.1.tar.gz", hash = "sha256:b8c5f568a3a749f9290ec6bddedf835cec33696bfc1e48bcfecb276c7386e4b8", size = 230125, upload-time = "2026-01-24T21:40:44.847Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/25/7a/b0178788f8dc6cafce37a212c99565fa1fe7872c70c6c9c1e1a372d9d88f/rich-14.2.0-py3-none-any.whl", hash = "sha256:76bc51fe2e57d2b1be1f96c524b890b816e334ab4c1e45888799bfaab0021edd", size = 243393, upload-time = "2025-10-09T14:16:51.245Z" }, + { url = "https://files.pythonhosted.org/packages/87/2a/a1810c8627b9ec8c57ec5ec325d306701ae7be50235e8fd81266e002a3cc/rich-14.3.1-py3-none-any.whl", hash = "sha256:da750b1aebbff0b372557426fb3f35ba56de8ef954b3190315eb64076d6fb54e", size = 309952, upload-time = "2026-01-24T21:40:42.969Z" }, ] [[package]] From 38431157ef023cfde229e35ec6b1173b3a6e9ec7 Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Sun, 25 Jan 2026 17:02:37 +0900 Subject: [PATCH 3/4] 2026-01-25 17:02:37 (Sun) > DW-Mac > derekwan --- .bumpversion.toml | 2 +- .cache/nitpick/merged-style.toml | 230 ++++++++++++++++++ .coveragerc.toml | 12 + .envrc | 2 +- .github/workflows/pull-request.yaml | 13 +- .github/workflows/push.yaml | 16 +- .gitignore | 83 +++---- .pre-commit-config.yaml | 50 ++++ pyproject.toml | 12 +- pyrightconfig.json | 2 +- pytest.toml | 13 +- ruff.toml | 2 +- .../__init__.py | 0 .../py.typed | 0 src/tests/test_main.py | 2 +- 15 files changed, 366 insertions(+), 73 deletions(-) create mode 100644 .cache/nitpick/merged-style.toml create mode 100644 .coveragerc.toml rename src/{dycw_template_python => template_python}/__init__.py (100%) rename src/{dycw_template_python => template_python}/py.typed (100%) diff --git a/.bumpversion.toml b/.bumpversion.toml index 350e020..c0d6544 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -9,6 +9,6 @@ search = "version = \"{current_version}\"" [[tool.bumpversion.files]] - filename = "src/dycw_template_python/__init__.py" + filename = "src/template_python/__init__.py" replace = "__version__ = \"{new_version}\"" search = "__version__ = \"{current_version}\"" diff --git a/.cache/nitpick/merged-style.toml b/.cache/nitpick/merged-style.toml new file mode 100644 index 0000000..3881a4d --- /dev/null +++ b/.cache/nitpick/merged-style.toml @@ -0,0 +1,230 @@ +[".pre-commit-config.yaml"] + [[".pre-commit-config.yaml".repos]] + repo = "https://github.com/dycw/pre-commit-hooks" + [[".pre-commit-config.yaml".repos.hooks]] + id = "run-bump-my-version" + + [[".pre-commit-config.yaml".repos.hooks]] + id = "replace-sequence-str" + + [[".pre-commit-config.yaml".repos.hooks]] + id = "format-requirements" + + + [[".pre-commit-config.yaml".repos]] + repo = "https://github.com/andreoliwa/nitpick" + [[".pre-commit-config.yaml".repos.hooks]] + id = "nitpick-check" + + + [[".pre-commit-config.yaml".repos]] + repo = "https://github.com/pre-commit/pre-commit-hooks" + [[".pre-commit-config.yaml".repos.hooks]] + id = "check-executables-have-shebangs" + + [[".pre-commit-config.yaml".repos.hooks]] + args = ["--autofix"] + id = "pretty-format-json" + + [[".pre-commit-config.yaml".repos.hooks]] + id = "check-merge-conflict" + + [[".pre-commit-config.yaml".repos.hooks]] + id = "check-symlinks" + + [[".pre-commit-config.yaml".repos.hooks]] + id = "destroyed-symlinks" + + [[".pre-commit-config.yaml".repos.hooks]] + id = "detect-private-key" + + [[".pre-commit-config.yaml".repos.hooks]] + id = "end-of-file-fixer" + + [[".pre-commit-config.yaml".repos.hooks]] + args = ["--fix=lf"] + id = "mixed-line-ending" + + [[".pre-commit-config.yaml".repos.hooks]] + id = "no-commit-to-branch" + + [[".pre-commit-config.yaml".repos.hooks]] + id = "trailing-whitespace" + + + [[".pre-commit-config.yaml".repos]] + repo = "https://github.com/compwa/taplo-pre-commit" + [[".pre-commit-config.yaml".repos.hooks]] + args = [ + "--option", + "indent_tables=true", + "--option", + "indent_entries=true", + "--option", + "reorder_keys=true", + ] + id = "taplo-format" + + + [[".pre-commit-config.yaml".repos]] + repo = "https://github.com/astral-sh/ruff-pre-commit" + [[".pre-commit-config.yaml".repos.hooks]] + args = ["--fix"] + id = "ruff-check" + + [[".pre-commit-config.yaml".repos.hooks]] + id = "ruff-format" + + + [[".pre-commit-config.yaml".repos]] + repo = "https://github.com/shellcheck-py/shellcheck-py" + [[".pre-commit-config.yaml".repos.hooks]] + id = "shellcheck" + + + [[".pre-commit-config.yaml".repos]] + repo = "https://github.com/scop/pre-commit-shfmt" + [[".pre-commit-config.yaml".repos.hooks]] + id = "shfmt" + + + [[".pre-commit-config.yaml".repos]] + repo = "https://github.com/astral-sh/uv-pre-commit" + [[".pre-commit-config.yaml".repos.hooks]] + args = ["--upgrade"] + id = "uv-lock" + + +["pyproject.toml".project] + readme = "README.md" + requires-python = ">= 3.14" + +["pyproject.toml".build-system] + build-backend = "uv_build" + requires = ["uv_build"] + +["pyproject.toml".tool.pyright] + deprecateTypingAliases = true + enableReachabilityAnalysis = false + pythonVersion = "3.14" + reportCallInDefaultInitializer = true + reportImplicitOverride = true + reportImplicitStringConcatenation = true + reportImportCycles = true + reportMissingSuperCall = true + reportMissingTypeArgument = false + reportMissingTypeStubs = false + reportPrivateUsage = false + reportPropertyTypeMismatch = true + reportUninitializedInstanceVariable = true + reportUnknownArgumentType = false + reportUnknownMemberType = false + reportUnknownParameterType = false + reportUnknownVariableType = false + reportUnnecessaryComparison = false + reportUnnecessaryTypeIgnoreComment = true + reportUnusedCallResult = true + reportUnusedImport = false + reportUnusedVariable = false + typeCheckingMode = "strict" + +["pyproject.toml".tool.ruff] + src = ["src"] + target-version = "py314" + unsafe-fixes = true + +["pyproject.toml".tool.bumpversion] + allow_dirty = true + +["pyproject.toml".tool.pytest] + addopts = ["--color=auto", "-ra", "-vv"] + asyncio_default_fixture_loop_scope = "function" + asyncio_mode = "auto" + collect_imported_tests = false + empty_parameter_set_mark = "fail_at_collect" + filterwarnings = ["error"] + minversion = "9.0" + strict = true + testpaths = ["src/tests"] + timeout = "600" + xfail_strict = true + +[nitpick.files.absent] + ".bump2version.cfg" = "" + ".flake8" = "" + ".isort.cfg" = "" + "MANIFEST.in" = "" + "package.json" = "" + "setup.cfg" = "" + "setup.py" = "" + +[nitpick.files.present] + "pyproject.toml" = "" + + ["pyproject.toml".tool.ruff.format] + preview = true + skip-magic-trailing-comma = true + + ["pyproject.toml".tool.ruff.lint] + explicit-preview-rules = true + fixable = ["ALL"] + ignore = [ + "ANN401", + "ASYNC109", + "C901", + "CPY", + "D", + "DOC", + "E501", + "PD", + "PERF203", + "PLC0415", + "PLR0911", + "PLR0912", + "PLR0913", + "PLR0915", + "PLR2004", + "PT012", + "PT013", + "S202", + "S310", + "S311", + "S602", + "S603", + "S607", + "S101", + "COM812", + "COM819", + "E111", + "E114", + "E117", + "ISC001", + "ISC002", + "W191", + ] + preview = true + select = ["ALL", "RUF022"] + +["pyproject.toml".tool.coverage.html] + directory = ".coverage/html" + +["pyproject.toml".tool.coverage.report] + exclude_also = ["@overload", "if TYPE_CHECKING:"] + fail_under = 100.0 + skip_covered = true + skip_empty = true + +["pyproject.toml".tool.coverage.run] + branch = true + data_file = ".coverage/data" + parallel = true + + ["pyproject.toml".tool.ruff.lint.extend-per-file-ignores] + "src/tests/**/*.py" = ["S101"] + + ["pyproject.toml".tool.ruff.lint.flake8-tidy-imports] + ban-relative-imports = "all" + + ["pyproject.toml".tool.ruff.lint.isort] + required-imports = ["from __future__ import annotations"] + split-on-trailing-comma = false diff --git a/.coveragerc.toml b/.coveragerc.toml new file mode 100644 index 0000000..20fad9f --- /dev/null +++ b/.coveragerc.toml @@ -0,0 +1,12 @@ +[html] + directory = ".coverage/html" + +[report] + exclude_also = ["@overload", "if TYPE_CHECKING:"] + skip_covered = true + skip_empty = true + +[run] + branch = true + data_file = ".coverage/data" + parallel = true diff --git a/.envrc b/.envrc index f199a01..0aafb67 100644 --- a/.envrc +++ b/.envrc @@ -7,7 +7,7 @@ echo_date() { echo "[$(date +'%Y-%m-%d %H:%M:%S')] $*" >&2; } # uv export UV_MANAGED_PYTHON='true' export UV_PRERELEASE='disallow' -export UV_PYTHON='3.14' +export UV_PYTHON='3.12' export UV_RESOLUTION='highest' export UV_VENV_CLEAR=1 if ! command -v uv >/dev/null 2>&1; then diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index b1d24df..a080fb1 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 @@ -12,13 +12,13 @@ jobs: - name: Run 'pyright' uses: dycw/action-pyright@latest with: - python-version: "3.14" + python-version: "3.12" pytest: env: CI: "1" - name: pytest (${{matrix.os}}, ${{matrix.python-version}}, - ${{matrix.resolution}}) - runs-on: ${{matrix.os}} + name: pytest (${{matrix.os}}, ${{matrix.python-version}}, ${{matrix.resolution}}) + runs-on: + - ${{matrix.os}} steps: - name: Run 'pytest' uses: dycw/action-pytest@latest @@ -32,10 +32,13 @@ jobs: - macos-latest - ubuntu-latest python-version: + - "3.12" + - "3.13" - "3.14" resolution: - highest - lowest-direct + timeout-minutes: 10 ruff: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index bb746ce..e4f2dba 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -1,5 +1,5 @@ name: push -true: +"on": push: branches: - master @@ -9,7 +9,13 @@ jobs: steps: - name: Tag the latest commit uses: dycw/action-tag-commit@latest -"on": - push: - branches: - - master + publish: + environment: + name: pypi + permissions: + id-token: write + runs-on: ubuntu-latest + steps: + - name: Build and publish the package + uses: dycw/action-publish-package@latest + with: {} diff --git a/.gitignore b/.gitignore index 9ea310a..576e13e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,31 @@ -#### STANDARD GITIGNORE ####################################################### +#### GENERIC GITIGNORE ######################################################### + +**/*.csv +**/*.db +**/*.gz +**/*.html +**/*.ipc +**/*.ipynb +**/*.pdf +**/*.pickle +**/*.shelf +**/*.sqlite +**/*.tar.gz +**/*.tar.lz +**/*.tmp +.direnv/ +.logs/ +htmls/ +ipcs/ +pdfs/ +pickles/ +shelves/ +tmp/ + +#### END OF GENERIC GITIGNORE ################################################# + + +#### PYTHON GITIGNORE ######################################################### # Byte-compiled / optimized / DLL files __pycache__/ @@ -215,56 +242,4 @@ __marimo__/ # Streamlit .streamlit/secrets.toml -#### END OF STANDARD GITIGNORE ################################################ - -#### CUSTOM GITIGNORE ######################################################### - -**/*.csv -**/*.db -**/*.gz -**/*.html -**/*.ipc -**/*.ipynb -**/*.pdf -**/*.pickle -**/*.shelf -**/*.sqlite -**/*.tar.gz -**/*.tar.lz -**/*.tmp -.direnv/ -.logs/ -htmls/ -ipcs/ -pdfs/ -pickles/ -shelves/ -tmp/ - -#### END OF CUSTOM GITIGNORE ################################################## - -#### GENERIC GITIGNORE ######################################################### - -**/*.csv -**/*.db -**/*.gz -**/*.html -**/*.ipc -**/*.ipynb -**/*.pdf -**/*.pickle -**/*.shelf -**/*.sqlite -**/*.tar.gz -**/*.tar.lz -**/*.tmp -.direnv/ -.logs/ -htmls/ -ipcs/ -pdfs/ -pickles/ -shelves/ -tmp/ - -#### END OF GENERIC GITIGNORE ################################################# +#### END OF PYTHON GITIGNORE ################################################## diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9f067d..fb968fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,37 +7,78 @@ repos: - --ci-github - --description=Template for Python packages - --prettier + - --python - --python-package-name-external=dycw-template-python - --python-package-name-internal=template-python - --repo-name=template-generic - --repo-name=template-python - --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: replace-sequence-str + priority: 20 - id: run-prek-autoupdate priority: 10 + - id: run-uv-lock + priority: 20 - id: run-version-bump priority: 20 - id: setup-bump-my-version + args: + - --python-package-name-internal=template-python + priority: 20 + - id: setup-ci-pull-request + args: + - --repo-name=template-python 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=Template for Python packages + - --python-package-name-external=dycw-template-python + - --python-package-name-internal=template-python + priority: 20 + - id: setup-pyright + priority: 20 + - id: setup-pytest + args: + - --python-package-name-internal=template-python + priority: 20 - id: setup-readme args: - --repo-name=template-python - --description=Template for Python packages priority: 20 + - id: setup-ruff + priority: 20 - id: update-ci-action-versions priority: 20 - id: update-ci-extensions priority: 20 + - id: update-requirements + priority: 20 - repo: builtin hooks: - id: check-added-large-files @@ -74,6 +115,15 @@ repos: priority: 40 - id: trailing-whitespace priority: 20 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.14.14 + hooks: + - id: ruff-check + args: + - --fix + priority: 20 + - id: ruff-format + priority: 30 - repo: https://github.com/compwa/taplo-pre-commit rev: v0.9.3 hooks: diff --git a/pyproject.toml b/pyproject.toml index 45b54a8..dc37dbc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,13 +3,19 @@ requires = ["uv_build"] [dependency-groups] - dev = ["dycw-utilities[test]>=0.183.4", "pyright>=1.1.408", "rich>=14.2.0"] + dev = ["dycw-utilities[test]>=0.186.6", "pyright>=1.1.408", "rich>=14.2.0"] [project] authors = [{ email = "d.wan@icloud.com", name = "Derek Wan" }] - dependencies = ["dycw-utilities>=0.183.4"] + dependencies = ["dycw-utilities>=0.186.6"] description = "Template for Python packages" name = "dycw-template-python" readme = "README.md" - requires-python = ">= 3.14" + requires-python = ">= 3.12" version = "0.1.0" + +[tool] + [tool.uv] + [tool.uv.build-backend] + module-name = "template_python" + module-root = "src" diff --git a/pyrightconfig.json b/pyrightconfig.json index a2e1818..8e3afb1 100644 --- a/pyrightconfig.json +++ b/pyrightconfig.json @@ -4,7 +4,7 @@ "include": [ "src" ], - "pythonVersion": "3.14", + "pythonVersion": "3.12", "reportCallInDefaultInitializer": true, "reportImplicitOverride": true, "reportImplicitStringConcatenation": true, diff --git a/pytest.toml b/pytest.toml index cc9cc40..edf4d6d 100644 --- a/pytest.toml +++ b/pytest.toml @@ -5,11 +5,22 @@ "--color=auto", "--durations=10", "--durations-min=10", + "--cov=template_python", + "--cov-config=.coveragerc.toml", + "--cov-report=html", ] + asyncio_default_fixture_loop_scope = "function" + asyncio_mode = "auto" collect_imported_tests = false empty_parameter_set_mark = "fail_at_collect" - filterwarnings = ["error"] + filterwarnings = [ + "error", + "ignore::DeprecationWarning", + "ignore::ResourceWarning", + "ignore::RuntimeWarning", + ] minversion = "9.0" strict = true testpaths = ["src/tests"] + timeout = "600" xfail_strict = true diff --git a/ruff.toml b/ruff.toml index ba422b1..8207af8 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,4 +1,4 @@ -target-version = "py314" +target-version = "py312" unsafe-fixes = true [format] diff --git a/src/dycw_template_python/__init__.py b/src/template_python/__init__.py similarity index 100% rename from src/dycw_template_python/__init__.py rename to src/template_python/__init__.py diff --git a/src/dycw_template_python/py.typed b/src/template_python/py.typed similarity index 100% rename from src/dycw_template_python/py.typed rename to src/template_python/py.typed diff --git a/src/tests/test_main.py b/src/tests/test_main.py index cb84969..53edd1b 100644 --- a/src/tests/test_main.py +++ b/src/tests/test_main.py @@ -1,6 +1,6 @@ from __future__ import annotations -from dycw_template_python import __version__ +from template_python import __version__ class TestMain: From 6eaf5419bda1ce05ad7636b41fc917217f745346 Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Sun, 25 Jan 2026 21:37:32 +0900 Subject: [PATCH 4/4] 2026-01-25 21:37:32 (Sun) > DW-Mac > derekwan --- .cache/nitpick/merged-style.toml | 230 ------------------------------- 1 file changed, 230 deletions(-) delete mode 100644 .cache/nitpick/merged-style.toml diff --git a/.cache/nitpick/merged-style.toml b/.cache/nitpick/merged-style.toml deleted file mode 100644 index 3881a4d..0000000 --- a/.cache/nitpick/merged-style.toml +++ /dev/null @@ -1,230 +0,0 @@ -[".pre-commit-config.yaml"] - [[".pre-commit-config.yaml".repos]] - repo = "https://github.com/dycw/pre-commit-hooks" - [[".pre-commit-config.yaml".repos.hooks]] - id = "run-bump-my-version" - - [[".pre-commit-config.yaml".repos.hooks]] - id = "replace-sequence-str" - - [[".pre-commit-config.yaml".repos.hooks]] - id = "format-requirements" - - - [[".pre-commit-config.yaml".repos]] - repo = "https://github.com/andreoliwa/nitpick" - [[".pre-commit-config.yaml".repos.hooks]] - id = "nitpick-check" - - - [[".pre-commit-config.yaml".repos]] - repo = "https://github.com/pre-commit/pre-commit-hooks" - [[".pre-commit-config.yaml".repos.hooks]] - id = "check-executables-have-shebangs" - - [[".pre-commit-config.yaml".repos.hooks]] - args = ["--autofix"] - id = "pretty-format-json" - - [[".pre-commit-config.yaml".repos.hooks]] - id = "check-merge-conflict" - - [[".pre-commit-config.yaml".repos.hooks]] - id = "check-symlinks" - - [[".pre-commit-config.yaml".repos.hooks]] - id = "destroyed-symlinks" - - [[".pre-commit-config.yaml".repos.hooks]] - id = "detect-private-key" - - [[".pre-commit-config.yaml".repos.hooks]] - id = "end-of-file-fixer" - - [[".pre-commit-config.yaml".repos.hooks]] - args = ["--fix=lf"] - id = "mixed-line-ending" - - [[".pre-commit-config.yaml".repos.hooks]] - id = "no-commit-to-branch" - - [[".pre-commit-config.yaml".repos.hooks]] - id = "trailing-whitespace" - - - [[".pre-commit-config.yaml".repos]] - repo = "https://github.com/compwa/taplo-pre-commit" - [[".pre-commit-config.yaml".repos.hooks]] - args = [ - "--option", - "indent_tables=true", - "--option", - "indent_entries=true", - "--option", - "reorder_keys=true", - ] - id = "taplo-format" - - - [[".pre-commit-config.yaml".repos]] - repo = "https://github.com/astral-sh/ruff-pre-commit" - [[".pre-commit-config.yaml".repos.hooks]] - args = ["--fix"] - id = "ruff-check" - - [[".pre-commit-config.yaml".repos.hooks]] - id = "ruff-format" - - - [[".pre-commit-config.yaml".repos]] - repo = "https://github.com/shellcheck-py/shellcheck-py" - [[".pre-commit-config.yaml".repos.hooks]] - id = "shellcheck" - - - [[".pre-commit-config.yaml".repos]] - repo = "https://github.com/scop/pre-commit-shfmt" - [[".pre-commit-config.yaml".repos.hooks]] - id = "shfmt" - - - [[".pre-commit-config.yaml".repos]] - repo = "https://github.com/astral-sh/uv-pre-commit" - [[".pre-commit-config.yaml".repos.hooks]] - args = ["--upgrade"] - id = "uv-lock" - - -["pyproject.toml".project] - readme = "README.md" - requires-python = ">= 3.14" - -["pyproject.toml".build-system] - build-backend = "uv_build" - requires = ["uv_build"] - -["pyproject.toml".tool.pyright] - deprecateTypingAliases = true - enableReachabilityAnalysis = false - pythonVersion = "3.14" - reportCallInDefaultInitializer = true - reportImplicitOverride = true - reportImplicitStringConcatenation = true - reportImportCycles = true - reportMissingSuperCall = true - reportMissingTypeArgument = false - reportMissingTypeStubs = false - reportPrivateUsage = false - reportPropertyTypeMismatch = true - reportUninitializedInstanceVariable = true - reportUnknownArgumentType = false - reportUnknownMemberType = false - reportUnknownParameterType = false - reportUnknownVariableType = false - reportUnnecessaryComparison = false - reportUnnecessaryTypeIgnoreComment = true - reportUnusedCallResult = true - reportUnusedImport = false - reportUnusedVariable = false - typeCheckingMode = "strict" - -["pyproject.toml".tool.ruff] - src = ["src"] - target-version = "py314" - unsafe-fixes = true - -["pyproject.toml".tool.bumpversion] - allow_dirty = true - -["pyproject.toml".tool.pytest] - addopts = ["--color=auto", "-ra", "-vv"] - asyncio_default_fixture_loop_scope = "function" - asyncio_mode = "auto" - collect_imported_tests = false - empty_parameter_set_mark = "fail_at_collect" - filterwarnings = ["error"] - minversion = "9.0" - strict = true - testpaths = ["src/tests"] - timeout = "600" - xfail_strict = true - -[nitpick.files.absent] - ".bump2version.cfg" = "" - ".flake8" = "" - ".isort.cfg" = "" - "MANIFEST.in" = "" - "package.json" = "" - "setup.cfg" = "" - "setup.py" = "" - -[nitpick.files.present] - "pyproject.toml" = "" - - ["pyproject.toml".tool.ruff.format] - preview = true - skip-magic-trailing-comma = true - - ["pyproject.toml".tool.ruff.lint] - explicit-preview-rules = true - fixable = ["ALL"] - ignore = [ - "ANN401", - "ASYNC109", - "C901", - "CPY", - "D", - "DOC", - "E501", - "PD", - "PERF203", - "PLC0415", - "PLR0911", - "PLR0912", - "PLR0913", - "PLR0915", - "PLR2004", - "PT012", - "PT013", - "S202", - "S310", - "S311", - "S602", - "S603", - "S607", - "S101", - "COM812", - "COM819", - "E111", - "E114", - "E117", - "ISC001", - "ISC002", - "W191", - ] - preview = true - select = ["ALL", "RUF022"] - -["pyproject.toml".tool.coverage.html] - directory = ".coverage/html" - -["pyproject.toml".tool.coverage.report] - exclude_also = ["@overload", "if TYPE_CHECKING:"] - fail_under = 100.0 - skip_covered = true - skip_empty = true - -["pyproject.toml".tool.coverage.run] - branch = true - data_file = ".coverage/data" - parallel = true - - ["pyproject.toml".tool.ruff.lint.extend-per-file-ignores] - "src/tests/**/*.py" = ["S101"] - - ["pyproject.toml".tool.ruff.lint.flake8-tidy-imports] - ban-relative-imports = "all" - - ["pyproject.toml".tool.ruff.lint.isort] - required-imports = ["from __future__ import annotations"] - split-on-trailing-comma = false