Skip to content

Commit

Permalink
fix make cov
Browse files Browse the repository at this point in the history
add invoke to run complex scripts
fix pre-commit files to check
update dependencies
  • Loading branch information
zhPavel committed May 21, 2023
1 parent b40ff43 commit 07e9b26
Show file tree
Hide file tree
Showing 32 changed files with 362 additions and 155 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ dmypy.json

/docs/build

.venv/
.venv/
14 changes: 13 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
files: '(src/.*)|(tests/.*)|(tests_helpers/.*)|(^examples/.*)|(docs/examples/tutorial/.*)|(benchmarks/.*)'
files: |-
(?x)
^(?:
(src/.*)
|(tests/.*)
|(tests_helpers/.*)
|(examples/.*)
|(docs/examples/.*)
|(benchmarks/.*)
|(scripts/.*)
|(tasks\.py)
)$
default_stages:
- commit
- push
Expand Down
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ test:

.PHONY: cov
cov:
@coverage erase
@tox -e $$(tox -l | grep -e '^py' | grep -v 'bench' | sort -r | tr '\n' ',') -p auto -- --cov adaptix --cov-append
@coverage xml
@inv cov


.PHONY: setup
Expand All @@ -36,10 +34,7 @@ setup:

.PHONY: deps-compile
deps-compile:
@for file in requirements/raw/*.txt; do pip-compile "$${file}" -o requirements/$$(basename "$$file") -q --resolver=backtracking --allow-unsafe; done
@# pip-compile saves local packages by absolute path, fix it
@for file in requirements/*.txt; do sed -i -E "s/-e file:.+\/tests_helpers/-e .\/tests_helpers/" "$${file}"; done
@for file in requirements/*.txt; do sed -i -E "s/-e file:.+\/benchmarks/-e .\/benchmarks/" "$${file}"; done
@inv deps-compile


.PHONY: venv-sync
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/extended_usage/fields_filtering_type.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# mypy: disable-error-code="arg-type"
from dataclasses import dataclass

from adaptix import Retort, name_mapping, loader, dumper
from adaptix import Retort, dumper, loader, name_mapping


class HiddenStr(str):
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/extended_usage/generic_classes_simple.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass
from typing import TypeVar, Generic, Optional
from typing import Generic, Optional, TypeVar

from adaptix import Retort

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/extended_usage/mapping_to_list.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime
from dataclasses import dataclass
from datetime import datetime

from adaptix import Retort, name_mapping

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/extended_usage/mapping_to_list_map.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime
from dataclasses import dataclass
from datetime import datetime

from adaptix import Retort, name_mapping

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/extended_usage/mapping_to_list_only_map.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime
from dataclasses import dataclass
from datetime import datetime

from adaptix import Retort, name_mapping

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/extended_usage/name_style.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from dataclasses import dataclass
from adaptix import Retort, name_mapping, NameStyle

from adaptix import NameStyle, Retort, name_mapping


@dataclass
Expand Down
1 change: 1 addition & 0 deletions docs/examples/extended_usage/stripping_underscore.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dataclasses import dataclass

from adaptix import Retort


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dataclasses import dataclass

from adaptix import Retort, name_mapping


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass
from typing import Union, Literal
from typing import Literal, Union

from adaptix import Retort

Expand Down
6 changes: 2 additions & 4 deletions requirements/bench.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
annotated-types==0.4.0
# via pydantic
attrs==22.2.0
# via
# cattrs
# pytest
# via cattrs
cattrs==22.2.0
# via -r requirements/raw/bench.txt
contourpy==1.0.7
Expand Down Expand Up @@ -61,7 +59,7 @@ pyparsing==3.0.9
# via matplotlib
pyperf==2.5.0
# via -r requirements/raw/bench.txt
pytest==7.2.2
pytest==7.3.1
# via -r requirements/raw/bench.txt
python-dateutil==2.8.2
# via matplotlib
Expand Down
51 changes: 23 additions & 28 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ annotated-types==0.4.0
# via pydantic
astpath[xpath]==0.9.0
# via -r requirements/raw/lint.txt
astroid==2.15.2
astroid==2.15.5
# via pylint
attrs==22.2.0
attrs==23.1.0
# via
# -r requirements/raw/test_extra_new.txt
# cattrs
# flake8-bugbear
# pytest
babel==2.11.0
# via sphinx
bandit==1.7.5
Expand Down Expand Up @@ -52,10 +51,8 @@ colorama==0.4.6
# tox
contourpy==1.0.7
# via matplotlib
coverage[toml]==7.2.3
# via
# -r requirements/raw/dev.txt
# pytest-cov
coverage==7.2.5
# via -r requirements/raw/dev.txt
cycler==0.11.0
# via matplotlib
dataclass-factory==2.16
Expand All @@ -64,7 +61,7 @@ dill==0.3.6
# via pylint
distlib==0.3.6
# via virtualenv
dlint==0.14.0
dlint==0.14.1
# via -r requirements/raw/lint.txt
docutils==0.18.1
# via
Expand All @@ -89,13 +86,13 @@ flake8==6.0.0
# flake8-mutable
# flake8-noqa
# flake8-polyfill
flake8-bugbear==23.3.23
flake8-bugbear==23.5.9
# via -r requirements/raw/lint.txt
flake8-builtins==2.1.0
# via -r requirements/raw/lint.txt
flake8-cognitive-complexity==0.1.0
# via -r requirements/raw/lint.txt
flake8-comprehensions==3.11.1
flake8-comprehensions==3.12.0
# via -r requirements/raw/lint.txt
flake8-debugger==4.1.2
# via -r requirements/raw/lint.txt
Expand All @@ -107,7 +104,7 @@ flake8-polyfill==1.0.2
# via -r requirements/raw/lint.txt
fonttools==4.38.0
# via matplotlib
furo==2023.3.27
furo==2023.5.20
# via -r requirements/raw/doc.txt
gitdb==4.0.10
# via gitpython
Expand All @@ -123,6 +120,8 @@ imagesize==1.4.1
# via sphinx
iniconfig==2.0.0
# via pytest
invoke==2.1.2
# via -r requirements/raw/dev.txt
isort==5.12.0
# via pylint
jinja2==3.1.2
Expand Down Expand Up @@ -162,7 +161,7 @@ mdurl==0.1.2
# via markdown-it-py
msgspec==0.13.1
# via -r requirements/raw/bench.txt
mypy==1.2.0
mypy==1.3.0
# via -r requirements/raw/lint.txt
mypy-extensions==1.0.0
# via mypy
Expand All @@ -174,7 +173,7 @@ numpy==1.24.2
# via
# contourpy
# matplotlib
packaging==23.0
packaging==23.1
# via
# -r requirements/raw/test_extra_none.txt
# build
Expand All @@ -188,7 +187,7 @@ pbr==5.11.1
# via
# sphinxcontrib-apidoc
# stevedore
phonenumberslite==8.13.8
phonenumberslite==8.13.11
# via -r requirements/raw/test_extra_none.txt
pillow==9.4.0
# via matplotlib
Expand All @@ -203,7 +202,7 @@ pluggy==1.0.0
# via
# pytest
# tox
pre-commit==3.2.2
pre-commit==3.3.2
# via -r requirements/raw/lint.txt
psutil==5.9.4
# via -r requirements/raw/bench.txt
Expand All @@ -222,7 +221,7 @@ pygments==2.14.0
# furo
# rich
# sphinx
pylint==2.17.2
pylint==2.17.4
# via -r requirements/raw/lint.txt
pyparsing==3.0.9
# via matplotlib
Expand All @@ -232,13 +231,10 @@ pyproject-api==1.5.1
# via tox
pyproject-hooks==1.0.0
# via build
pytest==7.2.2
pytest==7.3.1
# via
# -r requirements/raw/bench.txt
# -r requirements/raw/test_extra_none.txt
# pytest-cov
pytest-cov==4.0.0
# via -r requirements/raw/test_extra_none.txt
python-dateutil==2.8.2
# via matplotlib
python-json-logger==2.0.7
Expand Down Expand Up @@ -268,7 +264,7 @@ snowballstemmer==2.2.0
# via sphinx
soupsieve==2.4
# via beautifulsoup4
sphinx==5.3.0
sphinx==6.2.1
# via
# -r requirements/raw/doc.txt
# furo
Expand All @@ -280,9 +276,9 @@ sphinx==5.3.0
# sphinxext-opengraph
sphinx-basic-ng==1.0.0b1
# via furo
sphinx-copybutton==0.5.1
sphinx-copybutton==0.5.2
# via -r requirements/raw/doc.txt
sphinx-design==0.3.0
sphinx-design==0.4.1
# via -r requirements/raw/doc.txt
sphinx-paramlinks==0.5.4
# via -r requirements/raw/doc.txt
Expand All @@ -302,7 +298,7 @@ sphinxcontrib-serializinghtml==1.1.5
# via sphinx
sphinxext-opengraph==0.8.2
# via -r requirements/raw/doc.txt
sqlalchemy==2.0.10
sqlalchemy==2.0.15
# via -r requirements/raw/test_extra_none.txt
stevedore==5.0.0
# via bandit
Expand All @@ -311,7 +307,6 @@ toml==0.10.2
tomli==2.0.1
# via
# build
# coverage
# mypy
# pylint
# pyproject-api
Expand All @@ -320,7 +315,7 @@ tomli==2.0.1
# tox
tomlkit==0.11.6
# via pylint
tox==4.4.11
tox==4.5.1
# via -r requirements/raw/dev.txt
typing-extensions==4.5.0
# via
Expand All @@ -347,11 +342,11 @@ wrapt==1.14.1
# via astroid

# The following packages are considered to be unsafe in a requirements file:
pip==23.0.1
pip==23.1.2
# via
# -r requirements/raw/pre.txt
# pip-tools
setuptools==67.6.1
setuptools==67.8.0
# via
# -r requirements/raw/dev.txt
# cognitive-complexity
Expand Down
8 changes: 4 additions & 4 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ docutils==0.18.1
# sphinx
fonttools==4.39.3
# via matplotlib
furo==2023.3.27
furo==2023.5.20
# via -r requirements/raw/doc.txt
idna==3.4
# via requests
Expand Down Expand Up @@ -82,7 +82,7 @@ snowballstemmer==2.2.0
# via sphinx
soupsieve==2.4
# via beautifulsoup4
sphinx==5.3.0
sphinx==6.2.1
# via
# -r requirements/raw/doc.txt
# furo
Expand All @@ -94,9 +94,9 @@ sphinx==5.3.0
# sphinxext-opengraph
sphinx-basic-ng==1.0.0b1
# via furo
sphinx-copybutton==0.5.1
sphinx-copybutton==0.5.2
# via -r requirements/raw/doc.txt
sphinx-design==0.3.0
sphinx-design==0.4.1
# via -r requirements/raw/doc.txt
sphinx-paramlinks==0.5.4
# via -r requirements/raw/doc.txt
Expand Down
Loading

0 comments on commit 07e9b26

Please sign in to comment.