Skip to content

Commit

Permalink
Use pre-commit in tox
Browse files Browse the repository at this point in the history
  • Loading branch information
jl-wynen committed Jan 16, 2023
1 parent bdbe60b commit 026b31b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 70 deletions.
6 changes: 1 addition & 5 deletions requirements/static.in
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
flake8
nbstripout
toml
tox
yapf
pre-commit
77 changes: 17 additions & 60 deletions requirements/static.txt
Original file line number Diff line number Diff line change
@@ -1,70 +1,27 @@
# SHA1:1ae14843fff4b22dd16da520170445443705c399
#
# This file is autogenerated by pip-compile-multi
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile-multi
# pip-compile requirements/static.in
#
attrs==22.2.0
# via jsonschema
cachetools==5.2.0
# via tox
chardet==5.1.0
# via tox
colorama==0.4.6
# via tox
cfgv==3.3.1
# via pre-commit
distlib==0.3.6
# via virtualenv
fastjsonschema==2.16.2
# via nbformat
filelock==3.9.0
# via
# tox
# virtualenv
flake8==6.0.0
# via -r requirements/static.in
jsonschema==4.17.3
# via nbformat
jupyter-core==5.1.2
# via nbformat
mccabe==0.7.0
# via flake8
nbformat==5.7.1
# via nbstripout
nbstripout==0.6.1
# via -r requirements/static.in
packaging==22.0
# via
# pyproject-api
# tox
# via virtualenv
identify==2.5.13
# via pre-commit
nodeenv==1.7.0
# via pre-commit
platformdirs==2.6.2
# via
# jupyter-core
# tox
# virtualenv
pluggy==1.0.0
# via tox
pycodestyle==2.10.0
# via flake8
pyflakes==3.0.1
# via flake8
pyproject-api==1.2.1
# via tox
pyrsistent==0.19.3
# via jsonschema
toml==0.10.2
# via -r requirements/static.in
tomli==2.0.1
# via
# pyproject-api
# tox
tox==4.1.3
# via virtualenv
pre-commit==2.21.0
# via -r requirements/static.in
traitlets==5.8.0
# via
# jupyter-core
# nbformat
pyyaml==6.0
# via pre-commit
virtualenv==20.17.1
# via tox
yapf==0.32.0
# via -r requirements/static.in
# via pre-commit

# The following packages are considered to be unsafe in a requirements file:
# setuptools
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ description = Code formatting and static analysis
basepython = python3.8
skip_install = true
deps = -r requirements/static.txt
allowlist_externals = find
commands =
nbstripout --extra-keys 'metadata.language_info.version cell.metadata.jp-MarkdownHeadingCollapsed' --drop-empty-cells .
yapf --recursive --in-place src tests
flake8 .
allowlist_externals = sh
# The first run of pre-commit may reformat files. If this happens, it returns 1 but this
# should not fail the job. So just run again if it fails. A second failure means that
# either the different formatters can't agree on a format or that static analysis failed.
commands = sh -c 'pre-commit run -a || (echo "" && pre-commit run -a)'

0 comments on commit 026b31b

Please sign in to comment.