Skip to content

Update precommit hooks #16

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

Merged
merged 2 commits into from
Aug 25, 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
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
# for error classes selected below.

[flake8]
max-line-length = 80
max-line-length = 88
select = C,E,F,W,B,B950
ignore = E501, W503
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- '*.*'
- "*.*"

jobs:
release:
Expand All @@ -14,8 +14,8 @@ jobs:
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
architecture: 'x64'
python-version: "3.10"
architecture: "x64"

- name: Install flit
run: pip install flit
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ jobs:
python-version: ["3.10"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[test]"
pip install ".[lint]"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[test]"
pip install ".[lint]"

- name: Lint
run: pre-commit run --all-files --show-diff-on-failure --color always
- name: Lint
run: pre-commit run --all-files --show-diff-on-failure --color always

- name: Test
run: |
PYTHONPATH=. pytest
- name: Test
run: |
PYTHONPATH=. pytest
28 changes: 23 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,39 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- id: check-ast
- id: mixed-line-ending
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-json
- id: check-toml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.6.0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
rev: 5.0.4
hooks:
- id: flake8
pass_filenames: true
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
files: \.(html|md|yml|yaml)
args: [--prose-wrap=preserve]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ the imports. However, if used with the above pattern, this results in code
duplication, as you now need to declare your submodules and attributes in two places.

You can infer the `submodules` and `submod_attrs` arguments (explicitly provided
above to `lazy.attach`) from a stub adjacent to the `.py` file by using the
above to `lazy.attach`) from a stub adjacent to the `.py` file by using the
`lazy.attach_stub` function.

Carrying on with the example above:
Expand Down Expand Up @@ -110,7 +110,7 @@ to include `*.pyi` files.
### Early failure

With lazy loading, missing imports no longer fail upon loading the
library. During development and testing, you can set the `EAGER_IMPORT`
library. During development and testing, you can set the `EAGER_IMPORT`
environment variable to disable lazy loading.

### External libraries
Expand Down