Skip to content

Commit

Permalink
Update to PyScaffold v4.4 project features (#9)
Browse files Browse the repository at this point in the history
* Upgrade to PyScaffold 4.4 configuration

* Fix typos found by codespell
  • Loading branch information
koenvervloesem authored Jan 23, 2023
1 parent bc0e01c commit e6d34eb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/bluetooth_clocks/devices/qingping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit e6d34eb

Please sign in to comment.