Skip to content

Commit

Permalink
Merge pull request #807 from ftnext/refactor/add-makefile
Browse files Browse the repository at this point in the history
refactor: Use pipx for lint and rstcheck
  • Loading branch information
ftnext authored Dec 12, 2024
2 parents f7e3545 + 3f9403b commit ec491c5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ on:
- master

jobs:
flake8:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Run flake8
run: |
# ignore errors for long lines and multi-statement lines
pipx run flake8 --ignore=E501,E701,W503 .
run: make lint
9 changes: 1 addition & 8 deletions .github/workflows/rstcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,5 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install rstcheck
- name: Run rstcheck
run: |
python -m rstcheck --ignore-directives autofunction README.rst reference/*.rst
run: make rstcheck
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lint:
# ignore errors for long lines and multi-statement lines
@pipx run flake8 --ignore=E501,E701,W503 .

rstcheck:
@pipx run rstcheck --ignore-directives autofunction README.rst reference/*.rst
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ Releases are done by running ``make-release.sh VERSION_GOES_HERE`` to build the
Testing
~~~~~~~

Prerequisite: `Install pipx <https://pipx.pypa.io/stable/installation/>`__.

To run all the tests:

.. code:: bash
Expand All @@ -306,13 +308,13 @@ To run static analysis:

.. code:: bash
python -m flake8 --ignore=E501,E701,W503 speech_recognition tests examples setup.py
make lint
To ensure RST is well-formed:

.. code:: bash
python -m rstcheck README.rst reference/*.rst
make rstcheck
Testing is also done automatically by GitHub Actions, upon every push.

Expand Down
2 changes: 0 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[options.extras_require]
dev =
flake8
rstcheck
pytest
pytest-randomly
respx
Expand Down

0 comments on commit ec491c5

Please sign in to comment.