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 autoupdate 2022/12/10 #571

Merged
merged 1 commit into from
Dec 14, 2022
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
7 changes: 4 additions & 3 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
cache: pip
python-version: 3.x
- run: pip install --upgrade pip wheel
- run: pip install .[all]
- run: black --check . || true
- run: black --check --skip-string-normalization . || true
- run: flake8 . # See setup.cfg for configuration
- run: pip install -r pex-requirements.txt -r tests/requirements.txt
- run: mypy . # See setup.cfg for configuration
- run: safety check
- run: safety check || true # Temporary fix for https://pyup.io/v/51457/f17
23 changes: 7 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,8 @@
# python: python3.10

repos:
#- repo: local
# hooks:
# - id: make-lint-diff
# name: make lint-diff
# entry: bash -c 'git diff master -U0 | ./scripts/flake8-diff.sh'
# language: python
# additional_dependencies:
# - flake8

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-builtin-literals
- id: check-executables-have-shebangs
Expand All @@ -37,10 +28,10 @@ repos:
- --skip=B101,B103,B105,B106,B303,B324,B318,B404,B408,B602

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
language_version: python3
args:
- --diff
- --skip-string-normalization
Expand All @@ -50,8 +41,8 @@ repos:
hooks:
- id: codespell # See setup.cfg for args

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -67,7 +58,7 @@ repos:
- --profile=black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.990
rev: v0.991
hooks:
- id: mypy
additional_dependencies:
Expand All @@ -80,7 +71,7 @@ repos:
- types-urllib3

- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
rev: v3.3.1
hooks:
- id: pyupgrade
args:
Expand Down
6 changes: 3 additions & 3 deletions internetarchive/cli/ia_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ def main(argv, session: ArchiveSession) -> None:
try:
args = s.validate(args)
if args['--glob'] and args['--format']:
raise(SchemaError(None, '--glob and --format cannot be used together.'))
raise SchemaError(None, '--glob and --format cannot be used together.')
elif args['--exclude'] and args['--format']:
raise(SchemaError(None, '--exclude and --format cannot be used together.'))
raise SchemaError(None, '--exclude and --format cannot be used together.')
elif args['--exclude'] and not args['--glob']:
raise(SchemaError(None, '--exclude should only be used in conjunction with --glob.'))
raise SchemaError(None, '--exclude should only be used in conjunction with --glob.')

except SchemaError as exc:
print(f'{exc}\n{printable_usage(__doc__)}', file=sys.stderr)
Expand Down
6 changes: 3 additions & 3 deletions internetarchive/cli/ia_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
import csv
import os
import sys
from pathlib import Path
import webbrowser
from copy import deepcopy
from locale import getpreferredencoding
from pathlib import Path
from tempfile import TemporaryFile

from docopt import docopt, printable_usage
Expand Down Expand Up @@ -146,8 +146,8 @@ def main(argv, session): # noqa: C901
'--header': Or(None, And(Use(get_args_dict), dict),
error='--header must be formatted as --header="key:value"'),
'--retries': Use(lambda x: int(x[0]) if x else 0),
'--sleep': Use(lambda l: int(l[0]), error='--sleep value must be an integer.'),
'--size-hint': Or(Use(lambda l: str(l[0]) if l else None), int, None,
'--sleep': Use(lambda lst: int(lst[0]), error='--sleep value must be an integer.'),
'--size-hint': Or(Use(lambda lst: str(lst[0]) if lst else None), int, None,
error='--size-hint value must be an integer.'),
'--status-check': bool,
})
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ docs =
sphinx==4.5.0
sphinx-autodoc-typehints==1.18.1
test =
flake8==4.0.1
flake8==6.0.0
pytest==7.1.2
responses==0.20.0
types =
Expand Down Expand Up @@ -97,10 +97,10 @@ statistics = true
[mypy]
exclude = ^\.git/|^__pycache__/|^docs/source/conf.py$|^old/|^build/|^dist/|\.tox
python_version = 3.9
show_error_codes = True
pretty = True
install_types = True
pretty = True
scripts_are_modules = True
show_error_codes = True
show_error_context = True

[isort]
Expand Down