Skip to content

Commit

Permalink
refactor dev tools
Browse files Browse the repository at this point in the history
  • Loading branch information
inyutin committed Aug 3, 2022
1 parent e06100b commit 0b4c116
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 27 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements_ci.txt
- name: Lint with flake8
run: flake8 ./aiohttp_retry ./tests/

- name: Lint with isort
run: isort aiohttp_retry/ tests/ --check
- name: Lint with pre-commit config
run: pre-commit run --all-files

- name: Test with mypy
run: mypy -m aiohttp_retry
Expand Down
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
files: 'aiohttp_retry/.*'
stages:
- commit
- push
- id: isort
files: 'tests/.*'
stages:
- commit
- push
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: 'v1.6.0' # Use the sha / tag you want to point at
hooks:
- id: autopep8
files: 'aiohttp_retry'
stages:
- commit
- push
- id: autopep8
files: 'tests'
stages:
- commit
- push
1 change: 1 addition & 0 deletions aiohttp_retry/retry_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def get_timeout(self, attempt: int) -> float:

class JitterRetry(ExponentialRetry):
"""https://github.com/inyutin/aiohttp_retry/issues/44"""

def __init__(
self,
attempts: int = 3, # How many times we should retry
Expand Down
12 changes: 0 additions & 12 deletions mypy.ini

This file was deleted.

24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[tool.mypy]
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true

warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_return_any = true
warn_unreachable = true

[tool.isort]
multi_line_output = 3
line_length = 88
include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true

[tool.autopep8]
max_line_length = 127
in-place = true
recursive = true
3 changes: 2 additions & 1 deletion requirements_ci.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
flake8==4.0.1
autopep8==1.6.0
pytest==7.1.2
pytest-aiohttp==1.0.4
pytest-cov==3.0.0
mypy==0.961
isort==5.10.1
pre-commit==2.20.0
9 changes: 0 additions & 9 deletions tox.ini

This file was deleted.

0 comments on commit 0b4c116

Please sign in to comment.