# Natural Language Toolkit: source Makefile # # Copyright (C) 2001-2026 NLTK Project # Author: Steven Bird # Edward Loper # URL: # For license information, see LICENSE.TXT PYTHON = python VERSION = $(shell $(PYTHON) -c 'import nltk; print(nltk.__version__)' | sed '/^Warning: */d') NLTK_URL = $(shell $(PYTHON) -c 'import nltk; print(nltk.__url__)' | sed '/^Warning: */d') .PHONY: all clean clean_code all: dist ######################################################################## # TESTING ######################################################################## DOCTEST_FILES = nltk/test/*.doctest DOCTEST_CODE_FILES = nltk/*.py nltk/*/*.py doctest: pytest $(DOCTEST_FILES) doctest_code: pytest $(DOCTEST_CODE_FILES) demotest: find nltk -name "*.py"\ -and -not -path *misc* \ -and -not -name brown_ic.py \ -exec echo ==== '{}' ==== \; -exec python '{}' \; ######################################################################## # DISTRIBUTIONS ######################################################################## dist: clean_code $(PYTHON) -m build ######################################################################## # CLEAN ######################################################################## clean: clean_code rm -rf build web/_build iso dist api MANIFEST nltk-$(VERSION) nltk.egg-info clean_code: rm -f `find nltk -name '*.pyc'` rm -f `find nltk -name '*.pyo'` rm -f `find . -name '*~'` rm -rf `find . -name '__pycache__'` rm -f MANIFEST # regenerate manifest from MANIFEST.in