-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
52 lines (41 loc) · 1.56 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
SHELL=/bin/bash
PYTHON=python3
PYTHON_ENV_ROOT=envs
PYTHON_DEV_ENV=$(PYTHON_ENV_ROOT)/$(PYTHON)-dev
PYTHON_PACKAGING_ENV=$(PYTHON_ENV_ROOT)/$(PYTHON)-packaging-env
.PHONY: clean doc sdist test ci-test shell freeze
# development environment #####################################################
$(PYTHON_DEV_ENV)/.created: REQUIREMENTS.dev.txt
rm -rf $(PYTHON_DEV_ENV) && \
$(PYTHON) -m venv $(PYTHON_DEV_ENV) && \
. $(PYTHON_DEV_ENV)/bin/activate && \
pip install pip --upgrade && \
pip install -r ./REQUIREMENTS.dev.txt && \
date > $(PYTHON_DEV_ENV)/.created
dev-env: $(PYTHON_DEV_ENV)/.created
# packaging environment #######################################################
$(PYTHON_PACKAGING_ENV)/.created: REQUIREMENTS.packaging.txt
rm -rf $(PYTHON_PACKAGING_ENV) && \
$(PYTHON) -m venv $(PYTHON_PACKAGING_ENV) && \
. $(PYTHON_PACKAGING_ENV)/bin/activate && \
pip install --upgrade pip && \
pip install -r REQUIREMENTS.packaging.txt
date > $(PYTHON_PACKAGING_ENV)/.created
packaging-env: $(PYTHON_PACKAGING_ENV)/.created
# environment helper ##########################################################
clean:
rm -rf $(PYTHON_ENV_ROOT)
shell: dev-env
. $(PYTHON_DEV_ENV)/bin/activate && \
rlpython
freeze: dev-env
. $(PYTHON_DEV_ENV)/bin/activate && \
pip freeze
# packaging ###################################################################
sdist: packaging-env
. $(PYTHON_PACKAGING_ENV)/bin/activate && \
rm -rf dist *.egg-info && \
./setup.py sdist
_release: sdist
. $(PYTHON_PACKAGING_ENV)/bin/activate && \
twine upload --config-file ~/.pypirc.fscherf dist/*