-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
83 lines (60 loc) · 2.27 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
80
81
82
# -------------------------------------------------------------------------
# The CodeChecker Infrastructure
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
# -------------------------------------------------------------------------
CURRENT_DIR = $(shell pwd)
ROOT = $(CURRENT_DIR)
BUILD_DIR = $(CURRENT_DIR)/build
TRANSFORMER_TOOL_DIR = $(BUILD_DIR)/compilation_database_transformer
ACTIVATE_DEV_VENV ?= . venv_dev/bin/activate
ACTIVATE_RUNTIME_VENV ?= . venv/bin/activate
VENV_DEV_REQ_FILE ?= requirements_py/dev/requirements.txt
VENV_PROD_REQ_FILE ?= requirements_py/prod/requirements.txt
default: all
all: package
venv:
# Create a virtual environment which can be used to run the build package.
virtualenv -p python3 venv && \
$(ACTIVATE_RUNTIME_VENV) && pip3 install -r $(VENV_PROD_REQ_FILE)
clean_venv:
rm -rf venv
pip_dev_deps:
pip3 install -r $(VENV_DEV_REQ_FILE)
venv_dev:
# Create a virtual environment for development.
virtualenv -p python3 venv_dev && \
$(ACTIVATE_DEV_VENV) && pip3 install -r $(VENV_DEV_REQ_FILE)
clean_venv_dev:
rm -rf venv_dev
clean_venvs: clean_venv clean_venv_dev
include tests/Makefile
package:
# Install package in 'development mode'.
python3 setup.py develop
package_in_env: venv_dev
# Install package in 'development mode'.
$(ACTIVATE_DEV_VENV) && python3 setup.py develop
build:
python3 setup.py build --build-purelib $(TRANSFORMER_TOOL_DIR)
build_in_env: venv_dev
$(ACTIVATE_DEV_VENV) && python3 setup.py build --build-purelib $(TRANSFORMER_TOOL_DIR)
dist:
# Create a source distribution.
python3 setup.py sdist
dist_in_env: venv_dev
# Create a source distribution.
$(ACTIVATE_DEV_VENV) && python3 setup.py sdist
upload_test:
# Upload package to the TestPyPI repository.
$(eval PKG_NAME := $(shell python3 setup.py --name))
$(eval PKG_VERSION := $(shell python3 setup.py --version))
twine upload -r testpypi dist/$(PKG_NAME)-$(PKG_VERSION).tar.gz
upload:
# Upload package to the PyPI repository.
$(eval PKG_NAME := $(shell python3 setup.py --name))
$(eval PKG_VERSION := $(shell python3 setup.py --version))
twine upload -r pypi dist/$(PKG_NAME)-$(PKG_VERSION).tar.gz
clean:
rm -rf $(BUILD_DIR)
rm -rf compilation_database_transformer.egg-info