Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#1583)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.284 → v0.0.285](astral-sh/ruff-pre-commit@v0.0.284...v0.0.285)
- [github.com/pre-commit/mirrors-mypy: v1.5.0 → v1.5.1](pre-commit/mirrors-mypy@v1.5.0...v1.5.1)

* chore: add check arguments

Signed-off-by: Henry Schreiner <[email protected]>

* Update bin/bump_version.py

Co-authored-by: Joe Rickerby <[email protected]>

---------

Signed-off-by: Henry Schreiner <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <[email protected]>
Co-authored-by: Joe Rickerby <[email protected]>
  • Loading branch information
3 people authored Aug 24, 2023
1 parent 18ff2c5 commit e8bb208
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
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

0 comments on commit e8bb208

Please sign in to comment.