Skip to content

Commit

Permalink
FIx Makefile with Python 3 command names
Browse files Browse the repository at this point in the history
Use `python3` instead of `python`. Command `python` is not available
by default on recent distributions such as Ubuntu 22.04.

Command `pytest` is not available on distributions such as Ubuntu 22.04,
only `pytest-3` is available. Work around by running `python -m pytest`
instead of `pytest` as suggested by README.Debian:
https://salsa.debian.org/python-team/packages/pytest/-/blob/master/debian/README.Debian
  • Loading branch information
DimitriPapadopoulos committed Oct 31, 2022
1 parent 458de80 commit 07145da
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ check-dictionaries:
exit 1; \
fi; \
done
@if command -v pytest > /dev/null; then \
pytest codespell_lib/tests/test_dictionary.py; \
else \
echo "Test dependencies not present, install using 'pip install -e \".[dev]\"'"; \
exit 1; \
fi
python3 -m pytest codespell_lib/tests/test_dictionary.py

sort-dictionaries:
@for dictionary in ${DICTIONARIES}; do \
Expand All @@ -48,13 +43,13 @@ check-manifest:
check-manifest --no-build-isolation

check-distutils:
python setup.py check --restructuredtext --strict
python3 setup.py check --restructuredtext --strict

flake8:
flake8

pytest:
pytest codespell_lib
python3 -m pytest codespell_lib/tests/test_dictionary.py

clean:
rm -rf codespell.1

0 comments on commit 07145da

Please sign in to comment.