-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (43 loc) · 1.03 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
PROJECT_NAME = "freshworks"
VENV_DIR = .venv
ifeq ($(OS),Windows_NT)
PYTHON = py
VENV_BIN = ./$(VENV_DIR)/Scripts
else
PYTHON = python3
VENV_BIN = ./$(VENV_DIR)/bin
endif
VENV_PYTHON = $(VENV_BIN)/python
VENV_PIP = $(VENV_PYTHON) -m pip
venv:
$(PYTHON) -m pip install --upgrade pip
$(PYTHON) -m pip install --upgrade virtualenv
$(PYTHON) -m virtualenv .venv
$(VENV_PIP) install --upgrade pip
# Build Dependencies
$(VENV_PIP) install --upgrade setuptools wheel
# Publish Dependencies
$(VENV_PIP) install --upgrade twine
clean:
@echo "Removing temporary files, caches, and build files."
# Build Directories
rm -rf build/
rm -rf dist/
# Temporary Files
rm -rf __pycache__/
rm -rf */**/__pycache__/
rm -rf *.egg-info/
rm -rf */**/*.egg-info/
rm -rf .mypy_cache/
# Logs
rm -rf logs/
rm -rf */**/logs/
rm -rf *.log
rm -rf */**/*.log
build: venv
@echo "Building $(PROJECT_NAME)."
# Build
$(VENV_PYTHON) setup.py sdist bdist_wheel
publish: build
@echo "Deploying $(PROJECT_NAME) to PyPi."
$(VENV_PYTHON) -m twine upload dist/*