Skip to content

Commit f715e43

Browse files
FIx Makefile with Python 3 command names
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
1 parent 458de80 commit f715e43

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ check-dictionaries:
2727
exit 1; \
2828
fi; \
2929
done
30-
@if command -v pytest > /dev/null; then \
31-
pytest codespell_lib/tests/test_dictionary.py; \
30+
@if python3 -c 'import pytest'; then \
31+
python3 -m pytest codespell_lib/tests/test_dictionary.py; \
3232
else \
3333
echo "Test dependencies not present, install using 'pip install -e \".[dev]\"'"; \
3434
exit 1; \
@@ -48,13 +48,18 @@ check-manifest:
4848
check-manifest --no-build-isolation
4949

5050
check-distutils:
51-
python setup.py check --restructuredtext --strict
51+
python3 setup.py check --restructuredtext --strict
5252

5353
flake8:
5454
flake8
5555

5656
pytest:
57-
pytest codespell_lib
57+
@if python3 -c 'import pytest'; then \
58+
python3 -m pytest codespell_lib; \
59+
else \
60+
echo "Test dependencies not present, install using 'pip install -e \".[dev]\"'"; \
61+
exit 1; \
62+
fi
5863

5964
clean:
6065
rm -rf codespell.1

0 commit comments

Comments
 (0)