From e2c0aa96ecc7fa206f9d7c5fec96adfc0c187084 Mon Sep 17 00:00:00 2001 From: "repo-helper[bot]" <74742576+repo-helper[bot]@users.noreply.github.com> Date: Thu, 28 Jan 2021 13:48:30 +0000 Subject: [PATCH] Updated files with 'repo_helper'. --- .github/workflows/mypy.yml | 2 +- .isort.cfg | 37 ------------------------ .pre-commit-config.yaml | 8 +++--- CONTRIBUTING.rst | 10 ++++--- doc-source/contributing.rst | 10 ++++--- formate.toml | 56 +++++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- tests/requirements.txt | 1 + tox.ini | 6 ++-- 9 files changed, 78 insertions(+), 54 deletions(-) delete mode 100644 .isort.cfg create mode 100644 formate.toml diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index a15d210..afee01e 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -31,7 +31,7 @@ jobs: python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install tox + python -m pip install --upgrade tox virtualenv - name: "Run mypy" run: "python -m tox -e mypy" diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index abb58ca..0000000 --- a/.isort.cfg +++ /dev/null @@ -1,37 +0,0 @@ - -[settings] -line_length = 115 -force_to_top = True -indent = " " -multi_line_output = 8 -import_heading_stdlib = stdlib -import_heading_thirdparty = 3rd party -import_heading_firstparty = this package -import_heading_localfolder = this package -balanced_wrapping = False -lines_between_types = 0 -use_parentheses = True -default_section = THIRDPARTY -;no_lines_before=LOCALFOLDER -known_third_party = - astroid - click - consolekit - coverage - coverage_pyver_pragma - domdf_python_tools - github - ipython - isort - nbconvert - pre_commit_hooks - pylint - pytest - pytest_cov - pytest_randomly - pytest_rerunfailures - pytest_timeout - requests - yapf_isort -known_first_party = notebook2script -remove_redundant_aliases = True diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e2a990..f99b0b5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -66,11 +66,11 @@ repos: - id: remove-crlf - id: forbid-crlf - - repo: https://github.com/domdfcoding/yapf-isort - rev: v0.5.5 + - repo: https://github.com/repo-helper/formate + rev: v0.2.0 hooks: - - id: yapf-isort - exclude: ^(doc-source/conf|__pkginfo__|make_conda_recipe|setup)\.py$ + - id: formate + exclude: ^(doc-source/conf|__pkginfo__|make_conda_recipe|setup)\.(_)?py$ - repo: https://github.com/domdfcoding/dep_checker rev: v0.4.1 diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 30c34f5..1a04b9e 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -4,7 +4,8 @@ Contributing .. This file based on https://github.com/PyGithub/PyGithub/blob/master/CONTRIBUTING.md -``notebook2script`` uses `tox `_ to automate testing and packaging, and `pre-commit `_ to maintain code quality. +``notebook2script`` uses `tox `_ to automate testing and packaging, +and `pre-commit `_ to maintain code quality. Install ``pre-commit`` with ``pip`` and install the git hook: @@ -17,13 +18,13 @@ Install ``pre-commit`` with ``pip`` and install the git hook: Coding style -------------- -`yapf-isort `_ is used for code formatting. +`formate `_ is used for code formatting. It can be run manually via ``pre-commit``: .. code-block:: bash - $ pre-commit run yapf-isort -a + $ pre-commit run formate -a Or, to run the complete autoformatting suite: @@ -36,7 +37,8 @@ Or, to run the complete autoformatting suite: Automated tests ------------------- -Tests are run with ``tox`` and ``pytest``. To run tests for a specific Python version, such as Python 3.6, run: +Tests are run with ``tox`` and ``pytest``. +To run tests for a specific Python version, such as Python 3.6: .. code-block:: bash diff --git a/doc-source/contributing.rst b/doc-source/contributing.rst index 4087f58..a8e798a 100644 --- a/doc-source/contributing.rst +++ b/doc-source/contributing.rst @@ -4,7 +4,8 @@ Contributing .. This file based on https://github.com/PyGithub/PyGithub/blob/master/CONTRIBUTING.md -``notebook2script`` uses `tox `_ to automate testing and packaging, and `pre-commit `_ to maintain code quality. +``notebook2script`` uses `tox `_ to automate testing and packaging, +and `pre-commit `_ to maintain code quality. Install ``pre-commit`` with ``pip`` and install the git hook: @@ -17,13 +18,13 @@ Install ``pre-commit`` with ``pip`` and install the git hook: Coding style -------------- -`yapf-isort `_ is used for code formatting. +`formate `_ is used for code formatting. It can be run manually via ``pre-commit``: .. prompt:: bash - pre-commit run yapf-isort -a + pre-commit run formate -a Or, to run the complete autoformatting suite: @@ -36,7 +37,8 @@ Or, to run the complete autoformatting suite: Automated tests ------------------- -Tests are run with ``tox`` and ``pytest``. To run tests for a specific Python version, such as Python 3.6, run: +Tests are run with ``tox`` and ``pytest``. +To run tests for a specific Python version, such as Python 3.6: .. prompt:: bash diff --git a/formate.toml b/formate.toml new file mode 100644 index 0000000..4ef88b5 --- /dev/null +++ b/formate.toml @@ -0,0 +1,56 @@ +[hooks] +dynamic_quotes = 10 +collections-import-rewrite = 20 +reformat-generics = 40 +noqa-reformat = 60 +ellipsis-reformat = 70 + +[config] +indent = "\t" +line_length = 115 + +[hooks.yapf] +priority = 30 + +[hooks.isort] +priority = 50 + +[hooks.yapf.kwargs] +yapf_style = ".style.yapf" + +[hooks.isort.kwargs] +line_length = 115 +indent = "\"\t\t\"" +multi_line_output = 8 +import_heading_stdlib = "stdlib" +import_heading_thirdparty = "3rd party" +import_heading_firstparty = "this package" +import_heading_localfolder = "this package" +balanced_wrapping = false +lines_between_types = 0 +use_parentheses = true +remove_redundant_aliases = true +default_section = "THIRDPARTY" +known_third_party = [ + "astroid", + "click", + "coincidence", + "consolekit", + "coverage", + "coverage_pyver_pragma", + "domdf_python_tools", + "github", + "ipython", + "isort", + "nbconvert", + "pre_commit_hooks", + "pylint", + "pytest", + "pytest_cov", + "pytest_randomly", + "pytest_rerunfailures", + "pytest_timeout", + "requests", + "yapf_isort", +] +known_first_party = "notebook2script" diff --git a/pyproject.toml b/pyproject.toml index c6e758f..fba467d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools>=40.6.0", "wheel>=0.34.2"] +requires = [ "setuptools>=40.6.0", "wheel>=0.34.2",] build-backend = "setuptools.build_meta" diff --git a/tests/requirements.txt b/tests/requirements.txt index 58b106f..403fb57 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,3 +1,4 @@ +coincidence>=0.1.0 coverage>=5.1 coverage-pyver-pragma>=0.0.6 domdf-python-tools[testing]>=2.0.1 diff --git a/tox.ini b/tox.ini index 1e8de7c..3b7fdce 100644 --- a/tox.ini +++ b/tox.ini @@ -113,7 +113,7 @@ commands = [flake8] max-line-length = 120 -select = E111 E112 E113 E121 E122 E125 E127 E128 E129 E131 E133 E201 E202 E203 E211 E222 E223 E224 E225 E225 E226 E227 E228 E231 E241 E242 E251 E261 E262 E265 E271 E272 E301 E302 E303 E304 E305 E306 E402 E502 E703 E711 E712 E713 E714 E721 W291 W292 W293 W391 W504 YTT101 YTT102 YTT103 YTT201 YTT202 YTT203 YTT204 YTT301 YTT302 YTT303 STRFTIME001 STRFTIME002 SXL001 PT001 PT002 PT003 PT005 PT006 PT007 PT008 PT009 PT010 PT011 PT012 PT013 PT014 PT015 PT016 PT017 PT018 PT019 PT020 PT021 RST201 RST202 RST203 RST204 RST205 RST206 RST207 RST208 RST210 RST211 RST212 RST213 RST214 RST215 RST216 RST217 RST218 RST219 RST299 RST301 RST302 RST303 RST304 RST305 RST306 RST399 RST401 RST499 RST900 RST901 RST902 RST903 Q001 Q002 Q003 A001 A002 A003 TYP001 TYP002 TYP003 TYP004 TYP005 TYP006 Y001,Y002 Y003 Y004 Y005 Y006 Y007 Y008 Y009 Y010 Y011 Y012 Y013 Y014 Y015 Y090 Y091 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 +select = E111 E112 E113 E121 E122 E125 E127 E128 E129 E131 E133 E201 E202 E203 E211 E222 E223 E224 E225 E225 E226 E227 E228 E231 E241 E242 E251 E261 E262 E265 E271 E272 E301 E303 E304 E305 E306 E402 E502 E703 E711 E712 E713 E714 E721 W291 W292 W293 W391 W504 YTT101 YTT102 YTT103 YTT201 YTT202 YTT203 YTT204 YTT301 YTT302 YTT303 STRFTIME001 STRFTIME002 SXL001 PT001 PT002 PT003 PT005 PT006 PT007 PT008 PT009 PT010 PT011 PT012 PT013 PT014 PT015 PT016 PT017 PT018 PT019 PT020 PT021 RST201 RST202 RST203 RST204 RST205 RST206 RST207 RST208 RST210 RST211 RST212 RST213 RST214 RST215 RST216 RST217 RST218 RST219 RST299 RST301 RST302 RST303 RST304 RST305 RST306 RST399 RST401 RST499 RST900 RST901 RST902 RST903 Q001 Q002 Q003 A001 A002 A003 TYP001 TYP002 TYP003 TYP004 TYP005 TYP006 Y001,Y002 Y003 Y004 Y005 Y006 Y007 Y008 Y009 Y010 Y011 Y012 Y013 Y014 Y015 Y090 Y091 E302 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 exclude = doc-source,.git,__pycache__,old,build,dist,__pkginfo__.py,setup.py,.tox,venv rst-directives = TODO @@ -121,7 +121,7 @@ rst-directives = extras-require per-file-ignores = tests/*: D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 - */*.pyi: D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 + */*.pyi: E302 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 pytest-parametrize-names-type = csv inline-quotes = " multiline-quotes = """ @@ -132,6 +132,7 @@ count = True plugins = coverage_pyver_pragma [coverage:report] +fail_under = 80 exclude_lines = raise AssertionError raise NotImplementedError @@ -140,7 +141,6 @@ exclude_lines = if TYPE_CHECKING: if typing.TYPE_CHECKING: if __name__ == .__main__.: - \.\.\. [check-wheel-contents] ignore = W002