|
| 1 | +# A GNU Makefile to run various tasks - compatibility for us old-timers. |
| 2 | + |
| 3 | +# Note: This makefile include remake-style target comments. |
| 4 | +# These comments before the targets start with #: |
| 5 | +# remake --tasks to shows the targets and the comments |
| 6 | + |
| 7 | +GIT2CL ?= admin-tools/git2cl |
| 8 | +PYTHON ?= python |
| 9 | +PIP ?= $(PYTHON) -m pip |
| 10 | +RM ?= rm |
| 11 | + |
| 12 | + |
| 13 | +.PHONY: all build \ |
| 14 | + check clean \ |
| 15 | + develop dist doc doc-data \ |
| 16 | + pypi-setup \ |
| 17 | + pytest \ |
| 18 | + rmChangeLog \ |
| 19 | + test |
| 20 | + |
| 21 | +#: Default target - same as "develop" |
| 22 | +all: develop |
| 23 | + |
| 24 | +#: build everything needed to install |
| 25 | +build: pypi-setup |
| 26 | + $(PYTHON) ./setup.py build |
| 27 | + |
| 28 | +#: Check Python version, and install PyPI dependencies |
| 29 | +pypi-setup: |
| 30 | + $(PIP) install -e . |
| 31 | + |
| 32 | +#: Set up to run from the source tree |
| 33 | +develop: pypi-setup |
| 34 | + |
| 35 | +#: Make distirbution: wheels, eggs, tarball |
| 36 | +dist: |
| 37 | + ./admin-tools/make-dist.sh |
| 38 | + |
| 39 | +#: Install pymathics.graph |
| 40 | +install: pypi-setup |
| 41 | + $(PYTHON) setup.py install |
| 42 | + |
| 43 | +# Run tests |
| 44 | +test check: pytest doctest |
| 45 | + |
| 46 | +#: Remove derived files |
| 47 | +clean: clean-pyc |
| 48 | + |
| 49 | +#: Remove old PYC files |
| 50 | +clean-pyc: |
| 51 | + @find . -name "*.pyc" -type f -delete |
| 52 | + |
| 53 | +#: Run py.test tests. Use environment variable "o" for pytest options |
| 54 | +pytest: |
| 55 | + MATHICS_CHARACTER_ENCODING="ASCII" $(PYTHON) -m pytest $(PYTEST_WORKERS) test $o |
| 56 | + |
| 57 | + |
| 58 | +# #: Create data that is used to in Django docs and to build TeX PDF |
| 59 | +# doc-data mathics/doc/tex/data: mathics/builtin/*.py mathics/doc/documentation/*.mdoc mathics/doc/documentation/images/* |
| 60 | +# $(PYTHON) mathics/test.py -ot -k |
| 61 | + |
| 62 | +#: Run tests that appear in docstring in the code. |
| 63 | +doctest: |
| 64 | + MATHICS_CHARACTER_ENCODING="ASCII" $(PYTHON) -m mathics.docpipeline -l pymathics.language -c "Pymathics Language" $o |
| 65 | + |
| 66 | +# #: Make Mathics PDF manual |
| 67 | +# doc mathics.pdf: mathics/doc/tex/data |
| 68 | +# (cd mathics/doc/tex && $(MAKE) mathics.pdf) |
| 69 | + |
| 70 | +#: Remove ChangeLog |
| 71 | +rmChangeLog: |
| 72 | + $(RM) ChangeLog || true |
| 73 | + |
| 74 | +#: Create a ChangeLog from git via git log and git2cl |
| 75 | +ChangeLog: rmChangeLog |
| 76 | + git log --pretty --numstat --summary | $(GIT2CL) >$@ |
| 77 | + |
| 78 | + |
| 79 | +#: Run pytest consistency and style checks |
| 80 | +check-consistency-and-style: |
| 81 | + MATHICS_LINT=t $(PYTHON) -m pytest test/consistency-and-style |
0 commit comments