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 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 f715e43
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ check-dictionaries:
exit 1; \
fi; \
done
@if command -v pytest > /dev/null; then \
pytest codespell_lib/tests/test_dictionary.py; \
@if python3 -c 'import pytest'; then \
python3 -m pytest codespell_lib/tests/test_dictionary.py; \
else \
echo "Test dependencies not present, install using 'pip install -e \".[dev]\"'"; \
exit 1; \
Expand All @@ -48,13 +48,18 @@ 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
@if python3 -c 'import pytest'; then \
python3 -m pytest codespell_lib; \
else \
echo "Test dependencies not present, install using 'pip install -e \".[dev]\"'"; \
exit 1; \
fi

clean:
rm -rf codespell.1

0 comments on commit f715e43

Please sign in to comment.