Skip to content
Open
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ default_install_hook_types: [pre-commit, commit-msg]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v6.0.0
hooks:
- id: no-commit-to-branch
- id: check-added-large-files
Expand All @@ -22,25 +22,25 @@ repos:
- id: trailing-whitespace
# ruff must before black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.7
rev: v0.15.10
hooks:
- id: ruff
alias: ruff # NOTE: don't change this alias, it's used in `ver_sync.py`, keep consistent with `pyproject.toml`
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.11.0
rev: 26.3.1
hooks:
- id: black
alias: black # NOTE: don't change this alias, it's used in `ver_sync.py`, keep consistent with `pyproject.toml`
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.4.2
hooks:
- id: codespell
alias: codespell # NOTE: don't change this alias, it's used in `ver_sync.py`, keep consistent with `pyproject.toml`
additional_dependencies:
- tomli
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.10.0
rev: v9.24.0
hooks:
- id: commitlint
stages: [commit-msg]
Expand Down
12 changes: 4 additions & 8 deletions hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,10 @@ def _get_tag_4_build_by_env() -> Union[Tag4Build, None]:
if tag.whl_platform == build_tag:
return tag
else:
msg = dedent(
f"""\
msg = dedent(f"""\
Invalid '{BUILD_TAG_ENV_VAR_NAME}' env var: {build_tag}
Only support: {', '.join(tag.whl_platform for tag in tag_4_build_enum)}
"""
)
""")
raise RuntimeError(msg)


Expand All @@ -100,13 +98,11 @@ def get_tag_4_build() -> Tag4Build:
"""获取构建平台的tag."""
tag = _get_tag_4_build_by_env() or _get_tag_4_build_by_platform()
if tag is None:
msg = dedent(
f"""\
msg = dedent(f"""\
Can't find tag for build.
Please set '{BUILD_TAG_ENV_VAR_NAME}' env var or run this building on supported platform.
supported platform: {', '.join(tag.whl_platform for tag in tag_4_build_enum)}
"""
)
""")
raise RuntimeError(msg)
return tag

Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ dependencies = [
# NOTE: 👇
# The versions of `black`, `ruff`, `codespell`, must be consistent with the `.pre-commit-config.yaml`.
# Don't edit them manually, use `pre-commit run ver_sync` instead.
"black==23.11.0",
"ruff==0.1.7",
"codespell==2.2.6",
"black==26.3.1",
"ruff==0.15.10",
"codespell==2.4.2",
# Don't write comments on these lines, because they will be removed by `pre-commit run ver_sync`.
# NOTE: 👆

Expand Down
1 change: 0 additions & 1 deletion scripts/pre_commit_scripts/ver_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

"""Maintain lint tools version consistency between `.pre-commit-config.yaml` and `pyproject.toml`."""


# https://packaging.pypa.io/en/stable/requirements.html
# https://yaml.readthedocs.io/en/latest/example/
# https://tomlkit.readthedocs.io/en/latest/quickstart/
Expand Down
Loading