misc: add pyupgrade (#58937)

This commit is contained in:
Serghei Mihai 2021-11-26 11:23:28 +01:00
parent caa40e7e77
commit f350cf3169
4 changed files with 23 additions and 1 deletions

2
.git-blame-ignore-revs Normal file
View File

@ -0,0 +1,2 @@
# trivial: apply pyupgrade (#58937)
caa40e7e771b41bd1d164341a2e7f40689cbe4ba

8
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,8 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.20.0
hooks:
- id: pyupgrade
args: ['--keep-percent-format', '--py37-plus']

View File

@ -179,3 +179,13 @@ You can put some configuration in ~/.config/eopayment.init ::
order_id : 20201029093825_Vlco55
test : True
transaction_date : 2020-10-29 09:38:26+00:00
Code Style
==========
pyupgrade is used to automatically upgrade syntax, using those parameters:
pyupgrade --keep-percent-format --py37-plus
There is .pre-commit-config.yaml to use pre-commit to automatically pyupgrade
before commits. (execute `pre-commit install` to install the git hook.)

View File

@ -4,7 +4,7 @@
# and then run "tox" from this directory.
[tox]
envlist = py3
envlist = py3,codestyle
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/eopayment/{env:BRANCH_NAME:}
[testenv]
@ -13,6 +13,7 @@ setenv =
SETUPTOOLS_USE_DISTUTILS=stdlib
commands =
py3: py.test {posargs: --junitxml=junit-{envname}.xml --cov-report xml --cov-report html --cov=eopayment/ tests}
codestyle: pre-commit run --all-files --show-diff-on-failure
usedevelop = True
deps = coverage
pytest
@ -21,6 +22,7 @@ deps = coverage
mock<4
httmock
lxml
pre-commit
[pytest]
filterwarnings =