From e6d34eb3b1b86cbd56331e8caf90c621b356a11a Mon Sep 17 00:00:00 2001 From: Koen Vervloesem Date: Mon, 23 Jan 2023 17:58:13 +0100 Subject: [PATCH] Update to PyScaffold v4.4 project features (#9) * Upgrade to PyScaffold 4.4 configuration * Fix typos found by codespell --- .github/workflows/ci.yml | 19 ++++++++++--------- .pre-commit-config.yaml | 9 +++++++-- CONTRIBUTING.rst | 2 +- src/bluetooth_clocks/devices/qingping.py | 2 +- tox.ini | 3 ++- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9ec487..25b2821 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,14 +28,17 @@ jobs: - uses: actions/checkout@v3 with: {fetch-depth: 0} # deep clone for setuptools-scm - uses: actions/setup-python@v4 + id: setup-python with: {python-version: "3.11"} - name: Run static analysis and format checkers run: pipx run pre-commit run --all-files --show-diff-on-failure - name: Build package distribution files - run: pipx run --spec tox==3.27.1 tox -e clean,build + run: >- + pipx run --python '${{ steps.setup-python.outputs.python-path }}' + tox -e clean,build - name: Record the path of wheel distribution id: wheel-distribution - run: echo "::set-output name=path::$(ls dist/*.whl)" + run: echo "path=$(ls dist/*.whl)" >> $GITHUB_OUTPUT - name: Store the distribution files for use in other stages # `tests` and `publish` will use the same pre-built distributions, # so we make sure to release the exact same package that was tested @@ -82,14 +85,12 @@ jobs: with: {name: python-distribution-files, path: dist/} - name: Run tests run: >- - pipx run --verbose --python '${{ steps.setup-python.outputs.python-path }}' - --spec tox==3.27.1 tox - --installpkg '${{ needs.prepare.outputs.wheel-distribution }}' - -- -rFEx --durations 10 --color yes + pipx run --python '${{ steps.setup-python.outputs.python-path }}' + tox --installpkg '${{ needs.prepare.outputs.wheel-distribution }}' + -- -rFEx --durations 10 --color yes # pytest args - name: Generate coverage report run: >- - pipx run --python '${{ steps.setup-python.outputs.python-path }}' - coverage lcov -o coverage.lcov + pipx run coverage lcov -o coverage.lcov - name: Upload coverage report to Codecov uses: codecov/codecov-action@v3 @@ -109,4 +110,4 @@ jobs: TWINE_REPOSITORY: pypi TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: pipx run --spec tox==3.27.1 tox -e publish + run: pipx run tox -e publish diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 799eb57..e77530b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: # --remove-unused-variables, # ] -- repo: https://github.com/pycqa/isort +- repo: https://github.com/PyCQA/isort rev: 5.11.4 hooks: - id: isort @@ -41,7 +41,7 @@ repos: ## If like to embrace black styles even in the docs: # - repo: https://github.com/asottile/blacken-docs -# rev: v1.12.0 +# rev: v1.13.0 # hooks: # - id: blacken-docs # additional_dependencies: [black] @@ -101,6 +101,11 @@ repos: - id: pyupgrade args: ["--py37-plus"] +- repo: https://github.com/codespell-project/codespell + rev: v2.2.2 + hooks: + - id: codespell + - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.991 hooks: diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index aaaaca2..5445da4 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -266,7 +266,7 @@ on PyPI_, the following steps can be used to release a new version for of environments, including private companies and proprietary code bases. -.. <-- strart --> +.. <-- start --> .. |the repository service| replace:: GitHub .. |contribute button| replace:: "Create pull request" diff --git a/src/bluetooth_clocks/devices/qingping.py b/src/bluetooth_clocks/devices/qingping.py index b507164..962c0e9 100644 --- a/src/bluetooth_clocks/devices/qingping.py +++ b/src/bluetooth_clocks/devices/qingping.py @@ -30,7 +30,7 @@ class CGC1(BluetoothClock): WRITE_WITH_RESPONSE = True """We use write with response to write the time to the Qingping BT Clock Lite. - Note: The device also supports write without reponse. + Note: The device also supports write without response. """ LOCAL_NAME = "Qingping BT Clock Lite" diff --git a/tox.ini b/tox.ini index 54f9323..ee58eb0 100644 --- a/tox.ini +++ b/tox.ini @@ -50,7 +50,8 @@ commands = clean: python -c 'import shutil; [shutil.rmtree(p, True) for p in ("build", "dist", "docs/_build")]' clean: python -c 'import pathlib, shutil; [shutil.rmtree(p, True) for p in pathlib.Path("src").glob("*.egg-info")]' build: python -m build {posargs} - +# By default, both `sdist` and `wheel` are built. If your sdist is too big or you don't want +# to make it available, consider running: `tox -e build -- --wheel` [testenv:{docs,doctests,linkcheck}] description =