Skip to content

Commit b44ea45

Browse files
committed
add basic pyinstaller build configuration
1 parent 7747a24 commit b44ea45

3 files changed

Lines changed: 49 additions & 0 deletions

File tree

‎Makefile‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
VENV_BIN = python3 -m venv
2+
VENV_DIR ?= .venv
3+
4+
ifeq ($(OS), Windows_NT)
5+
VENV_ACTIVATE = $(VENV_DIR)/Scripts/activate
6+
else
7+
VENV_ACTIVATE = $(VENV_DIR)/bin/activate
8+
endif
9+
10+
VENV_RUN = . $(VENV_ACTIVATE)
11+
12+
all: venv build
13+
14+
venv: $(VENV_ACTIVATE)
15+
16+
$(VENV_ACTIVATE): requirements.txt
17+
test -d $(VENV_DIR) || $(VENV_BIN) $(VENV_DIR)
18+
$(VENV_RUN); pip install -r requirements.txt
19+
touch $(VENV_DIR)/bin/activate
20+
21+
dist/localstack/localstack: main.py
22+
$(VENV_RUN); pyinstaller main.py \
23+
-n localstack \
24+
--exclude-module boto3 \
25+
--exclude-module botocore \
26+
--exclude-module moto \
27+
--exclude-module pygments \
28+
--hidden-import docker
29+
30+
build: venv dist/localstack/localstack
31+
32+
clean:
33+
rm -rf build/
34+
rm -rf dist/
35+
36+
clean-venv:
37+
rm -rf $(VENV_DIR)
38+
39+
.PHONY: clean clean-venv
40+

‎main.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import os
2+
os.environ["SKIP_PATCH_MOTO_ACCOUNT_ID"] = "1"
3+
from localstack.cli import main
4+
5+
if __name__ == '__main__':
6+
main.main()

‎requirements.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pyinstaller
2+
localstack>=0.14.0.9
3+
docker>=5.0.0

0 commit comments

Comments
 (0)