Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
16ed521
Fix GitHub CI and 'tox' for local CI on Ubuntu 24.04
bernhardkaindl Nov 15, 2024
efe4efb
Add checks to compensate code coverage
bernhardkaindl Nov 15, 2024
0c94f63
Cover the code handing a 2nd call of accessor.finish()
bernhardkaindl Nov 15, 2024
32aceac
Fix first half of the pyright warnings in unit tests
bernhardkaindl Nov 15, 2024
d1504af
Fix pylint and 2nd half of the pyright warnings in unit tests
bernhardkaindl Nov 15, 2024
e28224e
pyright: Bump Python version to check for to 3.11
bernhardkaindl Nov 15, 2024
b1c5365
pyright: Fix ErrorHandler taking Response | None
bernhardkaindl Nov 15, 2024
e52d72e
pyright: Skip warning on renamed arg: FTPAccessor.access(name->path)
bernhardkaindl Nov 15, 2024
b5fb04a
tox.ini: Complete the transition from pyre to pyright
bernhardkaindl Nov 15, 2024
cb947a6
pre-commit: Remove the remaining call to pyre in pre-commit
bernhardkaindl Nov 15, 2024
96a73d3
docs: Complete the transition from pyre to pyright
bernhardkaindl Nov 15, 2024
c1ebd7b
`tox.ini/pyright`: Fail `tox` if `pyright` fails (enforce check)
bernhardkaindl Nov 15, 2024
88ad644
pyre: Finally, remove obsolete pyre error suppressions
bernhardkaindl Nov 15, 2024
6357af6
GitHub CI/`tox`: Update CI to use Python `3.11`, `3.12` and `3.13`
bernhardkaindl Nov 15, 2024
ab21598
`test_bootloader.py`/`pylint`: assertRegexpMatches renamed to assertR…
bernhardkaindl Nov 15, 2024
e30a79d
`CONTRIBUTING.md`: Add `venv` setup and using `pipx`
bernhardkaindl Nov 15, 2024
f1b4826
`tests/test_logger.py`: Use `pyfakefs`: don't create a file in the host
bernhardkaindl Nov 15, 2024
fc28eb1
`.github/workflows/main.yml`: Cleanup obsolete code for Python 2.7/3.8
bernhardkaindl Nov 15, 2024
5c544ac
`CONTRIBUTING.md`: Fix Markdown format for linting
bernhardkaindl Nov 15, 2024
ae2bb8e
`README.md`: Fix Markdown format for linting and update it
bernhardkaindl Nov 15, 2024
554e648
`README-Unicode.md`: Fix Markdown format for linting and update it
bernhardkaindl Nov 15, 2024
70d84ba
`.pre-commit-config.yaml`: Replace mdformat check with markdownlint-cli
bernhardkaindl Nov 15, 2024
45a9833
`pre-commit` config: Fix check: python-check-blanket-type-ignore
bernhardkaindl Nov 15, 2024
0630f1f
`.pre-commit-config.yaml`: Fix pre-commit config: pytest, mypy & pylint
bernhardkaindl Nov 15, 2024
63b45d8
`.github/workflows/main.yml`: Add CI job for running pre-commit
bernhardkaindl Nov 15, 2024
bbce126
`pre-commit`: Fix warning about deprecated hook config: Update hooks
bernhardkaindl Nov 15, 2024
393cf4c
`.pre-commit-config.yaml`: Fix pre-commit configuration for pytype
bernhardkaindl Nov 15, 2024
1e573f0
Merge branch 'master' into fix-pre-commit-checks
bernhardkaindl Aug 15, 2025
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
13 changes: 13 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ env:
PIP_DISABLE_PIP_VERSION_CHECK: "1" # Reduce noise in logs

jobs:
pre-commit:
env:
SKIP: pytest,pytype,no-commit-to-branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- uses: pre-commit/action@v3.0.1
- uses: pre-commit-ci/lite-action@v1.0.3
if: always()

test:
strategy:
# See: https://github.com/xenserver/python-libs/pull/26#discussion_r1179482169
Expand Down
49 changes: 34 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# https://github.com/dexpota/cheatsheets/blob/master/pre-commit
exclude: "^tests/data"
fail_fast: true
default_stages: [commit]
default_stages: [pre-commit]
repos:
- repo: local
hooks:
Expand All @@ -47,7 +47,7 @@ repos:
types: [binary]
language: fail
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: no-commit-to-branch
args: [--branch, master]
Expand All @@ -62,19 +62,29 @@ repos:
- isort


- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0 # Use the ref you want to point at
hooks:
# Enforce that `# type: ignore` annotations always occur with specific codes.
# Sample annotation: # type: ignore[attr-defined,name-defined]
- id: python-check-blanket-type-ignore


- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies:
- pyfakefs
- pytest_httpserver
- pytest-subprocess
- types-mock
- types-six
- types-toml


- repo: https://github.com/rcmdnk/pyproject-pre-commit
rev: v0.1.9
rev: v0.3.4
hooks:
- id: shellcheck

Expand All @@ -86,7 +96,7 @@ repos:


- repo: https://github.com/pycqa/pylint
rev: v2.17.4
rev: v3.3.1
hooks:
- id: pylint
args:
Expand All @@ -98,12 +108,16 @@ repos:
]
log_file: ".git/pre-commit-pylint.log"
additional_dependencies:
- pyfakefs
- setuptools
- six
- mock
- pandas
- pyfakefs
- pytest_forked
- pytest_httpserver
- toml


- repo: local
hooks:
- id: pytype
Expand All @@ -114,24 +128,29 @@ repos:
language: python
language_version: python3.8
require_serial: true
additional_dependencies: [pytype]
additional_dependencies:
- pytype
- pyfakefs
- pytest
- pytest_forked
- pytest_httpserver
- pytest_localftpserver
- pytest-subprocess


- id: pytest
name: Check pytest unit tests pass
types: [python]
# entry: sh -c "pytest -x -rf --new-first --show-capture=all >/dev/tty"
entry: sh -c "tox -e py38-covcombine >/dev/tty"
entry: sh -c "tox >/dev/tty"
verbose: true
language: python
require_serial: true
pass_filenames: false
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0 # Use the ref you want to point at
hooks:
# Enforce that `# type: ignore` annotations always occur with specific codes.
# Sample annotations: # type: ignore[attr-defined] # type: ignore[attr-defined,name-defined]
- id: python-check-blanket-type-ignore


- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
2 changes: 1 addition & 1 deletion pytype_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def run_pytype(command: List[str], branch_url: str, errorlog: TextIO, results):
ok = True
while ok:
for key, _ in sel.select():
line = key.fileobj.readline() # type: ignore
line = key.fileobj.readline() # type: ignore[union-attr]
if not line:
ok = False
break
Expand Down
134 changes: 0 additions & 134 deletions stubs/pytest_httpserver.pyi

This file was deleted.

Loading