Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/usr/bin/env bash
layout pyenv 3.12.8

use_uv_python
20 changes: 15 additions & 5 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,31 @@ on:
- master

jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
- run: ruff check --fix
- run: ruff format

test:
name: test / ${{ matrix.os }} / ${{ matrix.version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
version: ["3.12"]
version: ["3.13"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
- run: python -m pip install uv
- run: uv venv
- run: uv pip sync --system --compile requirements.txt
- run: pytest --cov-report=term-missing:skip-covered -n=auto
- run: uv sync
- run: uv run pytest --cov-report=term-missing:skip-covered -n=auto
timeout-minutes: 60
23 changes: 21 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,24 @@ jobs:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
strategy: regex
root: src/dycw_template/__init__.py
regex_pattern: '__version__ = "(?<version>\d+\.\d+\.\d+)"'
root: pyproject.toml
regex_pattern: 'current_version = "(?<version>\d+\.\d+\.\d+)"'

publish:
runs-on: ubuntu-latest
needs:
- tag
environment:
name: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
- run: uv build
- run: uv publish --trusted-publishing always
40 changes: 18 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
repos:
# fixers
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.3
rev: v0.9.10
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/dycw/pre-commit-hooks
rev: 0.9.24
rev: 0.10.14
hooks:
# - id: run-hatch-version
# - id: run-bump-my-version
- id: run-ruff-format
- id: run-uv-pip-compile
args: [--python-version=3.12]
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
hooks:
- id: pretty-format-toml
args: [--autofix, --trailing-commas]
- repo: https://github.com/pamoller/xmlformatter
rev: v0.2.8
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.6.5
hooks:
- id: xml-formatter
- id: uv-sync # after version bump
args: [--all-packages, --upgrade]
stages: [pre-commit, pre-push]
# linters
- repo: https://github.com/andreoliwa/nitpick
rev: v0.35.0
hooks:
- id: nitpick-check
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
# fixers/linters
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand All @@ -35,16 +44,3 @@ repos:
args: [--fix=lf]
- id: no-commit-to-branch
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
# linters
- repo: https://github.com/andreoliwa/nitpick
rev: v0.35.0
hooks:
- id: nitpick-check
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
1 change: 0 additions & 1 deletion .rgignore

This file was deleted.

31 changes: 16 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@
build-backend = "hatchling.build"
requires = ["hatchling"]

# dependency groups
[dependency-groups]
dev = [
"dycw-utilities[test]",
"setuptools",
]

# project
[project]
authors = [{name = "Derek Wan", email = "d.wan@icloud.com"}]
dependencies = []
dynamic = ["version"]
name = "dycw-template"
readme = "README.md"
requires-python = ">= 3.12"
requires-python = ">= 3.13"
version = "0.1.0"

[project.optional-dependencies]
dev = [
"dycw-utilities[test] >= 0.92.10, < 0.93",
"hatch >= 1.14.0, < 1.15",
"pytest-cov >= 6.0.0, < 6.1",
"setuptools >= 75.8.0, < 75.9", # https://github.com/theY4Kman/pytest-only/issues/14
]
# bump-my-version
[tool.bumpversion]
current_version = "0.1.0"

# coverage
[tool.coverage]
Expand Down Expand Up @@ -48,20 +51,18 @@ sources = ["src"]
[tool.hatch.build.targets.wheel]
packages = ["src/dycw_template"]

[tool.hatch.version]
path = "src/dycw_template/__init__.py"

# nitpick
[tool.nitpick]
style = [
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/3.12.toml",
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/3.13.toml",
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/common.toml",
]

# pyright
[tool.pyright]
deprecateTypingAliases = true
enableReachabilityAnalysis = false
pythonVersion = "3.12"
pythonVersion = "3.13"
reportAny = false
reportCallInDefaultInitializer = true
reportImplicitOverride = true
Expand Down Expand Up @@ -105,7 +106,7 @@ xfail_strict = true
# ruff
[tool.ruff]
src = ["src"]
target-version = "py312"
target-version = "py313"
unsafe-fixes = true

[tool.ruff.format]
Expand Down
155 changes: 0 additions & 155 deletions requirements.txt

This file was deleted.

1 change: 1 addition & 0 deletions src/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from __future__ import annotations
Loading
Loading