Skip to content

Commit

Permalink
Move build_pr_changes.py -> cli/check.py, clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardkaindl committed Oct 24, 2024
1 parent 1ca9a3e commit 137a3aa
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 19 deletions.
14 changes: 3 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,11 @@ repos:
exclude: cli/_vendor

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.12.0
rev: v1.13.0
hooks:
- id: mypy
name: Run mypy
exclude: cli/_vendor
additional_dependencies:
- pexpect

- repo: local
hooks:
Expand All @@ -100,15 +98,13 @@ repos:
- id: markdownlint

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.385
rev: v1.1.386
hooks:
- id: pyright
name: Run pyright
exclude: cli/_vendor
additional_dependencies:
- pexpect
- typing-extensions
- types-pexpect

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
Expand All @@ -130,14 +126,10 @@ repos:
# that also the GitHub Action currently uses:
# language_version: "3.10"
name: Run pytype
additional_dependencies: [pexpect]
args: ['build_pr_changes.py']
args: ['cli/check.py']

- repo: https://github.com/pylint-dev/pylint
rev: v3.3.1
hooks:
- id: pylint
exclude: cli/_vendor
additional_dependencies:
- pexpect
- types-pexpect
2 changes: 1 addition & 1 deletion cli/_vendor/pexpect/spawnbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .expect import Expecter, searcher_string, searcher_re

PY3 = (sys.version_info[0] >= 3)
text_type = str if PY3 else unicode
text_type = str if PY3 else unicode # type:ignore[name-defined]

class _NullCoder(object):
"""Pass bytes through unchanged."""
Expand Down
8 changes: 1 addition & 7 deletions build_pr_changes.py → cli/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@
from subprocess import getoutput
from typing import Any, Dict, List, Tuple, TypeAlias

try:
import pexpect
except ImportError:
print("pexpect missing, please run:")
print("sudo apt-get -y install python3-pexpect || pip3 install pexpect")
sys.exit(1)

from _vendor import pexpect

ExitCode: TypeAlias = int
Success: ExitCode = 0
Expand Down
1 change: 1 addition & 0 deletions gh-spack-pr
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ ignore = ['']
# extraPaths = ['']

[tool.pytype]
inputs = ["cli/check.py"]
exclude = ["cli/_vendor/**"]

0 comments on commit 137a3aa

Please sign in to comment.