-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
79 lines (59 loc) · 2.14 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
PYPI_USER ?= "__token__"
PYPI_REPOSITORY ?= "https://upload.pypi.org/legacy/"
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
format:
poetry run black src tests
poetry run isort -v src tests
lint:
poetry run mypy
# Check that source is properly formatted
poetry run black --check src tests
# Check for linting issues
# Make sure imports are properly sorted
poetry run isort --check -v src tests
bandit:
poetry run bandit -lll -r tests src
test: ## run tests quickly with the default Python
poetry run pytest src tests
poetry run black --check src tests
test-integration:
bash ./integ-tests/integ-tests.sh dist/pearl*.whl
shellcheck:
shellcheck src/pearllib/static/boot/sh/pearl.sh src/pearllib/static/builtins/utils.sh integ-tests/integ-tests.sh
build:
poetry build
ls -l dist
install:
poetry install
update:
poetry update
publish-test: build ## package and upload a release
poetry config repositories.test-pypi https://test.pypi.org/legacy/ ;
@poetry config pypi-token.test-pypi "$(PYPI_PASSWORD)"
poetry publish -r test-pypi --no-interaction $(ARGS)
publish: build ## package and upload a release
# @ will not show the command to avoid exposing the password
@poetry publish --username $(PYPI_USER) --password $(PYPI_PASSWORD) --no-interaction $(ARGS)
coverage: ## check code coverage quickly with the default Python
$(COVERAGE) run --source pearllib -m pytest
$(COVERAGE) report -m
$(COVERAGE) html
$(BROWSER) htmlcov/index.html
.DEFAULT_GOAL := default
default: install format bandit test shellcheck build
.PHONY: clean clean-test clean-pyc clean-build docs install format lint bandit test build test-integration