generated from aboutcode-org/skeleton
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
68 lines (55 loc) · 1.91 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
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/skeleton for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#
# Python version can be specified with `$ PYTHON_EXE=python3.x make conf`
PYTHON_EXE?=python3
VENV=venv
ACTIVATE?=. ${VENV}/bin/activate;
ARCH := $(shell uname -m)
ifeq ($(ARCH),aarch64)
PLAT_NAME := "manylinux2014_aarch64"
GOARCH := "arm64"
else
PLAT_NAME := "manylinux1_x86_64"
GOARCH := "amd64"
endif
dev:
@echo "-> Configure the development envt."
./configure --dev
isort:
@echo "-> Apply isort changes to ensure proper imports ordering"
${VENV}/bin/isort --sl -l 100 src tests setup.py
black:
@echo "-> Apply black code formatter"
${VENV}/bin/black -l 100 src tests setup.py
doc8:
@echo "-> Run doc8 validation"
@${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/
valid: isort black
check:
@echo "-> Run pycodestyle (PEP8) validation"
@${ACTIVATE} pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,migrations,settings.py,.cache .
@echo "-> Run isort imports ordering validation"
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests .
@echo "-> Run black validation"
@${ACTIVATE} black --check --check -l 100 src tests setup.py
clean:
@echo "-> Clean the Python env"
./configure --clean
test:
@echo "-> Run the test suite"
${VENV}/bin/pytest -vvs
docs:
rm -rf docs/_build/
@${ACTIVATE} sphinx-build docs/ docs/_build/
build:
rm -f src/go_inspector/bin/GoReSym_lin
python setup.py clean --all sdist
GOOS=linux GOARCH=$(GOARCH) python setup.py clean --all bdist_wheel --python-tag py3 --plat-name $(PLAT_NAME)
.PHONY: conf dev check valid black isort clean test docs