From 8b25ae240ff86ae724c543a1235b900501c111be Mon Sep 17 00:00:00 2001 From: "repo-helper[bot]" <74742576+repo-helper[bot]@users.noreply.github.com> Date: Mon, 7 Dec 2020 23:10:24 +0000 Subject: [PATCH] Updated files with 'repo_helper'. --- .github/workflows/flake8.yml | 32 ++++++++++++++++++++++++ .github/workflows/mypy.yml | 36 +++++++++++++++++++++++++++ .github/workflows/octocheese.yml | 1 + .github/workflows/python_ci.yml | 19 ++++++++------ .github/workflows/python_ci_linux.yml | 21 ++++++++++------ .github/workflows/python_ci_macos.yml | 20 +++++++++------ .pre-commit-config.yaml | 3 +++ README.rst | 2 +- doc-source/conf.py | 2 -- setup.cfg | 2 +- tests/requirements.txt | 2 +- tox.ini | 11 ++++---- 12 files changed, 120 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/flake8.yml create mode 100644 .github/workflows/mypy.yml diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml new file mode 100644 index 0000000..177294b --- /dev/null +++ b/.github/workflows/flake8.yml @@ -0,0 +1,32 @@ +# This file is managed by 'repo_helper'. Don't edit it directly. +--- +name: Flake8 + +on: + push: + pull_request: + branches: ["master"] + +jobs: + Run: + name: "Flake8" + runs-on: "ubuntu-18.04" + + steps: + - name: Checkout 🛎️ + uses: "actions/checkout@v2" + + - name: Setup Python 🐍 + uses: "actions/setup-python@v2" + with: + python-version: "3.8" + + - name: Install dependencies 🔧 + run: | + python -VV + python -m site + python -m pip install --upgrade pip setuptools wheel + python -m pip install tox + + - name: "Run Flake8" + run: "python -m tox -e lint -- --format github" diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml new file mode 100644 index 0000000..63da836 --- /dev/null +++ b/.github/workflows/mypy.yml @@ -0,0 +1,36 @@ +# This file is managed by 'repo_helper'. Don't edit it directly. +--- +name: mypy + +on: + push: + pull_request: + branches: ["master"] + +jobs: + Run: + name: "mypy" + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - name: Checkout 🛎️ + uses: "actions/checkout@v2" + + - name: Setup Python 🐍 + uses: "actions/setup-python@v2" + with: + python-version: "3.8" + + - name: Install dependencies 🔧 + run: | + python -VV + python -m site + python -m pip install --upgrade pip setuptools wheel + python -m pip install tox + + - name: "Run mypy" + run: "python -m tox -e mypy" diff --git a/.github/workflows/octocheese.yml b/.github/workflows/octocheese.yml index 854da13..b323444 100644 --- a/.github/workflows/octocheese.yml +++ b/.github/workflows/octocheese.yml @@ -16,3 +16,4 @@ jobs: pypi_name: "consolekit" env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + if: startsWith(github.ref, 'refs/tags/') != true diff --git a/.github/workflows/python_ci.yml b/.github/workflows/python_ci.yml index 8fadc8e..452f820 100644 --- a/.github/workflows/python_ci.yml +++ b/.github/workflows/python_ci.yml @@ -9,7 +9,7 @@ on: jobs: tests: - name: "Python ${{ matrix.python-version }}" + name: "Python ${{ matrix.config.python-version }}" runs-on: "windows-2019" env: USING_COVERAGE: '3.6,3.7,3.8,3.9' @@ -17,22 +17,27 @@ jobs: strategy: fail-fast: False matrix: - python-version: ["3.6","3.7","3.8","3.9"] + config: + - {python-version: "3.6", testenvs: "py36,build"} + - {python-version: "3.7", testenvs: "py37,build"} + - {python-version: "3.8", testenvs: "py38,build"} + - {python-version: "3.9", testenvs: "py39,build"} steps: - name: Checkout 🛎️ uses: "actions/checkout@v2" + - name: Setup Python 🐍 uses: "actions/setup-python@v2" with: - python-version: "${{ matrix.python-version }}" + python-version: "${{ matrix.config.python-version }}" + - name: Install dependencies 🔧 run: | python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade tox tox-gh-actions virtualenv - + python -m pip install --upgrade tox virtualenv - - name: "Run Tests for Python ${{ matrix.python-version }}" - run: "python -m tox" + - name: "Run Tests for Python ${{ matrix.config.python-version }}" + run: "python -m tox -e ${{ matrix.config.testenvs }}" diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index 729a6d7..053977b 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -9,7 +9,7 @@ on: jobs: tests: - name: "Python ${{ matrix.python-version }}" + name: "Python ${{ matrix.config.python-version }}" runs-on: "ubuntu-18.04" env: USING_COVERAGE: '3.6,3.7,3.8,3.9,pypy3' @@ -17,31 +17,38 @@ jobs: strategy: fail-fast: False matrix: - python-version: ["3.6","3.7","3.8","3.9","pypy3"] + config: + - {python-version: "3.6", testenvs: "py36,build"} + - {python-version: "3.7", testenvs: "py37,build"} + - {python-version: "3.8", testenvs: "py38,build"} + - {python-version: "3.9", testenvs: "py39,build"} + - {python-version: "pypy3", testenvs: "pypy3,build"} steps: - name: Checkout 🛎️ uses: "actions/checkout@v2" + - name: Setup Python 🐍 uses: "actions/setup-python@v2" with: - python-version: "${{ matrix.python-version }}" + python-version: "${{ matrix.config.python-version }}" + - name: Install dependencies 🔧 run: | python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade tox tox-gh-actions virtualenv + python -m pip install --upgrade tox virtualenv python -m pip install --upgrade coverage_pyver_pragma - - name: "Run Tests for Python ${{ matrix.python-version }}" - run: "python -m tox" + - name: "Run Tests for Python ${{ matrix.config.python-version }}" + run: "python -m tox -e ${{ matrix.config.testenvs }}" - name: "Upload Coverage" uses: actions/upload-artifact@v2 with: - name: "coverage-${{ matrix.python-version }}" + name: "coverage-${{ matrix.config.python-version }}" path: .coverage diff --git a/.github/workflows/python_ci_macos.yml b/.github/workflows/python_ci_macos.yml index 44f4e75..a0d7da6 100644 --- a/.github/workflows/python_ci_macos.yml +++ b/.github/workflows/python_ci_macos.yml @@ -9,7 +9,7 @@ on: jobs: tests: - name: "Python ${{ matrix.python-version }}" + name: "Python ${{ matrix.config.python-version }}" runs-on: "macos-latest" env: USING_COVERAGE: '3.6,3.7,3.8,3.9,pypy3' @@ -17,22 +17,28 @@ jobs: strategy: fail-fast: False matrix: - python-version: ["3.6","3.7","3.8","3.9","pypy3"] + config: + - {python-version: "3.6", testenvs: "py36,build"} + - {python-version: "3.7", testenvs: "py37,build"} + - {python-version: "3.8", testenvs: "py38,build"} + - {python-version: "3.9", testenvs: "py39,build"} + - {python-version: "pypy3", testenvs: "pypy3,build"} steps: - name: Checkout 🛎️ uses: "actions/checkout@v2" + - name: Setup Python 🐍 uses: "actions/setup-python@v2" with: - python-version: "${{ matrix.python-version }}" + python-version: "${{ matrix.config.python-version }}" + - name: Install dependencies 🔧 run: | python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade tox tox-gh-actions virtualenv - + python -m pip install --upgrade tox virtualenv - - name: "Run Tests for Python ${{ matrix.python-version }}" - run: "python -m tox" + - name: "Run Tests for Python ${{ matrix.config.python-version }}" + run: "python -m tox -e ${{ matrix.config.testenvs }}" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 257f765..1a28a73 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,6 +44,9 @@ repos: rev: v1.7.0 hooks: - id: python-no-eval + - id: rst-backticks + - id: rst-directive-colons + - id: rst-inline-touching-normal - repo: https://github.com/asottile/pyupgrade rev: v2.7.4 diff --git a/README.rst b/README.rst index 2b20af1..34165dd 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,7 @@ Spun out from `repo_helper `_. Needs - |license| |language| |requires| |pre_commit| .. |docs| image:: https://img.shields.io/readthedocs/consolekit/latest?logo=read-the-docs - :target: https://consolekit.readthedocs.io/en/latest/?badge=latest + :target: https://consolekit.readthedocs.io/en/latest :alt: Documentation Build Status .. |docs_check| image:: https://github.com/domdfcoding/consolekit/workflows/Docs%20Check/badge.svg diff --git a/doc-source/conf.py b/doc-source/conf.py index a309dd7..6dee531 100644 --- a/doc-source/conf.py +++ b/doc-source/conf.py @@ -55,8 +55,6 @@ templates_path = ["_templates"] html_static_path = ["_static"] source_suffix = ".rst" -exclude_patterns = [] - master_doc = "index" suppress_warnings = ["image.nonlocal_uri"] pygments_style = "default" diff --git a/setup.cfg b/setup.cfg index 7e47e4b..581ccf0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,7 +17,7 @@ long_description_content_type = text/x-rst platforms = Windows, macOS, Linux url = https://github.com/domdfcoding/consolekit project_urls = - Documentation = https://consolekit.readthedocs.io + Documentation = https://consolekit.readthedocs.io/en/latest Issue_Tracker = https://github.com/domdfcoding/consolekit/issues Source_Code = https://github.com/domdfcoding/consolekit classifiers = diff --git a/tests/requirements.txt b/tests/requirements.txt index f74e206..a3779f9 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,6 +1,6 @@ coverage>=5.1 coverage-pyver-pragma>=0.0.6 -domdf-python-tools[testing]>=1.5.0 +domdf-python-tools[testing]>=1.6.0 iniconfig!=1.1.0,>=1.0.1 pytest>=6.0.0 pytest-cov>=2.8.1 diff --git a/tox.ini b/tox.ini index dc1a98d..8a8adfd 100644 --- a/tox.ini +++ b/tox.ini @@ -29,7 +29,7 @@ cov = py36, coverage [gh-actions] python = - 3.6: py36, build, mypy + 3.6: py36, build 3.7: py37, build 3.8: py38, build 3.9: py39, build @@ -77,6 +77,7 @@ deps = flake8-builtins>=1.5.3 flake8-docstrings>=1.5.0 flake8-dunder-all>=0.1.1 + flake8-github-actions>=0.1.0 flake8-pyi>=20.10.0 flake8-pytest-style>=1.3.0 flake8-sphinx-links>=0.0.4 @@ -85,9 +86,9 @@ deps = git+https://github.com/PyCQA/pydocstyle@5118faa7173b0e5bbc230c4adf628758e13605bf git+https://github.com/domdfcoding/flake8-quotes.git git+https://github.com/domdfcoding/flake8-rst-docstrings.git - git+https://github.com/domdfcoding/flake8-rst-docstrings-sphinx.git + git+https://github.com/domdfcoding/flake8-rst-docstrings-sphinx.git@v2 pygments>=2.7.1 -commands = python3 -m flake8_rst_docstrings_sphinx consolekit tests --allow-toolbox +commands = python3 -m flake8_rst_docstrings_sphinx consolekit tests --allow-toolbox {posargs} [testenv:mypy] basepython = python3.6 @@ -124,8 +125,8 @@ commands = [flake8] max-line-length = 120 -select = E301 E303 E304 E305 E306 E502 W291 W293 W391 E226 E225 E241 E231 W292 E265 E111 E112 E113 E121 E122 E125 E127 E128 E129 E131 E133 E201 E202 E203 E211 E222 E223 E224 E225 E227 E228 E242 E251 E261 E262 E271 E272 E402 E703 E711 E712 E713 E714 E721 W504 E302 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 -exclude = .git,__pycache__,doc-source,old,build,dist,make_conda_recipe.py,__pkginfo__.py,setup.py,.tox,venv +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 +exclude = doc-source,.git,__pycache__,old,build,dist,__pkginfo__.py,setup.py,.tox,venv rst-directives = TODO envvar