Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #1583

Merged
merged 3 commits into from
Aug 24, 2023
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.284
rev: v0.0.285
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -31,7 +31,7 @@ repos:
args: [--include-version-classifiers, --min-py-version=3.8, --max-py-version=3.11]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.0
rev: v1.5.1
hooks:
- id: mypy
name: mypy 3.8 on cibuildwheel/
Expand Down
5 changes: 3 additions & 2 deletions bin/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def bump_version() -> None:
print(e)
print("Failed to get previous version tag information.")

git_changes_result = subprocess.run(["git diff-index --quiet HEAD --"], shell=True)
git_changes_result = subprocess.run(["git diff-index --quiet HEAD --"], shell=True, check=False)
repo_has_uncommitted_changes = git_changes_result.returncode != 0

if repo_has_uncommitted_changes:
Expand Down Expand Up @@ -142,7 +142,8 @@ def bump_version() -> None:
"pre-commit",
"run",
"--files=docs/changelog.md",
]
],
check=False,
)

# run pre-commit to check that no errors occurred on the second run
Expand Down
10 changes: 5 additions & 5 deletions bin/make_dependency_update_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
import click


def shell(cmd, **kwargs):
return run([cmd], shell=True, **kwargs)
def shell(cmd, *, check: bool, **kwargs):
return run([cmd], shell=True, check=check, **kwargs)


def git_repo_has_changes():
unstaged_changes = shell("git diff-index --quiet HEAD --").returncode != 0
staged_changes = shell("git diff-index --quiet --cached HEAD --").returncode != 0
unstaged_changes = shell("git diff-index --quiet HEAD --", check=False).returncode != 0
staged_changes = shell("git diff-index --quiet --cached HEAD --", check=False).returncode != 0
return unstaged_changes or staged_changes


Expand Down Expand Up @@ -73,7 +73,7 @@ def main():
print("Done.")
finally:
# remove any local changes
shell("git checkout -- .")
shell("git checkout -- .", check=True)
shell(f"git checkout {previous_branch}", check=True)
shell(f"git branch -D --force {branch_name}", check=True)

Expand Down
10 changes: 5 additions & 5 deletions bin/run_example_ci_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
import click


def shell(cmd, **kwargs):
return run([cmd], shell=True, **kwargs)
def shell(cmd, *, check: bool, **kwargs):
return run([cmd], shell=True, check=check, **kwargs)


def git_repo_has_changes():
unstaged_changes = shell("git diff-index --quiet HEAD --").returncode != 0
staged_changes = shell("git diff-index --quiet --cached HEAD --").returncode != 0
unstaged_changes = shell("git diff-index --quiet HEAD --", check=False).returncode != 0
staged_changes = shell("git diff-index --quiet --cached HEAD --", check=False).returncode != 0
return unstaged_changes or staged_changes


Expand Down Expand Up @@ -163,7 +163,7 @@ def run_example_ci_configs(config_files=None):
finally:
# remove any local changes
shutil.rmtree(example_project, ignore_errors=True)
shell("git checkout -- .")
shell("git checkout -- .", check=True)
shell(f"git checkout {previous_branch}", check=True)
shell(f"git branch -D --force {branch_name}", check=True)

Expand Down
6 changes: 5 additions & 1 deletion bin/sample_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@
check=True,
)

sys.exit(subprocess.run([sys.executable, "-m", "cibuildwheel"], cwd=project_dir).returncode)
sys.exit(
subprocess.run(
[sys.executable, "-m", "cibuildwheel"], cwd=project_dir, check=False
).returncode
)
2 changes: 1 addition & 1 deletion bin/update_how_it_works_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def main():
subprocess.run(["mkdocs", "build"])
subprocess.run(["mkdocs", "build"], check=True)

hti = Html2Image(custom_flags=["--force-device-scale-factor=2"])

Expand Down