Skip to content

Commit

Permalink
Use python3.9 and add better linter setup
Browse files Browse the repository at this point in the history
  • Loading branch information
zhukovgreen committed Oct 13, 2020
1 parent 43f5a69 commit 11fa2ea
Show file tree
Hide file tree
Showing 13 changed files with 362 additions and 409 deletions.
12 changes: 10 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
[flake8]
application-import-names = platform_mcs
application-import-names = unsupported_pcidevs
import-order-style = smarkets
inline-quotes = double
max-complexity = 15
multiline-quotes = double
ignore=I101, P101
ignore=
A003, A003 "set" is a python builtin, consider renaming the class attribute
I101,
P101,
D100,D101,D102 # Missing doctrings in a public module
D104, # Missing docstring in public package
D401, # First line should be in imperative mood; try rephrasing
D202, # No blank lines allowed after function docstring (conflicts with black)
D107, D103, # Missing docstring in ... (conflicts with interrogate)
22 changes: 13 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,30 @@ lint:
script:
- pre-commit run -av

test-python-3.6:
.test-python-version: &test-python-version
stage: test
variables:
PY_VERSION: "3.6"
script:
- docker-compose run tests

test-python-3.6:
<<: *test-python-version
variables:
PY_VERSION: "3.6"

test-python-3.7:
stage: test
<<: *test-python-version
variables:
PY_VERSION: "3.7"
script:
- docker-compose run tests

test-python-3.8:
stage: test
<<: *test-python-version
variables:
PY_VERSION: "3.8"
script:
- docker-compose run tests

test-python-3.9:
<<: *test-python-version
variables:
PY_VERSION: "3.9"

deploy:pypi:
stage: deploy
Expand Down
50 changes: 35 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,64 +1,84 @@
minimum_pre_commit_version: "2.3.0"
repos:
- repo: "https://github.com/psf/black"
rev: "19.10b0"
rev: "20.8b1"
hooks:
- id: "black"
name: "Format code (black)"
language_version: "python3.8"
language_version: "python3"
exclude: ^docs/.*$

- repo: "https://github.com/asottile/blacken-docs"
rev: "v1.7.0"
rev: "v1.8.0"
hooks:
- id: "blacken-docs"
name: "Format docs (blacken-docs)"
language_version: "python3.8"
language_version: "python3"
args: ["-l", "64"]
additional_dependencies:
- "black==19.10b0"
- "black==20.8b1"

- repo: https://github.com/timothycrosley/isort
rev: 5.1.4
- repo: "https://github.com/timothycrosley/isort"
rev: 5.6.4
hooks:
- id: isort
language_version: "python3"
additional_dependencies: [toml]

- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v3.1.0"
rev: "v3.2.0"
hooks:
- id: "end-of-file-fixer"
- id: "trailing-whitespace"
- id: "check-json"
- id: "check-toml"
- id: "check-yaml"
- id: "check-merge-conflict"

- repo: https://github.com/jorisroovers/gitlint
rev: v0.13.1
hooks:
- id: gitlint

- repo: https://github.com/PyCQA/bandit
rev: "1.6.2"
hooks:
- id: bandit
language_version: "python3"
exclude: ^tests/.*$

- repo: https://github.com/econchick/interrogate
rev: 1.3.1 # or master if you're bold
hooks:
- id: interrogate
language_version: "python3"
args: [tests]

- repo: "https://gitlab.com/PyCQA/flake8"
rev: 3.8.3
rev: 3.8.4
hooks:
- id: "flake8"
name: "Lint code (flake8)"
language_version: "python3.8"
language_version: "python3"
additional_dependencies:
- "flake8==3.7.9"
- "flake8-broken-line==0.2.0"
- "flake8-bugbear==20.1.4"
- "flake8-builtins==1.5.2"
- "flake8-comprehensions==3.2.2"
- "flake8-eradicate==0.3.0"
# - "flake8-import-order==0.18.1"
- "flake8-mutable==1.2.0"
- "flake8-pie==0.5.0"
- "flake8-quotes==3.0.0"
- "flake8-string-format==0.3.0"
- "flake8-tidy-imports==4.1.0"
- "flake8-docstrings==1.5.0"
- "pep8-naming==0.10.0"
exclude: ^docs/.*$

- repo: "https://github.com/pre-commit/mirrors-mypy"
rev: "v0.782"
rev: "v0.790"
hooks:
- id: "mypy"
name: "Lint code (mypy)"
language_version: "python3.8"
exclude: ^docs/.*$
language_version: "python3"
exclude: ^tests/.*$
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 2.1.0 (20 Jul 2020)
# 2.2.0 (13 Oct 2020)
## Features
- Supports python 3.9
- Monthly maintenance update

## Fixes
- using sha256 from hashlib see
Expand Down
1 change: 1 addition & 0 deletions aiohttp_cache/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .middleware import cache_middleware
from .setup import setup_cache


__all__ = (
"AvailableKeys",
"MemoryCache",
Expand Down

0 comments on commit 11fa2ea

Please sign in to comment.