-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
58 lines (46 loc) · 1.1 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
PYTHON?=python
SOURCES=usort
.PHONY: venv
venv:
$(PYTHON) -m venv --clear .venv
source .venv/bin/activate && make install
@echo 'run `source .venv/bin/activate` to use virtualenv'
.PHONY: clean
clean:
rm -rf build dist html
.PHONY: distclean
distclean:
rm -rf .venv .mypy_cache .coverage
# The rest of these are intended to be run within the venv, where python points
# to whatever was used to set up the venv.
.PHONY: install
install:
python -m pip install -U pip setuptools
python -m pip install -e .[dev,docs]
.PHONY: test
test:
python -m coverage run -m usort.tests $(TESTOPTS)
python -m coverage report
python -m mypy --strict usort --install-types --non-interactive
.PHONY: format
format:
python -m ufmt format $(SOURCES)
.PHONY: lint
lint:
python -m ufmt check $(SOURCES)
python -m flake8 $(SOURCES)
/bin/bash check_copyright.sh
.PHONY: deps
deps:
python -m pessimist --requirements= -c "python -m usort --help" .
.PHONY: backcompat
backcompat:
python check_backcompat.py
.PHONY: html
html:
sphinx-build -ab html docs html
.PHONY: release
release:
rm -rf dist
hatch build
hatch publish