Skip to content

Commit

Permalink
chore: bump pre-commit (#679)
Browse files Browse the repository at this point in the history
* chore: bump pre-commit

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

* ci: macos-latest now points at macos-14, which is ARM

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

---------

Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii authored Apr 26, 2024
1 parent 6decc98 commit d37beda
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.6", "3.8", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
include:
- python-version: 'pypy-3.8'
os: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ci:
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
rev: "v4.6.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -20,22 +20,22 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.3"
rev: "v0.4.2"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.6.1"
rev: "v1.10.0"
hooks:
- id: mypy
files: plumbum
args: []
additional_dependencies: [typed-ast, types-paramiko, types-setuptools, pytest]

- repo: https://github.com/abravalheri/validate-pyproject
rev: "v0.15"
rev: "v0.16"
hooks:
- id: validate-pyproject

Expand Down
3 changes: 1 addition & 2 deletions experiments/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ def path(self, *parts):
def __getitem__(self, progname):
if not isinstance(progname, str):
raise TypeError(
"progname must be a string, not %r"
% (
"progname must be a string, not {!r}".format(
type(
progname,
)
Expand Down
2 changes: 1 addition & 1 deletion plumbum/cli/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def _validate_args(self, swfuncs, tailargs):
else sig.return_annotation
)
if sys.version_info < (3, 10) and isinstance(annotation, str):
annotation = eval(annotation) # noqa: PGH001
annotation = eval(annotation)
if item == m.varargs:
varargs = annotation
elif item != "return":
Expand Down
1 change: 0 additions & 1 deletion plumbum/cli/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
--------------------------
"""


import contextlib
import os
import sys
Expand Down
2 changes: 1 addition & 1 deletion plumbum/cli/termsize.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _ioctl_GWINSZ(fd: int) -> Optional[Tuple[int, int]]:
import termios

# TODO: Clean this up. Problems could be hidden by the broad except.
return yx.unpack(fcntl.ioctl(fd, termios.TIOCGWINSZ, b"1234")) # type: ignore[return-value]
return yx.unpack(fcntl.ioctl(fd, termios.TIOCGWINSZ, b"1234"))
except Exception:
return None

Expand Down
1 change: 0 additions & 1 deletion plumbum/colorlib/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
to recover terminal color.
"""


from . import main

main()
1 change: 0 additions & 1 deletion plumbum/colorlib/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Color-related factories. They produce Styles.
"""


import functools
import operator
import sys
Expand Down
1 change: 1 addition & 0 deletions plumbum/colorlib/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
You can access the index of the colors with names.index(name). You can access the
rgb values with ``r=int(html[n][1:3],16)``, etc.
"""

from typing import Tuple

color_names = """\
Expand Down
1 change: 0 additions & 1 deletion plumbum/colorlib/styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
With the ``Style`` class, any color can be directly called or given to a with statement.
"""


import contextlib
import os
import platform
Expand Down
1 change: 0 additions & 1 deletion plumbum/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
all the standard syntax for colors.
"""


import atexit
import sys

Expand Down
2 changes: 1 addition & 1 deletion plumbum/commands/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def iter_lines(

if buffer_size is None:
buffer_size = DEFAULT_BUFFER_SIZE
buffer_size: int
buffer_size: int # type: ignore[annotation-unchecked]

assert mode in (BY_POSITION, BY_TYPE)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ build.hooks.vcs.version-file = "plumbum/version.py"

[tool.mypy]
files = ["plumbum"]
python_version = "3.7"
python_version = "3.8"
warn_unused_configs = true
warn_unused_ignores = true
show_error_codes = true
Expand Down
8 changes: 4 additions & 4 deletions tests/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,11 @@ def test_encoding(self):
with self._connect() as rem:
unicode_half = b"\xc2\xbd".decode("utf8")

ret = rem["bash"]("-c", 'echo -e "\xC2\xBD"')
assert ret == "%s\n" % unicode_half
ret = rem["bash"]("-c", 'echo -e "\xc2\xbd"')
assert ret == f"{unicode_half}\n"

ret = list(rem["bash"]["-c", 'echo -e "\xC2\xBD"'].popen())
assert ret == [["%s\n" % unicode_half, None]]
ret = list(rem["bash"]["-c", 'echo -e "\xc2\xbd"'].popen())
assert ret == [[f"{unicode_half}\n", None]]

def test_path_open_remote_write_local_read(self):
with self._connect() as rem:
Expand Down

0 comments on commit d37beda

Please sign in to comment.