diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 50bd307c..6a4291f1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/rstcheck.yml b/.github/workflows/rstcheck.yml index 89635395..c27a54cd 100644 --- a/.github/workflows/rstcheck.yml +++ b/.github/workflows/rstcheck.yml @@ -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 diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..cbf1e79c --- /dev/null +++ b/Makefile @@ -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 diff --git a/README.rst b/README.rst index 0052ccf4..afb69b66 100644 --- a/README.rst +++ b/README.rst @@ -296,6 +296,8 @@ Releases are done by running ``make-release.sh VERSION_GOES_HERE`` to build the Testing ~~~~~~~ +Prerequisite: `Install pipx `__. + To run all the tests: .. code:: bash @@ -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. diff --git a/setup.cfg b/setup.cfg index 8de63858..33ac0595 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,5 @@ [options.extras_require] dev = - flake8 - rstcheck pytest pytest-randomly respx