-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
106 lines (75 loc) · 2.77 KB
/
Makefile
File metadata and controls
106 lines (75 loc) · 2.77 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
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
99
100
101
102
103
104
105
106
# File is used for running things locally in development
.PHONY: \
confirm confirm2 \
unittest pytest test format ruff ruff_check coverage mypy check lint \
build clean_build upload_test_pypi install_test_pypi upload_pypi install_pypi \
open_github open_coveralls open_test_pypi open_pypi \
conda_create_all conda_delete_all conda_update_all
# Utilities
confirm:
@echo -n "Are you sure? [y/N] " && read ans && [ $${ans:-N} = y ]
confirm2:
@echo -n "Are you sure? [Y/n] " && read ans && [ $${ans:-Y} != Y ] && echo "Aborted" && exit 1
# Commands for development
unittest:
python -m unittest -v tests/vtpk_reader_tests.py
pytest:
pytest
test:
pytest
format:
ruff format
ruff ruff_check:
ruff check --fix
coverage:
coverage run -m unittest -v tests/vtpk_reader_tests.py
coverage report
coverage html
open htmlcov/index.html
mypy:
mypy vtpk_reader
mypy tests
check lint: pytest format ruff_check mypy
# Artifact-related
clean_build:
-rm -fR ./dist/*
# This builds artifacts for upload
build: clean_build
python -m build
ls -la dist/
upload_test_pypi:
python -m twine upload --repository testpypi dist/*
install_test_pypi:
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps vtpk-reader
upload_pypi: confirm
python -m twine upload dist/*
install_pypi:
python -m twine upload dist/*
# Open relevant webpages
open_github:
open "https://github.com/kshklovsky/vtpk-reader"
open_coveralls:
open "https://coveralls.io/github/kshklovsky/vtpk-reader"
open_test_pypi:
open "https://test.pypi.org/project/vtpk-reader/"
open_pypi:
open "https://pypi.org/project/vtpk-reader/"
# Conda environment management
conda_create_all:
conda env create --yes --file scripts/conda_environments/conda_vtpk_devel_p309.yml
conda env create --yes --file scripts/conda_environments/conda_vtpk_devel_p311.yml
conda env create --yes --file scripts/conda_environments/conda_vtpk_test_p309_pip.yml
conda env create --yes --file scripts/conda_environments/conda_vtpk_test_p309_pip_bare.yml
conda env create --yes --file scripts/conda_environments/conda_vtpk_test_p311_pip.yml
conda_delete_all:
-conda env remove -n vtpk_devel_p309 --yes
-conda env remove -n vtpk_devel_p311 --yes
-conda env remove -n vtpk_test_p309_pip --yes
-conda env remove -n vtpk_test_p309_pip_bare --yes
-conda env remove -n vtpk_test_p311_pip --yes
conda_update_all:
conda env update --prune --file scripts/conda_environments/conda_vtpk_devel_p309.yml
conda env update --prune --file scripts/conda_environments/conda_vtpk_devel_p311.yml
conda env update --prune --file scripts/conda_environments/conda_vtpk_test_p309_pip.yml
conda env update --prune --file scripts/conda_environments/conda_vtpk_test_p309_pip_bare.yml
conda env update --prune --file scripts/conda_environments/conda_vtpk_test_p311_pip.yml