Skip to content

Commit

Permalink
ci: Migrate from Makefile to tox.ini for local testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay-Lysenko committed Feb 25, 2024
1 parent c73ae9b commit 8f589e0
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 63 deletions.
20 changes: 0 additions & 20 deletions .coveragerc

This file was deleted.

42 changes: 0 additions & 42 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion git_hooks/pre_commit_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def lint() -> None:
"""Analyze code statically."""
rel_path_to_repo_root = '../../' # It is assumed that script is located at `.git/hooks`.
abs_path_to_repo_root = convert_to_absolute_path(rel_path_to_repo_root)
result = subprocess.run('make lint', cwd=abs_path_to_repo_root, shell=True)
result = subprocess.run('tox -e lint', cwd=abs_path_to_repo_root, shell=True)
return_code = result.returncode
if return_code:
raise ValueError('Lint target failed.')
Expand Down
35 changes: 35 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,45 +1,80 @@
attrs==23.2.0
blinker==1.7.0
build==1.0.3
cachetools==5.3.2
certifi==2024.2.2
cffi==1.16.0
chardet==5.2.0
charset-normalizer==3.3.2
click==8.1.7
codecov==2.1.13
colorama==0.4.6
colorclass==2.2.2
coverage==7.4.1
cryptography==42.0.5
distlib==0.3.8
docopt==0.6.2
docutils==0.20.1
exceptiongroup==1.2.0
filelock==3.13.1
flake8==7.0.0
flake8-docstrings==1.7.0
flake8-polyfill==1.0.2
Flask==3.0.2
Flask-Markdown==0.3
Flask-Misaka==1.0.1
idna==3.6
importlib-metadata==7.0.1
iniconfig==2.0.0
itsdangerous==2.1.2
jaraco.classes==3.3.1
jeepney==0.8.0
Jinja2==3.1.3
joblib==1.3.2
keyring==24.3.0
Markdown==3.5.2
markdown-it-py==3.0.0
MarkupSafe==2.1.5
mccabe==0.7.0
mdurl==0.1.2
misaka==2.1.1
more-itertools==10.2.0
nh3==0.2.15
nltk==3.8.1
packaging==23.2
pip-upgrader==1.4.15
pkginfo==1.9.6
platformdirs==4.2.0
pluggy==1.4.0
py==1.11.0
pycodestyle==2.11.1
pycparser==2.21
pydocstyle==6.3.0
pyflakes==3.2.0
Pygments==2.17.2
pyparsing==3.1.1
pyproject-api==1.6.1
pyproject_hooks==1.0.0
pytest==8.0.1
pytest-cov==4.1.0
python-markdown-math==0.8
readme-renderer==42.0
regex==2023.12.25
requests==2.31.0
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.7.0
SecretStorage==3.3.3
six==1.16.0
snowballstemmer==2.2.0
terminaltables==3.1.10
toml==0.10.2
tomli==2.0.1
tox==4.13.0
tqdm==4.66.2
twine==5.0.0
urllib3==2.2.1
uWSGI==2.0.24
virtualenv==20.25.1
Werkzeug==3.0.1
zipp==3.17.0
1 change: 1 addition & 0 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ flake8==7.0.0
flake8-docstrings==1.7.0
pytest==8.0.1
pytest-cov==4.1.0
tox==4.13.0
42 changes: 42 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
[tox]
requires =
tox>=4
env_list = lint, py{310,311,312}

[testenv]
description = run unit tests
deps =
pytest>=7
pytest-cov
commands =
pytest --cov=readingbricks {posargs}

[testenv:lint]
description = run linters
skip_install = true
deps =
flake8
flake8-docstrings
commands = flake8 readingbricks tests git_hooks

[coverage:run]
branch = True
source = readingbricks
omit =
*/__main__.py
readingbricks/app_for_server.py

[coverage:report]
exclude_lines =
pragma: no cover
def __repr__
if .debug:
raise AssertionError
raise NotImplementedError
raise RuntimeError
raise AttributeError
raise ValueError
raise TypeError
if __name__ == .__main__.:
pass

[flake8]
ignore =
W503
Expand Down

0 comments on commit 8f589e0

Please sign in to comment.