Pillow/Makefile

127 lines
3.6 KiB
Makefile
Raw Normal View History

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:
pytest -qq
2014-06-27 23:07:53 +04:00
rm -r htmlcov || true
coverage report
2020-08-01 12:21:28 +03:00
.PHONY: doc
doc:
2014-07-15 08:02:12 +04:00
$(MAKE) -C docs html
2020-08-01 12:21:28 +03:00
.PHONY: doccheck
doccheck:
$(MAKE) -C docs html
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
2020-08-01 12:21:28 +03:00
.PHONY: docserve
docserve:
cd docs/_build/html && python3 -m http.server 2> /dev/null&
2020-08-01 12:21:28 +03:00
.PHONY: help
help:
2016-09-24 04:49:32 +03:00
@echo "Welcome to Pillow development. Please use \`make <target>\` where <target> is one of"
@echo " clean remove build products"
@echo " coverage run coverage test (in progress)"
@echo " doc make html docs"
@echo " docserve run an http server on the docs directory"
@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"
@echo " install-req install documentation and test dependencies"
2020-12-31 18:38:41 +03:00
@echo " install-venv (deprecated) install in virtualenv"
2021-01-01 15:32:46 +03:00
@echo " lint run the lint checks"
2021-01-02 01:46:03 +03:00
@echo " lint-fix run black and isort to (mostly) fix lint issues."
@echo " release-test run code and package tests before release"
@echo " test run tests on installed pillow"
@echo " upload build and upload sdists to PyPI"
@echo " upload-test build and upload sdists to test.pythonpackages.com"
2020-08-01 12:21:28 +03:00
.PHONY: inplace
inplace: clean
python3 -m pip install -e --global-option="build_ext" --global-option="--inplace" .
2020-08-01 12:21:28 +03:00
.PHONY: install
install:
python3 -m pip install .
2019-09-26 15:12:28 +03:00
python3 selftest.py
2020-08-01 12:21:28 +03:00
.PHONY: install-coverage
install-coverage:
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
2020-08-01 12:21:28 +03:00
.PHONY: debug
debug:
# make a debug version if we don't have a -dbg python. Leaves in symbols
# for our stuff, kills optimization, and redirects to dev null so we
# see any build failures.
make clean > /dev/null
CFLAGS='-g -O0' python3 -m pip install --global-option="build_ext" . > /dev/null
2020-08-01 12:21:28 +03:00
.PHONY: install-req
install-req:
python3 -m pip install -r requirements.txt
2020-08-01 12:21:28 +03:00
.PHONY: install-venv
2016-06-17 13:03:21 +03:00
install-venv:
echo "'install-venv' is deprecated and will be removed in a future Pillow release"
virtualenv .
bin/pip install -r requirements.txt
2020-08-01 12:21:28 +03:00
.PHONY: release-test
release-test:
$(MAKE) install-req
python3 -m pip install -e .
2019-09-26 15:12:28 +03:00
python3 selftest.py
python3 -m pytest Tests
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
check-manifest
pyroma .
$(MAKE) readme
2020-08-01 12:21:28 +03:00
.PHONY: sdist
sdist:
python3 -m build --help > /dev/null 2>&1 || python3 -m pip install build
python3 -m build --sdist
2020-08-01 12:21:28 +03:00
.PHONY: test
test:
pytest -qq
2021-04-09 14:39:28 +03:00
.PHONY: valgrind
valgrind:
python3 -c "import pytest_valgrind" || pip3 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
readme:
python3 setup.py --long-description | markdown2 > .long-description.html && open .long-description.html
2020-12-30 13:51:04 +03:00
.PHONY: lint
lint:
2020-12-31 18:38:57 +03:00
tox --help > /dev/null || python3 -m pip install tox
2020-12-30 13:51:04 +03:00
tox -e lint
.PHONY: lint-fix
lint-fix:
2021-10-15 13:07:53 +03:00
black --target-version py37 .
2021-01-01 07:54:53 +03:00
isort .