2020-12-30 13:25:34 +03:00
|
|
|
.DEFAULT_GOAL := help
|
2014-07-15 08:02:12 +04:00
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: clean
|
2014-06-27 23:07:53 +04:00
|
|
|
clean:
|
2019-09-26 15:12:28 +03:00
|
|
|
python3 setup.py clean
|
2017-12-30 23:11:26 +03:00
|
|
|
rm src/PIL/*.so || true
|
2014-07-09 21:13:02 +04:00
|
|
|
rm -r build || true
|
|
|
|
find . -name __pycache__ | xargs rm -r || true
|
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: coverage
|
2016-06-17 13:03:21 +03:00
|
|
|
coverage:
|
2022-02-25 02:37:38 +03:00
|
|
|
python3 -c "import pytest" > /dev/null 2>&1 || python3 -m pip install pytest
|
2022-02-24 03:01:05 +03:00
|
|
|
python3 -m pytest -qq
|
2014-06-27 23:07:53 +04:00
|
|
|
rm -r htmlcov || true
|
2022-02-25 02:37:38 +03:00
|
|
|
python3 -c "import coverage" > /dev/null 2>&1 || python3 -m pip install coverage
|
2022-02-24 03:01:05 +03:00
|
|
|
python3 -m coverage report
|
2014-06-27 23:07:53 +04:00
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: doc
|
2015-06-07 17:18:31 +03:00
|
|
|
doc:
|
2022-09-23 14:45:36 +03:00
|
|
|
python3 -c "import PIL" > /dev/null 2>&1 || python3 -m pip install .
|
|
|
|
python3 -c "import olefile" > /dev/null 2>&1 || python3 -m pip install olefile
|
2014-07-15 08:02:12 +04:00
|
|
|
$(MAKE) -C docs html
|
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: doccheck
|
2016-04-09 22:28:43 +03:00
|
|
|
doccheck:
|
2022-09-23 14:45:36 +03:00
|
|
|
$(MAKE) doc
|
2016-07-01 14:53:44 +03:00
|
|
|
# Don't make our tests rely on the links in the docs being up every single build.
|
2016-07-01 14:49:44 +03:00
|
|
|
# We don't control them. But do check, and update them to the target of their redirects.
|
2016-04-19 17:29:33 +03:00
|
|
|
$(MAKE) -C docs linkcheck || true
|
2016-04-09 22:28:43 +03:00
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: docserve
|
2015-06-07 17:18:31 +03:00
|
|
|
docserve:
|
2020-12-17 07:17:59 +03:00
|
|
|
cd docs/_build/html && python3 -m http.server 2> /dev/null&
|
2015-04-01 13:16:36 +03:00
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: help
|
2015-06-07 17:08:38 +03:00
|
|
|
help:
|
2016-09-24 04:49:32 +03:00
|
|
|
@echo "Welcome to Pillow development. Please use \`make <target>\` where <target> is one of"
|
2017-10-02 14:56:05 +03:00
|
|
|
@echo " clean remove build products"
|
|
|
|
@echo " coverage run coverage test (in progress)"
|
2022-02-19 17:47:59 +03:00
|
|
|
@echo " doc make HTML docs"
|
|
|
|
@echo " docserve run an HTTP server on the docs directory"
|
2017-10-02 14:56:05 +03:00
|
|
|
@echo " html to make standalone HTML files"
|
|
|
|
@echo " inplace make inplace extension"
|
|
|
|
@echo " install make and install"
|
|
|
|
@echo " install-coverage make and install with C coverage"
|
2021-01-01 15:32:46 +03:00
|
|
|
@echo " lint run the lint checks"
|
2022-02-19 17:47:59 +03:00
|
|
|
@echo " lint-fix run Black and isort to (mostly) fix lint issues"
|
2017-10-02 14:56:05 +03:00
|
|
|
@echo " release-test run code and package tests before release"
|
2022-02-19 17:47:59 +03:00
|
|
|
@echo " test run tests on installed Pillow"
|
2015-06-07 17:08:38 +03:00
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: inplace
|
2015-06-07 17:08:38 +03:00
|
|
|
inplace: clean
|
2021-12-19 04:13:37 +03:00
|
|
|
python3 -m pip install -e --global-option="build_ext" --global-option="--inplace" .
|
2015-06-07 17:08:38 +03:00
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: install
|
2015-06-07 17:08:38 +03:00
|
|
|
install:
|
2021-12-18 11:43:23 +03:00
|
|
|
python3 -m pip install .
|
2019-09-26 15:12:28 +03:00
|
|
|
python3 selftest.py
|
2015-06-07 17:08:38 +03:00
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: install-coverage
|
2017-10-02 14:56:05 +03:00
|
|
|
install-coverage:
|
2021-12-18 11:43:23 +03:00
|
|
|
CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip install --global-option="build_ext" .
|
2019-09-26 15:12:28 +03:00
|
|
|
python3 selftest.py
|
2017-10-02 14:56:05 +03:00
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: debug
|
2016-12-20 01:15:06 +03:00
|
|
|
debug:
|
|
|
|
# make a debug version if we don't have a -dbg python. Leaves in symbols
|
2017-10-02 14:56:05 +03:00
|
|
|
# for our stuff, kills optimization, and redirects to dev null so we
|
2016-12-20 01:15:06 +03:00
|
|
|
# see any build failures.
|
|
|
|
make clean > /dev/null
|
2021-12-18 11:43:23 +03:00
|
|
|
CFLAGS='-g -O0' python3 -m pip install --global-option="build_ext" . > /dev/null
|
2016-12-20 01:15:06 +03:00
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: release-test
|
2015-06-07 17:08:38 +03:00
|
|
|
release-test:
|
2022-02-19 16:39:37 +03:00
|
|
|
python3 -m pip install -e .[tests]
|
2019-09-26 15:12:28 +03:00
|
|
|
python3 selftest.py
|
|
|
|
python3 -m pytest Tests
|
2021-12-18 11:43:23 +03:00
|
|
|
python3 -m pip install .
|
2020-10-18 23:22:24 +03:00
|
|
|
-rm dist/*.egg
|
|
|
|
-rmdir dist
|
2019-09-26 15:12:28 +03:00
|
|
|
python3 -m pytest -qq
|
2022-04-02 16:12:34 +03:00
|
|
|
python3 -m check_manifest
|
2022-02-22 03:54:42 +03:00
|
|
|
python3 -m pyroma .
|
2020-10-15 14:39:49 +03:00
|
|
|
$(MAKE) readme
|
2015-06-07 17:08:38 +03:00
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: sdist
|
2015-06-07 17:08:38 +03:00
|
|
|
sdist:
|
2021-10-22 12:01:42 +03:00
|
|
|
python3 -m build --help > /dev/null 2>&1 || python3 -m pip install build
|
|
|
|
python3 -m build --sdist
|
2022-05-18 01:11:31 +03:00
|
|
|
python3 -m twine --help > /dev/null 2>&1 || python3 -m pip install twine
|
2022-05-17 22:47:01 +03:00
|
|
|
python3 -m twine check --strict dist/*
|
2015-06-07 17:08:38 +03:00
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: test
|
2015-06-07 17:08:38 +03:00
|
|
|
test:
|
2022-02-25 02:37:38 +03:00
|
|
|
python3 -c "import pytest" > /dev/null 2>&1 || python3 -m pip install pytest
|
2022-02-22 03:54:42 +03:00
|
|
|
python3 -m pytest -qq
|
2015-06-07 17:08:38 +03:00
|
|
|
|
2021-04-09 14:39:28 +03:00
|
|
|
.PHONY: valgrind
|
|
|
|
valgrind:
|
2022-02-25 02:37:38 +03:00
|
|
|
python3 -c "import pytest_valgrind" > /dev/null 2>&1 || python3 -m pip install pytest-valgrind
|
2021-04-09 14:39:28 +03:00
|
|
|
PYTHONMALLOC=malloc valgrind --suppressions=Tests/oss-fuzz/python.supp --leak-check=no \
|
|
|
|
--log-file=/tmp/valgrind-output \
|
|
|
|
python3 -m pytest --no-memcheck -vv --valgrind --valgrind-log=/tmp/valgrind-output
|
|
|
|
|
2020-08-01 12:21:28 +03:00
|
|
|
.PHONY: readme
|
2015-09-29 13:35:07 +03:00
|
|
|
readme:
|
2022-02-25 02:37:38 +03:00
|
|
|
python3 -c "import markdown2" > /dev/null 2>&1 || python3 -m pip install markdown2
|
2022-02-22 03:54:42 +03:00
|
|
|
python3 -m markdown2 README.md > .long-description.html && open .long-description.html
|
2020-12-30 13:51:04 +03:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: lint
|
|
|
|
lint:
|
2022-02-25 02:37:38 +03:00
|
|
|
python3 -c "import tox" > /dev/null 2>&1 || python3 -m pip install tox
|
2022-02-22 03:54:42 +03:00
|
|
|
python3 -m tox -e lint
|
2020-12-31 18:39:10 +03:00
|
|
|
|
|
|
|
.PHONY: lint-fix
|
|
|
|
lint-fix:
|
2022-02-25 02:37:38 +03:00
|
|
|
python3 -c "import black" > /dev/null 2>&1 || python3 -m pip install black
|
|
|
|
python3 -c "import isort" > /dev/null 2>&1 || python3 -m pip install isort
|
2022-02-22 03:54:42 +03:00
|
|
|
python3 -m black --target-version py37 .
|
|
|
|
python3 -m isort .
|