This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 132
/
Makefile
89 lines (54 loc) · 1.85 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
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
TEST_FILTER ?= ""
TEST_MARKERS ?= ""
first: help
# ------------------------------------------------------------------------------
# Build
env: ## Create Python env
mamba env create
develop: ## Install package for development
python -m pip install --no-build-isolation -e .
build: ## Build package
python setup.py sdist
upload-pypi: ## Upload package to PyPI
twine upload dist/*.tar.gz
upload-test: ## Upload package to test PyPI
twine upload --repository test dist/*.tar.gz
# ------------------------------------------------------------------------------
# Testing
check: ## Check linting
flake8
isort . --project tsne --check-only --diff
black . --check
fmt: ## Format source
isort . --project tsne
black .
test: ## Run tests
pytest -k $(TEST_FILTER) -m "$(TEST_MARKERS)"
test-all: ## Run all tests
pytest -k $(TEST_FILTER)
report: ## Generate coverage reports
coverage xml
coverage html
docker-img: ## Docker image for testing
docker build -t tsne .
docker-run: ## Run docker container
docker run -it -v $(CURDIR):/workdir tsne
# ------------------------------------------------------------------------------
# Other
clean: ## Clean build files
rm -rf build dist site htmlcov .pytest_cache .eggs
rm -f .coverage coverage.xml tsne/_generated_version.py
find . -type f -name '*.py[co]' -delete
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type d -name .ipynb_checkpoints -exec rm -rf {} +
cleanall: clean ## Clean everything
rm -rf *.egg-info
rm *.so tsne/bh_sne.cpp
help: ## Show this help menu
@grep -E '^[0-9a-zA-Z_-]+:.*?##.*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?##"; OFS="\t\t"}; {printf "\033[36m%-30s\033[0m %s\n", $$1, ($$2==""?"":$$2)}'