-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 2.16 KB
/
Copy pathMakefile
File metadata and controls
58 lines (46 loc) · 2.16 KB
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
.PHONY: run_app run_advanced_app extract_text
poetry: poetry.lock install update_version_file
poetry.lock: pyproject.toml
(poetry lock)
install: poetry.lock
(poetry install)
run_app: poetry
poetry run streamlit run app.py
run_advanced_app: poetry
poetry run -- streamlit run app.py -- --app_version advanced_app
build_stlite: poetry
python -m build
cp dist/metapop-0.4.0-*-none-any.whl stlite
cp stlite/*.whl .
cp stlite/launch_stlite.py .
zip -r stlite/metapop_stlite.zip launch_stlite.py *.whl scripts/app
rm *.whl
rm launch_stlite.py
python3 stlite/make_measles_sim_html.py
requirements:
rm -f requirements.txt
poetry run pip freeze > tmp_requirements.txt
grep -v "metapop" tmp_requirements.txt > requirements.txt
metapop_version=$$(poetry version -s); \
echo "metapop==$$metapop_version" >> requirements.txt
rm tmp_requirements.txt
manifest:
rm -f manifest.json
poetry run rsconnect write-manifest streamlit . --overwrite --exclude Makefile --exclude README.md
update_version_file:
rm -f metapop/version.py
echo "# This file is automatically generated by the Makefile." > ./metapop/version.py
echo "# Do not edit this file directly." >> metapop/version.py
echo "# This file contains the version information for the metapop package." >> metapop/version.py
echo "__all__ = [\"__version__\", \"__versiondate__\", \"__git_commit__\"]\n" >> metapop/version.py
echo "__version__ = \"$$(poetry version -s)\"" >> metapop/version.py
echo "__versiondate__ = \"$$(date +"%Y-%m-%d")\"" >> metapop/version.py
echo "__git_commit__ = \"$$(git rev-parse main)\" # pragma: allowlist secret" >> metapop/version.py
release: poetry requirements manifest
test: poetry
poetry run pytest -v
extract_text: poetry
@node -v >/dev/null 2>&1 || (echo "Node.js is not installed. On Ubuntu, run 'sudo apt install nodejs'"; exit 1)
@npm -v >/dev/null 2>&1 || (echo "npm is not installed. On Ubuntu, run 'sudo apt install npm'"; exit 1)
@npx playwright --version >/dev/null 2>&1 || (echo "Playwright is not installed. On Ubuntu, run 'sudo npx playwright install-deps', 'poetry add playwright', 'poetry run npx playwright install'"; exit 1)
@poetry run scripts/extract_to_docx/extract_to_docx.py