-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
69 lines (56 loc) · 2.2 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
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 shell freeze dist rlpython local-embed socket-server \
multi-session-socket-server unix-domain-socket-server
# development environment #####################################################
$(PYTHON_DEV_ENV): pyproject.toml
rm -rf $(PYTHON_DEV_ENV) && \
$(PYTHON) -m venv $(PYTHON_DEV_ENV) && \
. $(PYTHON_DEV_ENV)/bin/activate && \
pip install pip --upgrade && \
pip install -e .
# packaging environment #######################################################
$(PYTHON_PACKAGING_ENV): pyproject.toml
rm -rf $(PYTHON_PACKAGING_ENV) && \
$(PYTHON) -m venv $(PYTHON_PACKAGING_ENV) && \
. $(PYTHON_PACKAGING_ENV)/bin/activate && \
pip install --upgrade pip && \
pip install .[packaging]
# helper ######################################################################
clean:
rm -rf $(PYTHON_ENV_ROOT)
# examples ####################################################################
rlpython: | $(PYTHON_DEV_ENV)
. $(PYTHON_DEV_ENV)/bin/activate && \
. examples/environment.sh && \
rlpython $(args)
local-embed: | $(PYTHON_DEV_ENV)
. $(PYTHON_DEV_ENV)/bin/activate && \
. examples/environment.sh && \
python examples/local-embed.py
socket-server: | $(PYTHON_DEV_ENV)
. $(PYTHON_DEV_ENV)/bin/activate && \
. examples/environment.sh && \
python examples/socket-server.py
multi-session-socket-server: | $(PYTHON_DEV_ENV)
. $(PYTHON_DEV_ENV)/bin/activate && \
. examples/environment.sh && \
python examples/multi-session-socket-server.py
unix-domain-socket-server: | $(PYTHON_DEV_ENV)
. $(PYTHON_DEV_ENV)/bin/activate && \
. examples/environment.sh && \
python examples/unix-domain-socket-server.py
custom-command: | $(PYTHON_DEV_ENV)
. $(PYTHON_DEV_ENV)/bin/activate && \
. examples/environment.sh && \
python examples/custom-command.py
# packaging ###################################################################
dist: | $(PYTHON_PACKAGING_ENV)
. $(PYTHON_PACKAGING_ENV)/bin/activate && \
rm -rf dist *.egg-info && \
python -m build
_release: dist
. $(PYTHON_PACKAGING_ENV)/bin/activate && \
twine upload --config-file ~/.pypirc.fscherf dist/*