diff --git a/.bumpversion.toml b/.bumpversion.toml index c0d6544..350e020 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -9,6 +9,6 @@ search = "version = \"{current_version}\"" [[tool.bumpversion.files]] - filename = "src/template_python/__init__.py" + filename = "src/dycw_template_python/__init__.py" replace = "__version__ = \"{new_version}\"" search = "__version__ = \"{current_version}\"" diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index b09fbd3..30382d4 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -1,49 +1,56 @@ +name: pull-request +on: + pull_request: + branches: + - master + schedule: + - cron: 0 0 * * * jobs: - pyright: - name: pyright + pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - uses: astral-sh/setup-uv@v7 + - name: Run 'pre-commit' + uses: dycw/action-pre-commit@latest with: - enable-cache: true - version: latest - - uses: actions/setup-python@v6 - with: - python-version-file: .python-version - - run: uv sync - - run: uv run pyright - ruff: - name: ruff + token: ${{ secrets.GITHUB_TOKEN }} + repos: |- + dycw/pre-commit-hook-nitpick + pre-commit/pre-commit-hooks + pyright: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - uses: astral-sh/ruff-action@v3 - - run: ruff check --fix - - run: ruff format - test: - name: test / ${{ matrix.os }} + - name: Run 'pyright' + uses: dycw/action-pyright@latest + with: + token: ${{ secrets.GITHUB_TOKEN }} + python-version: "3.14" + pytest: + env: + CI: "1" + name: pytest (${{ matrix.os }}, ${{ matrix.python-version }}, ${{ + matrix.resolution }}) runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v6 - - uses: astral-sh/setup-uv@v7 + - name: Run 'pytest' + uses: dycw/action-pytest@latest with: - enable-cache: true - version: latest - - uses: actions/setup-python@v6 - with: - python-version-file: .python-version - - run: uv sync - - run: uv run pytest -n=auto + token: ${{ secrets.GITHUB_TOKEN }} + python-version: ${{ matrix.python-version }} + resolution: ${{ matrix.resolution }} strategy: fail-fast: false matrix: os: - macos-latest - ubuntu-latest - timeout-minutes: 60 -name: pull-request -"on": - pull_request: - branches: - - master + python-version: + - "3.14" + resolution: + - highest + ruff: + runs-on: ubuntu-latest + steps: + - name: Run 'ruff' + uses: dycw/action-ruff@latest + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 1f3f8bc..845423f 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -1,3 +1,8 @@ +name: push +on: + push: + branches: + - master jobs: tag: runs-on: ubuntu-latest @@ -6,8 +11,3 @@ jobs: uses: dycw/action-tag@latest with: token: ${{ secrets.GITHUB_TOKEN }} -name: push -"on": - push: - branches: - - master diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a50a607..20a875b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,77 +1,76 @@ repos: - - hooks: - - args: - - --fix - id: ruff-check - - id: ruff-format - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.10 - - hooks: - - args: - - --upgrade - id: uv-lock - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.9.18 - - hooks: - - args: - - --option - - indent_tables=true - - --option - - indent_entries=true - - --option - - reorder_keys=true - id: taplo-format - repo: https://github.com/compwa/taplo-pre-commit - rev: v0.9.3 - - hooks: + - repo: https://github.com/dycw/pre-commit-hook-nitpick + rev: 0.7.3 + hooks: - args: - --description=Template for Python packages + - --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--default + - --github--pull-request--pytest--resolution--highest + - --github--pull-request--ruff - --github--push--tag - - --package-name=dycw-template + - --package-name=dycw-template-python - --pre-commit--prettier - --pre-commit--ruff - --pre-commit--taplo - --pre-commit--uv - --pyproject - --pyright - - --pyright--include=src - --pytest - - --pytest--test-paths=src/tests - - --python-package-name=template_python - --readme - --repo-name=template-python - --ruff id: nitpick - repo: https://github.com/dycw/pre-commit-hook-nitpick - rev: 0.5.0 - - hooks: - - id: format-requirements - - id: replace-sequence-str - repo: https://github.com/dycw/pre-commit-hooks - rev: 0.13.26 - - hooks: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: - id: check-executables-have-shebangs - id: check-merge-conflict - id: check-symlinks - id: destroyed-symlinks - id: detect-private-key - id: end-of-file-fixer - - args: + - id: mixed-line-ending + args: - --fix=lf - id: mixed-line-ending - id: no-commit-to-branch - - args: + - id: pretty-format-json + args: - --autofix - id: pretty-format-json - id: trailing-whitespace - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 - - hooks: - - entry: npx prettier --write - id: prettier - language: system + - repo: local + hooks: + - id: prettier name: prettier + entry: npx prettier --write + language: system types_or: - markdown - yaml - repo: local + - 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.18 + hooks: + - id: uv-lock + args: + - --upgrade diff --git a/pyproject.toml b/pyproject.toml index 29ce96b..54ca062 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,11 +9,7 @@ authors = [{ email = "d.wan@icloud.com", name = "Derek Wan" }] dependencies = [] description = "Template for Python packages" - name = "dycw-template" + name = "dycw-template-python" readme = "README.md" requires-python = ">= 3.14" version = "0.1.0" - -[tool.uv.build-backend] - module-name = "template_python" - module-root = "src" diff --git a/pyrightconfig.json b/pyrightconfig.json index faf8b21..a2e1818 100644 --- a/pyrightconfig.json +++ b/pyrightconfig.json @@ -2,7 +2,6 @@ "deprecateTypingAliases": true, "enableReachabilityAnalysis": false, "include": [ - "script.py", "src" ], "pythonVersion": "3.14", diff --git a/src/template_python/__init__.py b/src/dycw_template_python/__init__.py similarity index 100% rename from src/template_python/__init__.py rename to src/dycw_template_python/__init__.py diff --git a/src/template_python/py.typed b/src/dycw_template_python/py.typed similarity index 100% rename from src/template_python/py.typed rename to src/dycw_template_python/py.typed diff --git a/src/tests/test_main.py b/src/tests/test_main.py index 53edd1b..cb84969 100644 --- a/src/tests/test_main.py +++ b/src/tests/test_main.py @@ -1,6 +1,6 @@ from __future__ import annotations -from template_python import __version__ +from dycw_template_python import __version__ class TestMain: diff --git a/uv.lock b/uv.lock index ff7e4df..3c85e2c 100644 --- a/uv.lock +++ b/uv.lock @@ -107,7 +107,7 @@ wheels = [ ] [[package]] -name = "dycw-template" +name = "dycw-template-python" version = "0.1.0" source = { editable = "." } @@ -129,7 +129,7 @@ dev = [ [[package]] name = "dycw-utilities" -version = "0.172.5" +version = "0.172.7" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "atomicwrites" }, @@ -137,9 +137,9 @@ dependencies = [ { name = "tzlocal" }, { name = "whenever" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/f5/2a/661e344447d287091758f4d1cd37f0d0c9e3cea7c772c3c58fc5efc69b25/dycw_utilities-0.172.5.tar.gz", hash = "sha256:792df14d9066e094424db260f899f950b22a4e2283423c9c1f11260b006c80b5", size = 162818, upload-time = "2025-12-22T01:46:04.825Z" } +sdist = { url = "https://files.pythonhosted.org/packages/1e/48/c424a073fa819d339be60079106595be154faf82efed573ce2e9f58b24ab/dycw_utilities-0.172.7.tar.gz", hash = "sha256:4897e15357372701af215b99e79c081909ec1bae3cf788d4ffd60e2a8e581f6e", size = 163169, upload-time = "2025-12-24T01:03:16.861Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a7/98/401e61e9dab2530dbe44e638ee59b4a15b553d0496b0fc45f40e09bef872/dycw_utilities-0.172.5-py3-none-any.whl", hash = "sha256:77e4dec4a1a278e119799ad320d803eda2c8e039fcd499fc471097e6766303c4", size = 196912, upload-time = "2025-12-22T01:46:06.536Z" }, + { url = "https://files.pythonhosted.org/packages/af/85/fcbfdc9faff63b1752bb1997ec0ce8d3dd63994e82595c48ebb68dc93f0b/dycw_utilities-0.172.7-py3-none-any.whl", hash = "sha256:f61c661bf291563c9f28a924ceac72fdefb06417931e928c1b445dbe47504f5b", size = 197273, upload-time = "2025-12-24T01:03:15.256Z" }, ] [package.optional-dependencies] @@ -279,7 +279,7 @@ wheels = [ [[package]] name = "nbclient" -version = "0.10.3" +version = "0.10.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "jupyter-client" }, @@ -287,9 +287,9 @@ dependencies = [ { name = "nbformat" }, { name = "traitlets" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/8d/f3/1f6cf2ede4b026bc5f0b424cb41adf22f9c804e90a4dbd4fdb42291a35d5/nbclient-0.10.3.tar.gz", hash = "sha256:0baf171ee246e3bb2391da0635e719f27dc77d99aef59e0b04dcb935ee04c575", size = 62564, upload-time = "2025-12-19T15:50:09.331Z" } +sdist = { url = "https://files.pythonhosted.org/packages/56/91/1c1d5a4b9a9ebba2b4e32b8c852c2975c872aec1fe42ab5e516b2cecd193/nbclient-0.10.4.tar.gz", hash = "sha256:1e54091b16e6da39e297b0ece3e10f6f29f4ac4e8ee515d29f8a7099bd6553c9", size = 62554, upload-time = "2025-12-23T07:45:46.369Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b2/77/0c73678f5260501a271fd7342bee5d639440f2e9e07d590f1100a056d87c/nbclient-0.10.3-py3-none-any.whl", hash = "sha256:39e9bd403504dd2484dd0fd25235bb6a683ce8cd9873356e40d880696adc9e35", size = 25473, upload-time = "2025-12-19T15:50:07.671Z" }, + { url = "https://files.pythonhosted.org/packages/83/a0/5b0c2f11142ed1dddec842457d3f65eaf71a0080894eb6f018755b319c3a/nbclient-0.10.4-py3-none-any.whl", hash = "sha256:9162df5a7373d70d606527300a95a975a47c137776cd942e52d9c7e29ff83440", size = 25465, upload-time = "2025-12-23T07:45:44.51Z" }, ] [[package]]