diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e769ad3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# This file is managed by 'repo_helper'. Don't edit it directly. +--- +version: 2 +updates: +- package-ecosystem: pip + directory: / + schedule: + interval: weekly + reviewers: + - domdfcoding diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 167e2c0..177294b 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -26,8 +26,7 @@ jobs: python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install flake8-prettycount - python -m pip install . + python -m pip install tox - name: "Run Flake8" - run: "python -m flake8_prettycount flake8_github_action --format github" + 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..6be64e3 --- /dev/null +++ b/.github/workflows/mypy.yml @@ -0,0 +1,37 @@ +# This file is managed by 'repo_helper'. Don't edit it directly. +--- +name: mypy + +on: + push: + pull_request: + branches: ["master"] + +jobs: + Run: + name: "mypy / ${{ matrix.os }}" + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + fail-fast: false + + steps: + - name: Checkout 🛎️ + uses: "actions/checkout@v2" + + - name: Setup Python 🐍 + uses: "actions/setup-python@v2" + with: + python-version: "3.6" + + - 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 41f556c..0242cca 100644 --- a/.github/workflows/octocheese.yml +++ b/.github/workflows/octocheese.yml @@ -4,6 +4,7 @@ name: "GitHub Releases" on: push: + branches: ["master"] schedule: - cron: 0 12 * * 2,4,6 diff --git a/.github/workflows/python_ci.yml b/.github/workflows/python_ci.yml index 7578c5a..d0fe702 100644 --- a/.github/workflows/python_ci.yml +++ b/.github/workflows/python_ci.yml @@ -1,6 +1,6 @@ # This file is managed by 'repo_helper'. Don't edit it directly. --- -name: Windows Tests +name: Windows on: push: @@ -9,15 +9,20 @@ on: jobs: tests: - name: "Python ${{ matrix.python-version }}" + name: "windows-2019 / Python ${{ matrix.config.python-version }}" runs-on: "windows-2019" + continue-on-error: ${{ matrix.config.experimental }} env: USING_COVERAGE: '3.6,3.7,3.8,3.9' strategy: fail-fast: False matrix: - python-version: ["3.6","3.7","3.8","3.9"] + config: + - {python-version: "3.6", testenvs: "py36,build", experimental: False} + - {python-version: "3.7", testenvs: "py37,build", experimental: False} + - {python-version: "3.8", testenvs: "py38,build", experimental: False} + - {python-version: "3.9", testenvs: "py39,build", experimental: False} steps: - name: Checkout 🛎️ @@ -26,14 +31,14 @@ jobs: - 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 a485353..ce74567 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -1,6 +1,6 @@ # This file is managed by 'repo_helper'. Don't edit it directly. --- -name: Linux Tests +name: Linux on: push: @@ -9,15 +9,20 @@ on: jobs: tests: - name: "Python ${{ matrix.python-version }}" - runs-on: "ubuntu-18.04" + name: "ubuntu-20.04 / Python ${{ matrix.config.python-version }}" + runs-on: "ubuntu-20.04" + continue-on-error: ${{ matrix.config.experimental }} env: USING_COVERAGE: '3.6,3.7,3.8,3.9' strategy: fail-fast: False matrix: - python-version: ["3.6","3.7","3.8","3.9"] + config: + - {python-version: "3.6", testenvs: "py36,build", experimental: False} + - {python-version: "3.7", testenvs: "py37,build", experimental: False} + - {python-version: "3.8", testenvs: "py38,build", experimental: False} + - {python-version: "3.9", testenvs: "py39,build", experimental: False} steps: - name: Checkout 🛎️ @@ -26,30 +31,30 @@ jobs: - 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" + - name: "Upload Coverage 🚀" uses: actions/upload-artifact@v2 with: - name: "coverage-${{ matrix.python-version }}" + name: "coverage-${{ matrix.config.python-version }}" path: .coverage Coverage: needs: tests - runs-on: "ubuntu-18.04" + runs-on: "ubuntu-20.04" steps: - name: Checkout 🛎️ uses: "actions/checkout@v2" @@ -64,7 +69,7 @@ jobs: python -m pip install --upgrade pip setuptools wheel python -m pip install --upgrade coveralls coverage_pyver_pragma - - name: "Download Coverage" + - name: "Download Coverage 🪂" uses: actions/download-artifact@v2 with: path: coverage @@ -73,12 +78,12 @@ jobs: run: ls -R working-directory: coverage - - name: Combine Coverage + - name: Combine Coverage 👷 run: | shopt -s globstar python -m coverage combine coverage/**/.coverage - - name: "Upload Combined Coverage Artefact" + - name: "Upload Combined Coverage Artefact 🚀" uses: actions/upload-artifact@v2 with: name: "combined-coverage" @@ -93,27 +98,31 @@ jobs: Deploy: needs: tests - runs-on: "ubuntu-18.04" + runs-on: "ubuntu-20.04" steps: - name: Checkout 🛎️ uses: "actions/checkout@v2" + if: startsWith(github.ref, 'refs/tags/') - name: Setup Python 🐍 uses: "actions/setup-python@v2" with: python-version: 3.8 + if: startsWith(github.ref, 'refs/tags/') - name: Install dependencies 🔧 run: | python -m pip install --upgrade pip setuptools wheel python -m pip install --upgrade tox + if: startsWith(github.ref, 'refs/tags/') - name: Build distributions 📦 run: | tox -e build + if: startsWith(github.ref, 'refs/tags/') - - name: Upload distribution 📦 to PyPI + - name: Upload distribution to PyPI 🚀 if: startsWith(github.ref, 'refs/tags/') uses: pypa/gh-action-pypi-publish@master with: diff --git a/.github/workflows/python_ci_macos.yml b/.github/workflows/python_ci_macos.yml index dbdba84..fc9cd1d 100644 --- a/.github/workflows/python_ci_macos.yml +++ b/.github/workflows/python_ci_macos.yml @@ -1,6 +1,6 @@ # This file is managed by 'repo_helper'. Don't edit it directly. --- -name: macOS Tests +name: macOS on: push: @@ -9,15 +9,20 @@ on: jobs: tests: - name: "Python ${{ matrix.python-version }}" + name: "macos-latest / Python ${{ matrix.config.python-version }}" runs-on: "macos-latest" + continue-on-error: ${{ matrix.config.experimental }} env: USING_COVERAGE: '3.6,3.7,3.8,3.9' strategy: fail-fast: False matrix: - python-version: ["3.6","3.7","3.8","3.9"] + config: + - {python-version: "3.6", testenvs: "py36,build", experimental: False} + - {python-version: "3.7", testenvs: "py37,build", experimental: False} + - {python-version: "3.8", testenvs: "py38,build", experimental: False} + - {python-version: "3.9", testenvs: "py39,build", experimental: False} steps: - name: Checkout 🛎️ @@ -26,14 +31,14 @@ jobs: - 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 49de611..974c6fd 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 a08d76f..2ba773c 100644 --- a/README.rst +++ b/README.rst @@ -17,34 +17,44 @@ notebook2script * - Docs - |docs| |docs_check| * - Tests - - |travis| |actions_windows| |actions_macos| |coveralls| |codefactor| |pre_commit_ci| + - |actions_linux| |actions_windows| |actions_macos| |coveralls| * - PyPI - |pypi-version| |supported-versions| |supported-implementations| |wheel| * - Activity - - |commits-latest| |commits-since| |maintained| + - |commits-latest| |commits-since| |maintained| |pypi-downloads| + * - QA + - |codefactor| |actions_flake8| |actions_mypy| |pre_commit_ci| * - Other - - |license| |language| |requires| |pre_commit| + - |license| |language| |requires| .. |docs| image:: https://img.shields.io/readthedocs/notebook2script/latest?logo=read-the-docs - :target: https://notebook2script.readthedocs.io/en/latest/?badge=latest + :target: https://notebook2script.readthedocs.io/en/latest :alt: Documentation Build Status .. |docs_check| image:: https://github.com/domdfcoding/notebook2script/workflows/Docs%20Check/badge.svg :target: https://github.com/domdfcoding/notebook2script/actions?query=workflow%3A%22Docs+Check%22 :alt: Docs Check Status -.. |travis| image:: https://github.com/domdfcoding/notebook2script/workflows/Linux%20Tests/badge.svg - :target: https://github.com/domdfcoding/notebook2script/actions?query=workflow%3A%22Linux+Tests%22 +.. |actions_linux| image:: https://github.com/domdfcoding/notebook2script/workflows/Linux/badge.svg + :target: https://github.com/domdfcoding/notebook2script/actions?query=workflow%3A%22Linux%22 :alt: Linux Test Status -.. |actions_windows| image:: https://github.com/domdfcoding/notebook2script/workflows/Windows%20Tests/badge.svg - :target: https://github.com/domdfcoding/notebook2script/actions?query=workflow%3A%22Windows+Tests%22 +.. |actions_windows| image:: https://github.com/domdfcoding/notebook2script/workflows/Windows/badge.svg + :target: https://github.com/domdfcoding/notebook2script/actions?query=workflow%3A%22Windows%22 :alt: Windows Test Status -.. |actions_macos| image:: https://github.com/domdfcoding/notebook2script/workflows/macOS%20Tests/badge.svg - :target: https://github.com/domdfcoding/notebook2script/actions?query=workflow%3A%22macOS+Tests%22 +.. |actions_macos| image:: https://github.com/domdfcoding/notebook2script/workflows/macOS/badge.svg + :target: https://github.com/domdfcoding/notebook2script/actions?query=workflow%3A%22macOS%22 :alt: macOS Test Status +.. |actions_flake8| image:: https://github.com/domdfcoding/notebook2script/workflows/Flake8/badge.svg + :target: https://github.com/domdfcoding/notebook2script/actions?query=workflow%3A%22Flake8%22 + :alt: Flake8 Status + +.. |actions_mypy| image:: https://github.com/domdfcoding/notebook2script/workflows/mypy/badge.svg + :target: https://github.com/domdfcoding/notebook2script/actions?query=workflow%3A%22mypy%22 + :alt: mypy status + .. |requires| image:: https://requires.io/github/domdfcoding/notebook2script/requirements.svg?branch=master :target: https://requires.io/github/domdfcoding/notebook2script/requirements/?branch=master :alt: Requirements Status @@ -91,9 +101,9 @@ notebook2script .. |maintained| image:: https://img.shields.io/maintenance/yes/2020 :alt: Maintenance -.. |pre_commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white - :target: https://github.com/pre-commit/pre-commit - :alt: pre-commit +.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/notebook2script + :target: https://pypi.org/project/notebook2script/ + :alt: PyPI - Downloads .. |pre_commit_ci| image:: https://results.pre-commit.ci/badge/github/domdfcoding/notebook2script/master.svg :target: https://results.pre-commit.ci/latest/github/domdfcoding/notebook2script/master diff --git a/doc-source/conf.py b/doc-source/conf.py index d02b513..0bf4ffb 100644 --- a/doc-source/conf.py +++ b/doc-source/conf.py @@ -56,8 +56,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/doc-source/index.rst b/doc-source/index.rst index 4f74e56..04aba2b 100644 --- a/doc-source/index.rst +++ b/doc-source/index.rst @@ -17,13 +17,15 @@ notebook2script * - Docs - |docs| |docs_check| * - Tests - - |travis| |actions_windows| |actions_macos| |coveralls| |codefactor| |pre_commit_ci| + - |actions_linux| |actions_windows| |actions_macos| |coveralls| * - PyPI - |pypi-version| |supported-versions| |supported-implementations| |wheel| * - Activity - - |commits-latest| |commits-since| |maintained| + - |commits-latest| |commits-since| |maintained| |pypi-downloads| + * - QA + - |codefactor| |actions_flake8| |actions_mypy| |pre_commit_ci| * - Other - - |license| |language| |requires| |pre_commit| + - |license| |language| |requires| .. |docs| rtfd-shield:: :project: notebook2script @@ -33,18 +35,26 @@ notebook2script :workflow: Docs Check :alt: Docs Check Status -.. |travis| actions-shield:: - :workflow: Linux Tests +.. |actions_linux| actions-shield:: + :workflow: Linux :alt: Linux Test Status .. |actions_windows| actions-shield:: - :workflow: Windows Tests + :workflow: Windows :alt: Windows Test Status .. |actions_macos| actions-shield:: - :workflow: macOS Tests + :workflow: macOS :alt: macOS Test Status +.. |actions_flake8| actions-shield:: + :workflow: Flake8 + :alt: Flake8 Status + +.. |actions_mypy| actions-shield:: + :workflow: mypy + :alt: mypy status + .. |requires| requires-io-shield:: :alt: Requirements Status @@ -93,8 +103,10 @@ notebook2script .. |maintained| maintained-shield:: 2020 :alt: Maintenance -.. |pre_commit| pre-commit-shield:: - :alt: pre-commit +.. |pypi-downloads| pypi-shield:: + :project: notebook2script + :downloads: month + :alt: PyPI - Downloads .. |pre_commit_ci| pre-commit-ci-shield:: :alt: pre-commit.ci status diff --git a/doc-source/requirements.txt b/doc-source/requirements.txt index fa7c59e..9d1c3f9 100644 --- a/doc-source/requirements.txt +++ b/doc-source/requirements.txt @@ -4,12 +4,12 @@ default-values>=0.2.0 extras-require>=0.2.0 furo>=2020.11.19b18 seed-intersphinx-mapping>=0.1.1 -sphinx>=3.0.3 +sphinx<3.4.0,>=3.0.3 sphinx-copybutton>=0.2.12 sphinx-notfound-page>=0.5 sphinx-prompt>=1.1.0 sphinx-tabs>=1.1.13 -sphinx-toolbox>=1.7.5 +sphinx-toolbox>=1.8.2 sphinxcontrib-httpdomain>=1.7.0 sphinxemoji>=0.1.6 toctree-plus>=0.0.4 diff --git a/setup.cfg b/setup.cfg index bb42b97..4b11fa6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,9 +17,9 @@ long_description_content_type = text/x-rst platforms = Windows, macOS, Linux url = https://github.com/domdfcoding/notebook2script project_urls = - Documentation = https://notebook2script.readthedocs.io - Issue_Tracker = https://github.com/domdfcoding/notebook2script/issues - Source_Code = https://github.com/domdfcoding/notebook2script + Documentation = https://notebook2script.readthedocs.io/en/latest + Issue Tracker = https://github.com/domdfcoding/notebook2script/issues + Source Code = https://github.com/domdfcoding/notebook2script classifiers = Development Status :: 4 - Beta Environment :: Console diff --git a/tests/requirements.txt b/tests/requirements.txt index d5595a4..3e473a4 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 4a0068b..6ad22bf 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,6 @@ # You may add new sections, but any changes made to the following sections will be lost: # * tox # * envlists -# * gh-actions # * testenv # * testenv:docs # * testenv:build @@ -19,7 +18,9 @@ [tox] envlist = py36, py37, py38, py39, mypy, build skip_missing_interpreters = True -requires = pip>=20.2.1 +requires = + pip>=20.3.3 + tox-envlist>=0.1.0 isolated_build = True [envlists] @@ -27,17 +28,8 @@ test = py36, py37, py38, py39 qa = mypy, lint cov = py36, coverage -[gh-actions] -python = - 3.6: py36, build, mypy - 3.7: py37, build - 3.8: py38, build - 3.9: py39, build - [testenv] -setenv = - PIP_USE_FEATURE = 2020-resolver - PYTHONDEVMODE = 1 +setenv = PYTHONDEVMODE = 1 deps = -r{toxinidir}/tests/requirements.txt commands = python --version @@ -122,8 +114,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 @@ -159,5 +151,12 @@ package = notebook2script addopts = --color yes --durations 25 timeout = 300 +[gh-actions] +python = + 3.6: py36, build, mypy + 3.7: py37, build + 3.8: py38, build + 3.9: py39, build + [dep_checker] allowed_unused = ipython