-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (48 loc) · 1.51 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
SHELL := /usr/bin/env bash
PACKAGE_NAME := conda_poetry_liaison
TESTS_PATH := tests/
.PHONY: poetry-download
poetry-download:
curl -sSL https://install.python-poetry.org/ | python -
poetry self add "poetry-dynamic-versioning[plugin]"
.PHONY: pre-commit-install
pre-commit-install:
poetry run pre-commit install
# Reads `pyproject.toml`, solves environment, then writes lock file.
.PHONY: poetry-lock
poetry-lock:
poetry lock --no-interaction
poetry export --without-hashes > requirements.txt
.PHONY: install
install:
poetry install --no-interaction
- mkdir .mypy_cache
- poetry run mypy --install-types --non-interactive --explicit-package-bases $(PACKAGE_NAME)
.PHONY: refresh
refresh: install pre-commit-install
.PHONY: validate
validate:
poetry run pre-commit run --all-files
.PHONY: formatting
formatting:
poetry run isort --settings-path pyproject.toml ./
poetry run black --config pyproject.toml ./
### LINTING ###
.PHONY: check-codestyle
check-codestyle:
poetry run isort --diff --check-only --settings-path pyproject.toml $(PACKAGE_NAME)
poetry run black --diff --check --config pyproject.toml $(PACKAGE_NAME)
-poetry run pylint --rcfile pyproject.toml $(PACKAGE_NAME)
.PHONY: mypy
mypy:
poetry run mypy --config pyproject.toml -p $(PACKAGE_NAME)
.PHONY: lint
lint: check-codestyle mypy
### TEST ###
.PHONY: test
test:
poetry run pytest -c pyproject.toml --cov=$(PACKAGE_NAME) --cov-report=xml --junit-xml=report.xml --color=yes $(TESTS_PATH)
### BUILD ###
.PHONY: build
build:
poetry build