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
14 changes: 14 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[tool]
[tool.bumpversion]
allow_dirty = true
current_version = "0.1.0"

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

[[tool.bumpversion.files]]
filename = "src/template/__init__.py"
replace = "__version__ = \"{new_version}\""
search = "__version__ = \"{current_version}\""
13 changes: 13 additions & 0 deletions .coveragerc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[html]
directory = ".coverage/html"

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

[run]
branch = true
data_file = ".coverage/data"
parallel = true
35 changes: 35 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: push

"on":
push:
branches:
- master

jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Tag latest commit
uses: dycw/action-tag-commit@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}

publish:
environment:
name: pypi
needs:
- tag
permissions:
id-write: write
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Install 'uv'
uses: astral-sh/setup-uv@7
with:
enable-cache: true
- name: Build Python package
run: uv build
- name: Upload distribution
run: uv publish --trusted-publishing always
39 changes: 0 additions & 39 deletions .github/workflows/push.yml

This file was deleted.

107 changes: 60 additions & 47 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,61 +1,74 @@
repos:
# fixers
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.9
hooks:
- id: ruff-check
args: [--fix]
- hooks:
- args:
- --fix
id: ruff-check
- id: ruff-format
- repo: https://github.com/astral-sh/uv-pre-commit
repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.9
- hooks:
- args:
- --upgrade
id: uv-lock
repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.17
hooks:
- id: uv-lock
args: [--upgrade]
- repo: https://github.com/compwa/taplo-pre-commit
- 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:
- 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:
- hooks:
- args:
- --coverage
- --github--push--tag
- --pre-commit--prettier
- --pre-commit--ruff
- --pre-commit--taplo
- --pre-commit--uv
- --pyproject
- --pyproject--project--name=template
- --pyright
- --pyright--include=src
- --pytest
- --pytest--test-paths=src/tests
- --ruff
id: nitpick
repo: https://github.com/dycw/pre-commit-hook-nitpick
rev: 0.3.2
- 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/andreoliwa/nitpick
rev: v0.38.1
hooks:
- id: nitpick-check
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
# fixers/linters
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
repo: https://github.com/dycw/pre-commit-hooks
rev: 0.13.26
- 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
- id: mixed-line-ending
args: [--fix=lf]
- args:
- --fix=lf
id: mixed-line-ending
- id: no-commit-to-branch
- id: pretty-format-json
args: [--autofix]
- 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
name: prettier
types_or:
- markdown
- yaml
repo: local
148 changes: 1 addition & 147 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,153 +8,7 @@
[project]
authors = [{ email = "d.wan@icloud.com", name = "Derek Wan" }]
dependencies = []
name = "dycw-template"
name = "template"
readme = "README.md"
requires-python = ">= 3.14"
version = "0.1.0"

[tool]
[tool.bumpversion]
allow_dirty = true
current_version = "0.1.0"

[[tool.bumpversion.files]]
filename = "src/dycw_template/__init__.py"
replace = "__version__ = \"{new_version}\""
search = "__version__ = \"{current_version}\""

[tool.coverage]
[tool.coverage.html]
directory = ".coverage/html"

[tool.coverage.report]
exclude_also = ["@overload", "if TYPE_CHECKING:"]
fail_under = 100.0
skip_covered = true
skip_empty = true

[tool.coverage.run]
branch = true
data_file = ".coverage/data"
parallel = true

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

[tool.pyright]
deprecateTypingAliases = true
enableReachabilityAnalysis = false
ignore = ["**/_typeshed/**"]
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"

[tool.pytest]
addopts = [
"-ra",
"-vv",
"--color=auto",
"--cov=dycw_template",
"--cov-config=pyproject.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"]
minversion = "9.0"
strict = true
testpaths = ["src/tests"]
timeout = "600"
xfail_strict = true

[tool.ruff]
src = ["src"]
target-version = "py314"
unsafe-fixes = true

[tool.ruff.format]
preview = true
skip-magic-trailing-comma = true

[tool.ruff.lint]
explicit-preview-rules = true
fixable = ["ALL"]
ignore = [
"ANN401", # any-type
"ASYNC109", # async-function-with-timeout
"C901", # complex-structure
"CPY", # flake8-copyright
"D", # pydocstyle
"DOC", # pydoclint
"E501", # line-too-long
"PD", # pandas-vet
"PERF203", # try-except-in-loop
"PLC0415", # import-outside-top-level
"PLR0904", # too-many-public-methods
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
"PLR2004", # magic-value-comparison
"PT012", # pytest-raises-with-multiple-statements
"PT013", # pytest-incorrect-pytest-import
"S202", # tarfile-unsafe-members
"S310", # suspicious-url-open-usage
"S311", # suspicious-non-cryptographic-random-usage
"S602", # subprocess-popen-with-shell-equals-true
"S603", # subprocess-without-shell-equals-true
"S607", # start-process-with-partial-path
# preview
"S101", # assert
# formatter
"W191", # tab-indentation
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
]
preview = true
select = [
"ALL",
# preview
"RUF022", # unsorted-dunder-all
"RUF029", # unused-async
]

[tool.ruff.lint.extend-per-file-ignores]
"src/tests/**/*.py" = [
"S101", # assert-used
]

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
split-on-trailing-comma = false
Loading
Loading