This repository has been archived by the owner on Sep 23, 2024. It is now read-only.
forked from pappasam/jedi-language-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (46 loc) · 1.72 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
.PHONY: help
help: ## Print this help menu
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: require
require: ## Check that prerequisites are installed.
@if ! command -v python3 > /dev/null; then \
printf "\033[1m\033[31mERROR\033[0m: python3 not installed\n" >&2 ; \
exit 1; \
fi
@if ! python3 -c "import sys; sys.exit(sys.version_info < (3,6))"; then \
printf "\033[1m\033[31mERROR\033[0m: python 3.6+ required\n" >&2 ; \
exit 1; \
fi
@if ! command -v poetry > /dev/null; then \
printf "\033[1m\033[31mERROR\033[0m: poetry not installed.\n" >&2 ; \
printf "Please install with 'python3 -mpip install --user poetry'\n" >&2 ; \
exit 1; \
fi
.PHONY: setup
setup: require .setup_complete ## Set up the local development environment
.setup_complete: poetry.lock ## Internal helper to run the setup.
poetry install
poetry run pre-commit install
touch .setup_complete
.PHONY: test
test: setup ## Run the tests, but only for current Python version
poetry run tox -e py
.PHONY: test-all
test-all: setup ## Run the tests for all relevant Python version
poetry run tox
.PHONY: publish
publish: setup ## Build & publish the new version
poetry build
poetry publish
.PHONY: format
format: setup ## Autoformat all files in the repo. WARNING: changes files in-place
poetry run black jedi_language_server tests
poetry run isort jedi_language_server tests
poetry run docformatter --recursive --in-place jedi_language_server tests
.PHONY: clean
clean: ## Remove local development environment
if poetry env list | grep -q Activated; then \
poetry env remove python3; \
fi
rm -f .setup_complete