-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
98 lines (70 loc) · 2.57 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
build:
poetry build
docs:
# typed_ast crashes ``sphinx-autodoc-typehints``; is dependency of ``mypy``, however not required for py3.8 and above
pip uninstall -y typed_ast && poetry run sphinx-apidoc --force --output-dir=docs --module-first src/cltk && cd docs && poetry run make html && cd ..
downloadAllModels:
poetry run python scripts/download_all_models.py
format:
poetry run isort src/cltk tests docs scripts && poetry run black src/cltk tests docs scripts
freezeDependencies:
# Update lock file from pyptoject.toml, but do not install the changed/added packages
poetry lock
install:
echo "Excluding ``[tool.poetry.dev-dependencies]`` in ``pyproject.toml``"
poetry install --no-dev
installDev:
# Including ``[tool.poetry.dev-dependencies]`` in ``pyproject.toml``
poetry install
installLegacy:
# For cltk v. 0.1
python setup.py install
installPyPI:
poetry run pip install --pre cltk
installPyPITest:
pip install --index-url https://test.pypi.org/simple/ --no-deps cltk
lint:
mkdir -p pylint && poetry run pylint --output-format=json cltk > pylint/pylint.json || true && poetry run pylint-json2html pylint/pylint.json 1> pylint/pylint.html
notebook:
poetry run jupyter notebook notebooks
preCommitUpdate:
poetry run pre-commit autoupdate && poetry run pre-commit install --install-hooks && poetry run pre-commit autoupdate
preCommitRun:
poetry run pre-commit run --all-files
publishPyPI:
make build
poetry publish
publishPyPITest:
# poetry version prerelease
make build
poetry publish --repository=testpypi
publishPyPITestConfig:
poetry config repositories.testpypi https://test.pypi.org/legacy/
shell:
echo 'Tip: Use `option ``doctest_mode`` when making doctests'
poetry run ipython --automagic
test:
echo "Going to run all tests ..."
poetry run tox
testLatNLP:
poetry run pytest tests/test_sanity_lat_only.py
testNoInternet:
poetry run pytest tests/test_sanity_no_internet.py tests/test_utils.py tests/test_text.py
testOnlyDocTests:
echo "Going to test only doctests ..."
echo "NOTE: wordnet.py doctests have been disabled!"
poetry run pytest --disable-warnings --doctest-modules --ignore=src/cltk/wordnet src/cltk/
testOnlyTestsDir:
echo "Going to test only unit tests ..."
echo "NOTE: wordnet.py doctests have been disabled!"
poetry run pytest --disable-warnings --ignore=src/cltk/wordnet tests
typing:
poetry run mypy --html-report .mypy_cache src/cltk
uninstall:
poetry run pip uninstall -y cltk
updateDependencies:
poetry update
uml:
cd docs/ && poetry run pyreverse -o svg ../src/cltk/ && cd ../
all: format lint typing test uml docs
.PHONY: build docs