From c86653704e5e996fffaf540580f23a6f98342fef Mon Sep 17 00:00:00 2001 From: "repo-helper[bot]" <74742576+repo-helper[bot]@users.noreply.github.com> Date: Wed, 4 May 2022 09:17:39 +0000 Subject: [PATCH] Updated files with 'repo_helper'. --- .bumpversion.cfg | 6 +- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/actions_build_conda.sh | 23 ----- .github/actions_deploy_conda.sh | 24 ------ .github/milestones.py | 28 ++++++ .github/stale.yml | 12 +-- .github/workflows/cleanup.yml | 14 --- .github/workflows/conda_ci.yml | 44 +++++++--- .github/workflows/docs_test_action.yml | 27 +++++- .github/workflows/flake8.yml | 24 +++++- .github/workflows/mypy.yml | 21 ++++- .github/workflows/octocheese.yml | 4 +- .github/workflows/python_ci.yml | 33 +++++++- .github/workflows/python_ci_linux.yml | 97 +++++++++++++++++---- .github/workflows/python_ci_macos.yml | 33 +++++++- .pre-commit-config.yaml | 24 ++++-- .pylintrc | 2 +- README.rst | 10 +-- __pkginfo__.py | 20 ----- doc-source/Source.rst | 25 +++--- doc-source/conf.py | 105 +++++------------------ doc-source/index.rst | 14 ++- doc-source/license.rst | 10 +++ doc-source/requirements.txt | 9 +- formate.toml | 1 + justfile | 23 +++++ pyproject.toml | 113 ++++++++++++++++++++++++- setup.cfg | 13 --- tests/requirements.txt | 3 +- tox.ini | 40 ++++++--- 30 files changed, 527 insertions(+), 277 deletions(-) delete mode 100755 .github/actions_build_conda.sh delete mode 100755 .github/actions_deploy_conda.sh create mode 100755 .github/milestones.py delete mode 100644 .github/workflows/cleanup.yml delete mode 100644 __pkginfo__.py create mode 100644 doc-source/license.rst create mode 100644 justfile delete mode 100644 setup.cfg diff --git a/.bumpversion.cfg b/.bumpversion.cfg index a1a3d78..05c89e3 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -3,8 +3,6 @@ current_version = 0.5.0 commit = True tag = True -[bumpversion:file:__pkginfo__.py] - [bumpversion:file:mathematical/__init__.py] search = : str = "{current_version}" replace = : str = "{new_version}" @@ -16,3 +14,7 @@ replace = : str = "{new_version}" [bumpversion:file:repo_helper.yml] [bumpversion:file:pyproject.toml] +search = version = "{current_version}" +replace = version = "{new_version}" + +[bumpversion:file:.github/workflows/conda_ci.yml] diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 3c9ae6d..2d2ff66 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -44,7 +44,7 @@ If possible, please include a small, self-contained reproduction. * mathematical: ## Installation source - + ## Other Additional Information: diff --git a/.github/actions_build_conda.sh b/.github/actions_build_conda.sh deleted file mode 100755 index 4983f89..0000000 --- a/.github/actions_build_conda.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# This file is managed by 'repo_helper'. Don't edit it directly. - -set -e -x - -python -m mkrecipe || exit 1 - -# Switch to miniconda -source "/home/runner/miniconda/etc/profile.d/conda.sh" -hash -r -conda activate base -conda config --set always_yes yes --set changeps1 no -conda update -q conda -conda install conda-build -conda install anaconda-client -conda info -a - -conda config --add channels conda-forge || exit 1 -conda config --add channels domdfcoding || exit 1 - -conda build conda -c conda-forge -c domdfcoding --output-folder conda/dist --skip-existing - -exit 0 diff --git a/.github/actions_deploy_conda.sh b/.github/actions_deploy_conda.sh deleted file mode 100755 index df0ce72..0000000 --- a/.github/actions_deploy_conda.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# This file is managed by 'repo_helper'. Don't edit it directly. - -set -e -x - -# Switch to miniconda -source "/home/runner/miniconda/etc/profile.d/conda.sh" -hash -r -conda activate base -conda config --set always_yes yes --set changeps1 no -conda update -q conda -conda install anaconda-client -conda info -a - -for f in conda/dist/noarch/mathematical-*.tar.bz2; do - [ -e "$f" ] || continue - echo "$f" - conda install "$f" || exit 1 - echo "Deploying to Anaconda.org..." - anaconda -t "$ANACONDA_TOKEN" upload "$f" || exit 1 - echo "Successfully deployed to Anaconda.org." -done - -exit 0 diff --git a/.github/milestones.py b/.github/milestones.py new file mode 100755 index 0000000..5e868dc --- /dev/null +++ b/.github/milestones.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +# stdlib +import os +import sys + +# 3rd party +from github3 import GitHub +from github3.repos import Repository +from packaging.version import InvalidVersion, Version + +latest_tag = os.environ["GITHUB_REF_NAME"] + +try: + current_version = Version(latest_tag) +except InvalidVersion: + sys.exit() + +gh: GitHub = GitHub(token=os.environ["GITHUB_TOKEN"]) +repo: Repository = gh.repository(*os.environ["GITHUB_REPOSITORY"].split('/', 1)) + +for milestone in repo.milestones(state="open"): + try: + milestone_version = Version(milestone.title) + except InvalidVersion: + continue + if milestone_version == current_version: + sys.exit(not milestone.update(state="closed")) diff --git a/.github/stale.yml b/.github/stale.yml index bb7ca3f..bb7fa62 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -7,7 +7,7 @@ daysUntilStale: 180 # Number of days of inactivity before an Issue or Pull Request with the stale label is closed. # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 180 +daysUntilClose: false # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) onlyLabels: [] @@ -28,13 +28,13 @@ exemptMilestones: false exemptAssignees: false # Label to use when marking as stale -staleLabel: wontfix +staleLabel: stale # Comment to post when marking as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. +markComment: false +# This issue has been automatically marked as stale because it has not had +# recent activity. It will be closed if no further activity occurs. Thank you +# for your contributions. # Comment to post when removing the stale label. # unmarkComment: > diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml deleted file mode 100644 index 741c0bd..0000000 --- a/.github/workflows/cleanup.yml +++ /dev/null @@ -1,14 +0,0 @@ -# This file is managed by 'repo_helper'. Don't edit it directly. ---- -name: Artefact Cleaner -on: - schedule: - - cron: 0 9 1 * * -jobs: - Clean: - runs-on: ubuntu-latest - steps: - - name: cleanup - uses: glassechidna/artifact-cleaner@v2 - with: - minimumAge: 1000000.0 diff --git a/.github/workflows/conda_ci.yml b/.github/workflows/conda_ci.yml index 4f85943..20d1607 100644 --- a/.github/workflows/conda_ci.yml +++ b/.github/workflows/conda_ci.yml @@ -6,10 +6,16 @@ on: push: branches: ["master"] +permissions: + contents: read + jobs: tests: name: "Conda" - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 + defaults: + run: + shell: bash -l {0} steps: - name: Checkout πŸ›ŽοΈ @@ -20,24 +26,40 @@ jobs: with: python-version: "3.8" + - name: Setup Conda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: env + conda-build-version: 3.21.0 + - name: Install dependencies πŸ”§ run: | python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade repo_helper + python -m pip install --upgrade "whey-conda" "whey" # $CONDA is an environment variable pointing to the root of the miniconda directory - $CONDA/bin/conda update -q conda - $CONDA/bin/conda install conda-build=3.21.0 - + $CONDA/bin/conda update -n base conda $CONDA/bin/conda config --add channels conda-forge $CONDA/bin/conda config --add channels domdfcoding - - name: "Build and install package" + - name: "Build and index channel" run: | - # This mess is only necessary because conda won't fix it themselves - # https://github.com/conda/conda/issues/1884 - - python -m repo_helper build --conda --out-dir conda-bld/noarch + python -m whey --builder whey_conda --out-dir conda-bld/noarch $CONDA/bin/conda index ./conda-bld || exit 1 - $CONDA/bin/conda install -c file://$(pwd)/conda-bld mathematical -y || exit 1 + + - name: "Search for package" + run: | + $CONDA/bin/conda search -c file://$(pwd)/conda-bld mathematical + $CONDA/bin/conda search -c file://$(pwd)/conda-bld --override-channels mathematical + + - name: "Install package" + run: | + $CONDA/bin/conda install -c file://$(pwd)/conda-bld mathematical=0.5.0=py_1 -y || exit 1 + + - name: "Run Tests" + run: | + rm -rf mathematical + $CONDA/bin/conda install pytest coincidence || exit 1 + pip install -r tests/requirements.txt + pytest tests/ diff --git a/.github/workflows/docs_test_action.yml b/.github/workflows/docs_test_action.yml index 51d1d73..d258e8d 100644 --- a/.github/workflows/docs_test_action.yml +++ b/.github/workflows/docs_test_action.yml @@ -2,17 +2,36 @@ --- name: "Docs Check" on: - - push + push: + branches-ignore: + - 'repo-helper-update' + - 'pre-commit-ci-update-config' + - 'imgbot' + pull_request: + +permissions: + contents: read jobs: docs: runs-on: ubuntu-latest steps: - name: Checkout πŸ›ŽοΈ - uses: "actions/checkout@v1" + uses: "actions/checkout@v2" + + - name: Check for changed files + uses: dorny/paths-filter@v2 + id: changes + with: + list-files: "json" + filters: | + code: + - '!tests/**' + - name: Install and Build πŸ”§ - uses: ammaraskar/sphinx-action@master + uses: sphinx-toolbox/sphinx-action@sphinx-3.3.1 + if: steps.changes.outputs.code == 'true' with: - pre-build-command: apt-get update && apt-get install gcc python3-dev git pandoc -y && python -m pip install tox + pre-build-command: python -m pip install tox docs-folder: "doc-source/" build-command: "tox -e docs -- " diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 29303d6..5abedd1 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -4,6 +4,14 @@ name: Flake8 on: push: + branches-ignore: + - 'repo-helper-update' + - 'pre-commit-ci-update-config' + - 'imgbot' + pull_request: + +permissions: + contents: read jobs: Run: @@ -14,12 +22,23 @@ jobs: - name: Checkout πŸ›ŽοΈ uses: "actions/checkout@v2" + - name: Check for changed files + uses: dorny/paths-filter@v2 + id: changes + with: + list-files: "json" + filters: | + code: + - '!(doc-source/**|CONTRIBUTING.rst|.imgbotconfig|.pre-commit-config.yaml|.pylintrc|.readthedocs.yml)' + - name: Setup Python 🐍 + if: steps.changes.outputs.code == 'true' uses: "actions/setup-python@v2" with: - python-version: "3.8" + python-version: "3.7" - name: Install dependencies πŸ”§ + if: steps.changes.outputs.code == 'true' run: | python -VV python -m site @@ -27,4 +46,5 @@ jobs: python -m pip install tox - name: "Run Flake8" - run: "python -m tox -e lint -- --format github" + if: steps.changes.outputs.code == 'true' + run: "python -m tox -e lint -s false -- --format github" diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 0f87c9d..70087c2 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -4,6 +4,14 @@ name: mypy on: push: + branches-ignore: + - 'repo-helper-update' + - 'pre-commit-ci-update-config' + - 'imgbot' + pull_request: + +permissions: + contents: read jobs: Run: @@ -19,7 +27,17 @@ jobs: - name: Checkout πŸ›ŽοΈ uses: "actions/checkout@v2" + - name: Check for changed files + uses: dorny/paths-filter@v2 + id: changes + with: + list-files: "json" + filters: | + code: + - '!(doc-source/**|CONTRIBUTING.rst|.imgbotconfig|.pre-commit-config.yaml|.pylintrc|.readthedocs.yml)' + - name: Setup Python 🐍 + if: steps.changes.outputs.code == 'true' uses: "actions/setup-python@v2" with: python-version: "3.7" @@ -32,4 +50,5 @@ jobs: python -m pip install --upgrade tox virtualenv - name: "Run mypy" - run: "python -m tox -e mypy" + if: steps.changes.outputs.code == 'true' + run: "python -m tox -e mypy -s false" diff --git a/.github/workflows/octocheese.yml b/.github/workflows/octocheese.yml index 517eac1..f80b398 100644 --- a/.github/workflows/octocheese.yml +++ b/.github/workflows/octocheese.yml @@ -3,10 +3,8 @@ name: "GitHub Releases" on: - push: - branches: ["master"] schedule: - - cron: 0 12 * * 2,4,6 + - cron: 0 12 * * * jobs: Run: diff --git a/.github/workflows/python_ci.yml b/.github/workflows/python_ci.yml index 5e6da3c..66812a7 100644 --- a/.github/workflows/python_ci.yml +++ b/.github/workflows/python_ci.yml @@ -4,6 +4,17 @@ name: Windows on: push: + branches-ignore: + - 'repo-helper-update' + - 'pre-commit-ci-update-config' + - 'imgbot' + + pull_request: + +permissions: + actions: write + issues: write + contents: read jobs: tests: @@ -11,7 +22,7 @@ jobs: runs-on: "windows-2019" continue-on-error: ${{ matrix.config.experimental }} env: - USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.6' + USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10' strategy: fail-fast: False @@ -21,18 +32,31 @@ jobs: - {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} - - {python-version: "3.10.0-alpha.6", testenvs: "py310-dev,build", experimental: True} + - {python-version: "3.10", testenvs: "py310-dev,build", experimental: True} steps: - name: Checkout πŸ›ŽοΈ uses: "actions/checkout@v2" + - name: Check for changed files + if: startsWith(github.ref, 'refs/tags/') != true + uses: dorny/paths-filter@v2 + id: changes + with: + list-files: "json" + filters: | + code: + - '!(doc-source/**|CONTRIBUTING.rst|.imgbotconfig|.pre-commit-config.yaml|.pylintrc|.readthedocs.yml)' + - name: Setup Python 🐍 + id: setup-python + if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }} uses: "actions/setup-python@v2" with: python-version: "${{ matrix.config.python-version }}" - name: Install dependencies πŸ”§ + if: steps.setup-python.outcome == 'success' run: | python -VV python -m site @@ -40,11 +64,12 @@ jobs: python -m pip install --upgrade tox virtualenv - name: "Run Tests for Python ${{ matrix.config.python-version }}" - run: python -m tox -e "${{ matrix.config.testenvs }}" + if: steps.setup-python.outcome == 'success' + run: python -m tox -e "${{ matrix.config.testenvs }}" -s false - name: "Upload Coverage πŸš€" uses: actions/upload-artifact@v2 - if: ${{ always() }} + if: ${{ always() && steps.setup-python.outcome == 'success' }} with: name: "coverage-${{ matrix.config.python-version }}" path: .coverage diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index 4ff8fc7..a0bc628 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -4,6 +4,18 @@ name: Linux on: push: + branches-ignore: + - 'repo-helper-update' + - 'pre-commit-ci-update-config' + - 'imgbot' + tags: + - '*' + pull_request: + +permissions: + actions: write + issues: write + contents: read jobs: tests: @@ -11,7 +23,7 @@ jobs: runs-on: "ubuntu-20.04" continue-on-error: ${{ matrix.config.experimental }} env: - USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.6' + USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10' strategy: fail-fast: False @@ -21,18 +33,31 @@ jobs: - {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} - - {python-version: "3.10.0-alpha.6", testenvs: "py310-dev,build", experimental: True} + - {python-version: "3.10", testenvs: "py310-dev,build", experimental: True} steps: - name: Checkout πŸ›ŽοΈ uses: "actions/checkout@v2" + - name: Check for changed files + if: startsWith(github.ref, 'refs/tags/') != true + uses: dorny/paths-filter@v2 + id: changes + with: + list-files: "json" + filters: | + code: + - '!(doc-source/**|CONTRIBUTING.rst|.imgbotconfig|.pre-commit-config.yaml|.pylintrc|.readthedocs.yml)' + - name: Setup Python 🐍 + id: setup-python + if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }} uses: "actions/setup-python@v2" with: python-version: "${{ matrix.config.python-version }}" - name: Install dependencies πŸ”§ + if: steps.setup-python.outcome == 'success' run: | python -VV python -m site @@ -41,11 +66,12 @@ jobs: python -m pip install --upgrade coverage_pyver_pragma - name: "Run Tests for Python ${{ matrix.config.python-version }}" - run: python -m tox -e "${{ matrix.config.testenvs }}" + if: steps.setup-python.outcome == 'success' + run: python -m tox -e "${{ matrix.config.testenvs }}" -s false - name: "Upload Coverage πŸš€" uses: actions/upload-artifact@v2 - if: ${{ always() }} + if: ${{ always() && steps.setup-python.outcome == 'success' }} with: name: "coverage-${{ matrix.config.python-version }}" path: .coverage @@ -74,21 +100,26 @@ jobs: path: coverage - name: Display structure of downloaded files + id: show run: ls -R working-directory: coverage + continue-on-error: true - name: Combine Coverage πŸ‘· + if: ${{ steps.show.outcome != 'failure' }} run: | shopt -s globstar python -m coverage combine coverage/**/.coverage - name: "Upload Combined Coverage Artefact πŸš€" + if: ${{ steps.show.outcome != 'failure' }} uses: actions/upload-artifact@v2 with: name: "combined-coverage" path: .coverage - name: "Upload Combined Coverage to Coveralls" + if: ${{ steps.show.outcome != 'failure' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -105,21 +136,21 @@ jobs: - name: Setup Python 🐍 uses: "actions/setup-python@v2" + if: startsWith(github.ref, 'refs/tags/') with: python-version: 3.8 - if: startsWith(github.ref, 'refs/tags/') - name: Install dependencies πŸ”§ + if: startsWith(github.ref, 'refs/tags/') run: | python -m pip install --upgrade pip setuptools wheel python -m pip install --upgrade tox - if: startsWith(github.ref, 'refs/tags/') - name: Build distributions πŸ“¦ + if: startsWith(github.ref, 'refs/tags/') run: | tox -e build - if: startsWith(github.ref, 'refs/tags/') - name: Upload distribution to PyPI πŸš€ if: startsWith(github.ref, 'refs/tags/') @@ -129,11 +160,19 @@ jobs: password: ${{ secrets.PYPI_TOKEN }} skip_existing: true + - name: Close milestone πŸšͺ + if: startsWith(github.ref, 'refs/tags/') + run: | + python -m pip install --upgrade github3.py packaging + python .github/milestones.py + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + Conda: needs: deploy - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-18.04" if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.event.head_commit.message, 'Bump version') != true) steps: - name: Checkout πŸ›ŽοΈ @@ -144,22 +183,46 @@ jobs: with: python-version: 3.8 + - name: Setup Conda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: env + conda-build-version: 3.21.0 + - name: Install dependencies πŸ”§ run: | + python -VV + python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade mkrecipe + python -m pip install --upgrade "mkrecipe" "whey" + # $CONDA is an environment variable pointing to the root of the miniconda directory + $CONDA/bin/conda config --set always_yes yes --set changeps1 no + $CONDA/bin/conda update -n base conda + $CONDA/bin/conda info -a + $CONDA/bin/conda config --add channels conda-forge + $CONDA/bin/conda config --add channels domdfcoding - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda + $CONDA/bin/conda config --remove channels defaults - - name: Build Conda πŸ“¦ + - name: Build Conda Package πŸ“¦ run: | - chmod +x .github/actions_build_conda.sh - bash .github/actions_build_conda.sh + python -m mkrecipe --type wheel || exit 1 + $CONDA/bin/conda build conda -c conda-forge -c domdfcoding --output-folder conda/dist - - name: Deploy Conda πŸš€ + - name: Deploy Conda Package πŸš€ + if: startsWith(github.ref, 'refs/tags/') run: | - chmod +x .github/actions_deploy_conda.sh - bash .github/actions_deploy_conda.sh + $CONDA/bin/conda config --set always_yes yes --set changeps1 no + $CONDA/bin/conda install anaconda-client + $CONDA/bin/conda info -a + + for f in conda/dist/noarch/mathematical-*.tar.bz2; do + [ -e "$f" ] || continue + echo "$f" + conda install "$f" || exit 1 + echo "Deploying to Anaconda.org..." + $CONDA/bin/anaconda -t "$ANACONDA_TOKEN" upload "$f" || exit 1 + echo "Successfully deployed to Anaconda.org." + done env: ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} diff --git a/.github/workflows/python_ci_macos.yml b/.github/workflows/python_ci_macos.yml index 44254c1..f30acb7 100644 --- a/.github/workflows/python_ci_macos.yml +++ b/.github/workflows/python_ci_macos.yml @@ -4,6 +4,17 @@ name: macOS on: push: + branches-ignore: + - 'repo-helper-update' + - 'pre-commit-ci-update-config' + - 'imgbot' + + pull_request: + +permissions: + actions: write + issues: write + contents: read jobs: tests: @@ -11,7 +22,7 @@ jobs: runs-on: "macos-latest" continue-on-error: ${{ matrix.config.experimental }} env: - USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.6' + USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10' strategy: fail-fast: False @@ -21,18 +32,31 @@ jobs: - {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} - - {python-version: "3.10.0-alpha.6", testenvs: "py310-dev,build", experimental: True} + - {python-version: "3.10", testenvs: "py310-dev,build", experimental: True} steps: - name: Checkout πŸ›ŽοΈ uses: "actions/checkout@v2" + - name: Check for changed files + if: startsWith(github.ref, 'refs/tags/') != true + uses: dorny/paths-filter@v2 + id: changes + with: + list-files: "json" + filters: | + code: + - '!(doc-source/**|CONTRIBUTING.rst|.imgbotconfig|.pre-commit-config.yaml|.pylintrc|.readthedocs.yml)' + - name: Setup Python 🐍 + id: setup-python + if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }} uses: "actions/setup-python@v2" with: python-version: "${{ matrix.config.python-version }}" - name: Install dependencies πŸ”§ + if: steps.setup-python.outcome == 'success' run: | python -VV python -m site @@ -40,11 +64,12 @@ jobs: python -m pip install --upgrade tox virtualenv - name: "Run Tests for Python ${{ matrix.config.python-version }}" - run: python -m tox -e "${{ matrix.config.testenvs }}" + if: steps.setup-python.outcome == 'success' + run: python -m tox -e "${{ matrix.config.testenvs }}" -s false - name: "Upload Coverage πŸš€" uses: actions/upload-artifact@v2 - if: ${{ always() }} + if: ${{ always() && steps.setup-python.outcome == 'success' }} with: name: "coverage-${{ matrix.config.python-version }}" path: .coverage diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f252b9..1bfcdb0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,11 @@ exclude: ^$ repos: + - repo: https://github.com/repo-helper/pyproject-parser + rev: v0.4.3 + hooks: + - id: reformat-pyproject + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.4.0 hooks: @@ -25,7 +30,7 @@ repos: - id: end-of-file-fixer - repo: https://github.com/domdfcoding/pre-commit-hooks - rev: v0.2.1 + rev: v0.3.0 hooks: - id: requirements-txt-sorter args: @@ -35,18 +40,18 @@ repos: - id: bind-requirements - repo: https://github.com/domdfcoding/flake8-dunder-all - rev: v0.1.7 + rev: v0.1.8 hooks: - id: ensure-dunder-all files: ^mathematical/.*\.py$ - repo: https://github.com/domdfcoding/flake2lint - rev: v0.4.0 + rev: v0.4.1 hooks: - id: flake2lint - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.8.0 + rev: v1.9.0 hooks: - id: python-no-eval - id: rst-backticks @@ -62,13 +67,18 @@ repos: - --keep-runtime-typing - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.1.9 + rev: v1.1.13 hooks: - id: remove-crlf - id: forbid-crlf - - repo: https://github.com/repo-helper/formate - rev: v0.4.3 + - repo: https://github.com/python-formate/snippet-fmt + rev: v0.1.4 + hooks: + - id: snippet-fmt + + - repo: https://github.com/python-formate/formate + rev: v0.4.10 hooks: - id: formate exclude: ^(doc-source/conf|__pkginfo__|setup)\.(_)?py$ diff --git a/.pylintrc b/.pylintrc index a21206a..81ecba0 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" disable=all -enable=assert-on-tuple,astroid-error,bad-except-order,bad-inline-option,bad-option-value,bad-reversed-sequence,bare-except,binary-op-exception,boolean-datetime,catching-non-exception,cell-var-from-loop,confusing-with-statement,consider-merging-isinstance,consider-using-enumerate,consider-using-ternary,continue-in-finally,cyclic-import,deprecated-pragma,django-not-available,duplicate-except,duplicate-key,eval-used,exec-used,expression-not-assigned,fatal,file-ignored,fixme,global-at-module-level,global-statement,global-variable-not-assigned,global-variable-undefined,http-response-with-content-type-json,http-response-with-json-dumps,invalid-all-object,invalid-characters-in-docstring,len-as-condition,literal-comparison,locally-disabled,locally-enabled,lost-exception,lowercase-l-suffix,misplaced-bare-raise,missing-kwoa,mixed-line-endings,model-has-unicode,model-missing-unicode,model-no-explicit-unicode,model-unicode-not-callable,multiple-imports,new-db-field-with-default,non-ascii-bytes-literals,nonexistent-operator,not-in-loop,notimplemented-raised,overlapping-except,parse-error,pointless-statement,pointless-string-statement,raising-bad-type,raising-non-exception,raw-checker-failed,redefine-in-handler,redefined-argument-from-local,redefined-builtin,redundant-content-type-for-json-response,reimported,relative-import,return-outside-function,simplifiable-if-statement,singleton-comparison,syntax-error,trailing-comma-tuple,trailing-newlines,unbalanced-tuple-unpacking,undefined-all-variable,undefined-loop-variable,unexpected-line-ending-format,unidiomatic-typecheck,unnecessary-lambda,unnecessary-pass,unnecessary-semicolon,unneeded-not,unpacking-non-sequence,unreachable,unrecognized-inline-option,used-before-assignment,useless-else-on-loop,using-constant-test,wildcard-import,yield-outside-function,useless-return +enable=assert-on-tuple,astroid-error,bad-except-order,bad-inline-option,bad-option-value,bad-reversed-sequence,bare-except,binary-op-exception,boolean-datetime,catching-non-exception,cell-var-from-loop,confusing-with-statement,consider-merging-isinstance,consider-using-enumerate,consider-using-ternary,continue-in-finally,deprecated-pragma,django-not-available,duplicate-except,duplicate-key,eval-used,exec-used,expression-not-assigned,fatal,file-ignored,fixme,global-at-module-level,global-statement,global-variable-not-assigned,global-variable-undefined,http-response-with-content-type-json,http-response-with-json-dumps,invalid-all-object,invalid-characters-in-docstring,len-as-condition,literal-comparison,locally-disabled,locally-enabled,lost-exception,lowercase-l-suffix,misplaced-bare-raise,missing-kwoa,mixed-line-endings,model-has-unicode,model-missing-unicode,model-no-explicit-unicode,model-unicode-not-callable,multiple-imports,new-db-field-with-default,non-ascii-bytes-literals,nonexistent-operator,not-in-loop,notimplemented-raised,overlapping-except,parse-error,pointless-statement,pointless-string-statement,raising-bad-type,raising-non-exception,raw-checker-failed,redefine-in-handler,redefined-argument-from-local,redefined-builtin,redundant-content-type-for-json-response,reimported,relative-import,return-outside-function,simplifiable-if-statement,singleton-comparison,syntax-error,trailing-comma-tuple,trailing-newlines,unbalanced-tuple-unpacking,undefined-all-variable,undefined-loop-variable,unexpected-line-ending-format,unidiomatic-typecheck,unnecessary-lambda,unnecessary-pass,unnecessary-semicolon,unneeded-not,unpacking-non-sequence,unreachable,unrecognized-inline-option,used-before-assignment,useless-else-on-loop,using-constant-test,wildcard-import,yield-outside-function,useless-return [REPORTS] diff --git a/README.rst b/README.rst index b4e825f..40e5cd8 100644 --- a/README.rst +++ b/README.rst @@ -59,8 +59,8 @@ Includes tools for calculating mean, median and standard deviation of rows in da :target: https://github.com/domdfcoding/mathematical/actions?query=workflow%3A%22mypy%22 :alt: mypy status -.. |requires| image:: https://requires.io/github/domdfcoding/mathematical/requirements.svg?branch=master - :target: https://requires.io/github/domdfcoding/mathematical/requirements/?branch=master +.. |requires| image:: https://dependency-dash.herokuapp.com/github/domdfcoding/mathematical/badge.svg + :target: https://dependency-dash.herokuapp.com/github/domdfcoding/mathematical/ :alt: Requirements Status .. |coveralls| image:: https://img.shields.io/coveralls/github/domdfcoding/mathematical/master?logo=coveralls @@ -110,7 +110,7 @@ Includes tools for calculating mean, median and standard deviation of rows in da :target: https://github.com/domdfcoding/mathematical/commit/master :alt: GitHub last commit -.. |maintained| image:: https://img.shields.io/maintenance/yes/2021 +.. |maintained| image:: https://img.shields.io/maintenance/yes/2022 :alt: Maintenance .. |pypi-downloads| image:: https://img.shields.io/pypi/dm/mathematical @@ -138,8 +138,8 @@ To install with ``conda``: .. code-block:: bash - $ conda config --add channels http://conda.anaconda.org/conda-forge - $ conda config --add channels http://conda.anaconda.org/domdfcoding + $ conda config --add channels https://conda.anaconda.org/conda-forge + $ conda config --add channels https://conda.anaconda.org/domdfcoding * Then install diff --git a/__pkginfo__.py b/__pkginfo__.py deleted file mode 100644 index 48a5e76..0000000 --- a/__pkginfo__.py +++ /dev/null @@ -1,20 +0,0 @@ -# This file is managed by 'repo_helper'. Don't edit it directly. -# Copyright Β© 2020 Dominic Davis-Foster -# -# This file is distributed under the same license terms as the program it came with. -# There will probably be a file called LICEN[S/C]E in the same directory as this file. -# -# In any case, this program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -# This script based on https://github.com/rocky/python-uncompyle6/blob/master/__pkginfo__.py -# - -__all__ = [ - "__version__", - "extras_require", - ] - -__version__ = "0.5.0" -extras_require = {} diff --git a/doc-source/Source.rst b/doc-source/Source.rst index 3553502..c33589c 100644 --- a/doc-source/Source.rst +++ b/doc-source/Source.rst @@ -7,24 +7,27 @@ and can be accessed from the following URL: https://github.com/domdfcoding/mathe If you have ``git`` installed, you can clone the repository with the following command: -.. code-block:: bash +.. prompt:: bash + + git clone https://github.com/domdfcoding/mathematical + +.. parsed-literal:: - $ git clone https://github.com/domdfcoding/mathematical" - > Cloning into 'mathematical'... - > remote: Enumerating objects: 47, done. - > remote: Counting objects: 100% (47/47), done. - > remote: Compressing objects: 100% (41/41), done. - > remote: Total 173 (delta 16), reused 17 (delta 6), pack-reused 126 - > Receiving objects: 100% (173/173), 126.56 KiB | 678.00 KiB/s, done. - > Resolving deltas: 100% (66/66), done. + Cloning into 'mathematical'... + remote: Enumerating objects: 47, done. + remote: Counting objects: 100% (47/47), done. + remote: Compressing objects: 100% (41/41), done. + remote: Total 173 (delta 16), reused 17 (delta 6), pack-reused 126 + Receiving objects: 100% (173/173), 126.56 KiB | 678.00 KiB/s, done. + Resolving deltas: 100% (66/66), done. | Alternatively, the code can be downloaded in a 'zip' file by clicking: | :guilabel:`Clone or download` --> :guilabel:`Download Zip` .. figure:: git_download.png - :alt: Downloading a 'zip' file of the source code. + :alt: Downloading a 'zip' file of the source code. - Downloading a 'zip' file of the source code + Downloading a 'zip' file of the source code Building from source diff --git a/doc-source/conf.py b/doc-source/conf.py index 1dd72b0..7df7cb0 100644 --- a/doc-source/conf.py +++ b/doc-source/conf.py @@ -5,90 +5,19 @@ # stdlib import os import re +import sys # 3rd party from sphinx_pyproject import SphinxConfig -config = SphinxConfig() - -github_username = "domdfcoding" -github_repository = "mathematical" -author = "Dominic Davis-Foster" -project = "mathematical" -copyright = "2019-2021 Dominic Davis-Foster" -language = "en" -package_root = "mathematical" -extensions = [ - "sphinx_toolbox", - "sphinx_toolbox.more_autodoc", - "sphinx_toolbox.more_autosummary", - "sphinx_toolbox.documentation_summary", - "sphinx_toolbox.tweaks.param_dash", - "sphinx_toolbox.tweaks.latex_toc", - "sphinx.ext.intersphinx", - "sphinx.ext.mathjax", - "sphinxcontrib.httpdomain", - "sphinxcontrib.extras_require", - "sphinx.ext.todo", - "sphinxemoji.sphinxemoji", - "notfound.extension", - "sphinx_copybutton", - "sphinxcontrib.default_values", - "sphinxcontrib.toctree_plus", - "sphinx_debuginfo", - "seed_intersphinx_mapping", - ] -sphinxemoji_style = "twemoji" -gitstamp_fmt = "%d %b %Y" -templates_path = ["_templates"] -html_static_path = ["_static"] -source_suffix = ".rst" -master_doc = "index" -suppress_warnings = ["image.nonlocal_uri"] -pygments_style = "default" -html_theme = "domdf_sphinx_theme" -html_theme_path = ["../.."] -html_show_sourcelink = True -toctree_plus_types = [ - "class", - "confval", - "data", - "directive", - "enum", - "exception", - "flag", - "function", - "method", - "namedtuple", - "protocol", - "role", - "typeddict", - ] -add_module_names = False -hide_none_rtype = True -all_typevars = True -overloads_location = "bottom" -documentation_summary = "Mathematical tools for Pythonβ€‚πŸ“β€‚πŸβ€‚πŸ› οΈ" -autodoc_exclude_members = [ - "__dict__", - "__class__", - "__dir__", - "__weakref__", - "__module__", - "__annotations__", - "__orig_bases__", - "__parameters__", - "__subclasshook__", - "__init_subclass__", - "__attrs_attrs__", - "__init__", - "__new__", - "__getnewargs__", - "__abstractmethods__", - "__hash__", - ] - -github_url = f"https://github.com/{github_username}/{github_repository}" +sys.path.append('.') + +config = SphinxConfig(globalns=globals()) +project = config["project"] +author = config["author"] +documentation_summary = config.description + +github_url = "https://github.com/{github_username}/{github_repository}".format_map(config) rst_prolog = f""".. |pkgname| replace:: mathematical .. |pkgname2| replace:: ``mathematical`` @@ -120,12 +49,24 @@ man_pages = [("index", slug, project, [author], 1)] texinfo_documents = [("index", slug, project, author, slug, project, "Miscellaneous")] -toctree_plus_types = set(toctree_plus_types) +toctree_plus_types = set(config["toctree_plus_types"]) autodoc_default_options = { "members": None, # Include all members (methods). "special-members": None, "autosummary": None, "show-inheritance": None, - "exclude-members": ','.join(autodoc_exclude_members), + "exclude-members": ','.join(config["autodoc_exclude_members"]), + } + +latex_elements = { + "printindex": "\\begin{flushleft}\n\\printindex\n\\end{flushleft}", + "tableofcontents": "\\pdfbookmark[0]{\\contentsname}{toc}\\sphinxtableofcontents", } + + +def setup(app): + # 3rd party + from sphinx_toolbox.latex import better_header_layout + + app.connect("config-inited", lambda app, config: better_header_layout(config)) diff --git a/doc-source/index.rst b/doc-source/index.rst index 019a21b..2a9ab4d 100644 --- a/doc-source/index.rst +++ b/doc-source/index.rst @@ -5,6 +5,7 @@ mathematical .. start short_desc .. documentation-summary:: + :meta: .. end short_desc @@ -61,7 +62,8 @@ Includes tools for calculating mean, median and standard deviation of rows in da :workflow: mypy :alt: mypy status - .. |requires| requires-io-shield:: + .. |requires| image:: https://dependency-dash.herokuapp.com/github/domdfcoding/mathematical/badge.svg + :target: https://dependency-dash.herokuapp.com/github/domdfcoding/mathematical/ :alt: Requirements Status .. |coveralls| coveralls-shield:: @@ -114,7 +116,7 @@ Includes tools for calculating mean, median and standard deviation of rows in da :last-commit: :alt: GitHub last commit - .. |maintained| maintained-shield:: 2021 + .. |maintained| maintained-shield:: 2022 :alt: Maintenance .. |pypi-downloads| pypi-shield:: @@ -153,12 +155,18 @@ Installation Source +.. sidebar-links:: + :caption: Links + :github: + :pypi: mathematical + + .. start links .. only:: html View the :ref:`Function Index ` or browse the `Source Code <_modules/index.html>`__. - `Browse the GitHub Repository `__ + :github:repo:`Browse the GitHub Repository ` .. end links diff --git a/doc-source/license.rst b/doc-source/license.rst new file mode 100644 index 0000000..8130fec --- /dev/null +++ b/doc-source/license.rst @@ -0,0 +1,10 @@ +========= +License +========= + +``mathematical`` is licensed under the :choosealicense:`LGPL-3.0` + +.. license-info:: LGPL-3.0 + +.. license:: + :py: mathematical diff --git a/doc-source/requirements.txt b/doc-source/requirements.txt index f291229..0be0ef1 100644 --- a/doc-source/requirements.txt +++ b/doc-source/requirements.txt @@ -1,7 +1,7 @@ -autodocsumm>=0.2.0 -default-values>=0.4.2 +default-values>=0.5.0 domdf-sphinx-theme>=0.3.0 extras-require>=0.2.0 +html-section>=0.1.0 mypy>=0.782 pyyaml>=5.3.1 repo-helper-sphinx-theme>=0.0.2 @@ -9,12 +9,13 @@ seed-intersphinx-mapping>=0.3.1 sphinx<3.4.0,>=3.0.3 sphinx-copybutton>=0.2.12 sphinx-debuginfo>=0.1.0 +sphinx-licenseinfo>=0.1.1 sphinx-notfound-page>=0.5 sphinx-prompt>=1.1.0 sphinx-pyproject>=0.1.0 sphinx-tabs>=1.1.13 -sphinx-toolbox>=2.2.0 +sphinx-toolbox>=2.13.0 sphinxcontrib-httpdomain>=1.7.0 sphinxemoji>=0.1.6 tabulate>=0.8.7 -toctree-plus>=0.1.0 +toctree-plus>=0.5.0 diff --git a/formate.toml b/formate.toml index 7968172..d49457f 100644 --- a/formate.toml +++ b/formate.toml @@ -38,6 +38,7 @@ known_third_party = [ "coverage_pyver_pragma", "domdf_python_tools", "github", + "importlib_metadata", "numpy", "pandas", "pytest", diff --git a/justfile b/justfile new file mode 100644 index 0000000..f3b215e --- /dev/null +++ b/justfile @@ -0,0 +1,23 @@ +default: lint + +pdf-docs: latex-docs + make -C doc-source/build/latex/ + +latex-docs: + SPHINX_BUILDER=latex tox -e docs + +unused-imports: + tox -e lint -- --select F401 + +incomplete-defs: + #!/usr/bin/env bash + tox -e mypy -- --disallow-incomplete-defs --disallow-untyped-defs | grep "Function is missing a .* annotation" || exit 0 + +vdiff: + git diff $(repo-helper show version -q)..HEAD + +bare-ignore: + greppy '# type:? *ignore(?!\[|\w)' -s + +lint: unused-imports incomplete-defs bare-ignore + tox -n qa diff --git a/pyproject.toml b/pyproject.toml index 9a6f9a1..dd3d836 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,8 +11,8 @@ keywords = [ "mathematics", "utilities",] dynamic = [ "requires-python", "classifiers", "dependencies",] [[project.authors]] -email = "dominic@davis-foster.co.uk" name = "Dominic Davis-Foster" +email = "dominic@davis-foster.co.uk" [project.license] @@ -42,3 +42,114 @@ license-key = "LGPL-3.0-or-later" [tool.mkrecipe] conda-channels = [ "conda-forge", "domdfcoding",] extras = "all" + +[tool.sphinx-pyproject] +github_username = "domdfcoding" +github_repository = "mathematical" +author = "Dominic Davis-Foster" +project = "mathematical" +copyright = "2019-2021 Dominic Davis-Foster" +language = "en" +package_root = "mathematical" +extensions = [ + "sphinx_toolbox", + "sphinx_toolbox.more_autodoc", + "sphinx_toolbox.more_autosummary", + "sphinx_toolbox.documentation_summary", + "sphinx_toolbox.tweaks.param_dash", + "sphinx_toolbox.tweaks.latex_layout", + "sphinx_toolbox.tweaks.latex_toc", + "sphinx.ext.intersphinx", + "sphinx.ext.mathjax", + "sphinxcontrib.extras_require", + "sphinx.ext.todo", + "sphinxemoji.sphinxemoji", + "notfound.extension", + "sphinx_copybutton", + "sphinxcontrib.default_values", + "sphinxcontrib.toctree_plus", + "sphinx_debuginfo", + "sphinx_licenseinfo", + "seed_intersphinx_mapping", + "html_section", +] +sphinxemoji_style = "twemoji" +gitstamp_fmt = "%d %b %Y" +templates_path = [ "_templates",] +html_static_path = [ "_static",] +source_suffix = ".rst" +master_doc = "index" +suppress_warnings = [ "image.nonlocal_uri",] +pygments_style = "default" +html_theme = "domdf_sphinx_theme" +html_theme_path = [ "../..",] +html_show_sourcelink = true +toctree_plus_types = [ + "class", + "confval", + "data", + "directive", + "enum", + "exception", + "flag", + "function", + "namedtuple", + "protocol", + "role", + "typeddict", +] +add_module_names = false +hide_none_rtype = true +all_typevars = true +overloads_location = "bottom" +html_codeblock_linenos_style = "table" +autodoc_exclude_members = [ + "__dict__", + "__class__", + "__dir__", + "__weakref__", + "__module__", + "__annotations__", + "__orig_bases__", + "__parameters__", + "__subclasshook__", + "__init_subclass__", + "__attrs_attrs__", + "__init__", + "__new__", + "__getnewargs__", + "__abstractmethods__", + "__hash__", +] + +[tool.mypy] +python_version = "3.6" +namespace_packages = true +check_untyped_defs = true +warn_unused_ignores = true +no_implicit_optional = true +show_error_codes = true + +[tool.snippet-fmt] +directives = [ "code-block",] + +[tool.dependency-dash."requirements.txt"] +order = 10 + +[tool.dependency-dash."tests/requirements.txt"] +order = 20 +include = false + +[tool.dependency-dash."doc-source/requirements.txt"] +order = 30 +include = false + +[tool.snippet-fmt.languages.python] +reformat = true + +[tool.snippet-fmt.languages.TOML] +reformat = true + +[tool.snippet-fmt.languages.ini] + +[tool.snippet-fmt.languages.json] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index cd5c33a..0000000 --- a/setup.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# This file is managed by 'repo_helper'. -# You may add new sections, but any changes made to the following sections will be lost: -# * metadata -# * options -# * options.packages.find -# * mypy -# * options.entry_points - -[mypy] -python_version = 3.6 -namespace_packages = True -check_untyped_defs = True -warn_unused_ignores = True diff --git a/tests/requirements.txt b/tests/requirements.txt index 5d413fa..979c094 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -3,10 +3,11 @@ coincidence>=0.2.0 coverage>=5.1 coverage-pyver-pragma>=0.2.1 domdf-python-tools[testing]>=2.0.1 +importlib-metadata>=3.6.0 iniconfig!=1.1.0,>=1.0.1 pytest>=6.0.0 pytest-cov>=2.8.1 -pytest-randomly>=3.6.0 +pytest-randomly>=3.7.0 pytest-rerunfailures>=9.0 pytest-timeout>=1.4.2 pytz>=2019.1 diff --git a/tox.ini b/tox.ini index a911d8c..925f1b4 100644 --- a/tox.ini +++ b/tox.ini @@ -20,17 +20,18 @@ envlist = py36, py37, py38, py39, py310-dev, mypy, build skip_missing_interpreters = True isolated_build = True requires = - pip>=20.3.3 + pip>=21 tox-envlist>=0.2.1 - tox-pip-version>=0.0.7 [envlists] test = py36, py37, py38, py39, py310-dev qa = mypy, lint -cov = py36, coverage +cov = py37, coverage [testenv] -setenv = PYTHONDEVMODE = 1 +setenv = + PYTHONDEVMODE=1 + PIP_DISABLE_PIP_VERSION_CHECK=1 deps = -r{toxinidir}/tests/requirements.txt commands = python --version @@ -39,10 +40,9 @@ commands = [testenv:docs] setenv = SHOW_TODOS = 1 basepython = python3.8 -pip_version = pip>=21 changedir = {toxinidir}/doc-source deps = -r{toxinidir}/doc-source/requirements.txt -commands = sphinx-build -M html . ./build {posargs} +commands = sphinx-build -M {env:SPHINX_BUILDER:html} . ./build {posargs} [testenv:build] skip_install = True @@ -62,24 +62,27 @@ changedir = {toxinidir} ignore_errors = True skip_install = True deps = - flake8 >=3.8.2 - flake8-2020 >= 1.6.0 + flake8>=3.8.2 + flake8-2020>=1.6.0 flake8-builtins>=1.5.3 flake8-docstrings>=1.5.0 flake8-dunder-all>=0.1.1 flake8-encodings>=0.1.0 flake8-github-actions>=0.1.0 + flake8-noqa>=1.1.0 flake8-pyi>=20.10.0 flake8-pytest-style>=1.3.0 + flake8-quotes>=3.3.0 flake8-slots>=0.1.0 flake8-sphinx-links>=0.0.4 flake8-strftime>=0.1.1 flake8-typing-imports>=1.10.0 - git+https://github.com/domdfcoding/flake8-quotes.git git+https://github.com/domdfcoding/flake8-rst-docstrings-sphinx.git git+https://github.com/domdfcoding/flake8-rst-docstrings.git + git+https://github.com/python-formate/flake8-unused-arguments.git@magic-methods pydocstyle>=6.0.0 pygments>=2.7.1 + importlib_metadata<4.5.0; python_version<'3.8' commands = python3 -m flake8_rst_docstrings_sphinx mathematical tests --allow-toolbox {posargs} [testenv:mypy] @@ -87,12 +90,12 @@ basepython = python3.7 ignore_errors = True changedir = {toxinidir} deps = - mypy==0.812 + mypy==0.942 -r{toxinidir}/tests/requirements.txt commands = mypy mathematical tests {posargs} [testenv:pyup] -basepython = python3.6 +basepython = python3.7 skip_install = True ignore_errors = True changedir = {toxinidir} @@ -100,10 +103,14 @@ deps = pyupgrade-directories commands = pyup_dirs mathematical tests --py36-plus --recursive [testenv:coverage] -basepython = python3.6 +basepython = python3.7 skip_install = True ignore_errors = True whitelist_externals = /bin/bash +passenv = + COV_PYTHON_VERSION + COV_PLATFORM + COV_PYTHON_IMPLEMENTATION changedir = {toxinidir} deps = coverage>=5 @@ -115,12 +122,15 @@ 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 E303 E304 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 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 ENC001 ENC002 ENC003 ENC004 ENC011 ENC012 ENC021 ENC022 ENC023 ENC024 ENC025 ENC026 Y001,Y002 Y003 Y004 Y005 Y006 Y007 Y008 Y009 Y010 Y011 Y012 Y013 Y014 Y015 Y090 Y091 E301 E302 E305 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 SLOT000 SLOT001 SLOT002 +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 E303 E304 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 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 ENC001 ENC002 ENC003 ENC004 ENC011 ENC012 ENC021 ENC022 ENC023 ENC024 ENC025 ENC026 Y001,Y002 Y003 Y004 Y005 Y006 Y007 Y008 Y009 Y010 Y011 Y012 Y013 Y014 Y015 Y090 Y091 NQA001 NQA002 NQA003 NQA004 NQA005 NQA102 NQA103 E301 E302 E305 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 SLOT000 SLOT001 SLOT002 extend-exclude = doc-source,old,build,dist,__pkginfo__.py,setup.py,venv rst-directives = TODO envvar extras-require + license + license-info +rst-roles = choosealicense 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 SLOT000 SLOT001 SLOT002 */*.pyi: E301 E302 E305 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 SLOT000 SLOT001 SLOT002 @@ -130,6 +140,10 @@ multiline-quotes = """ docstring-quotes = """ count = True min_python_version = 3.6.1 +unused-arguments-ignore-abstract-functions = True +unused-arguments-ignore-overload-functions = True +unused-arguments-ignore-magic-methods = True +unused-arguments-ignore-variadic-names = True [coverage:run] plugins = coverage_pyver_pragma