Skip to content

Instantly share code, notes, and snippets.

@minhoryang
Last active November 30, 2017 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save minhoryang/a7b498c742ec81c7a6661bca5f4232c1 to your computer and use it in GitHub Desktop.
Save minhoryang/a7b498c742ec81c7a6661bca5f4232c1 to your computer and use it in GitHub Desktop.
PEX Trial
PACKAGE=$(shell basename `pwd`) # ""
VERSION=$(shell git describe --tags) # ignorable
OUTPUT_NAME=$(PACKAGE)-$(VERSION)
.PHONY: build_pex
build_pex: clean $(OUTPUT_NAME).pex
.PHONY: prepare_pex
prepare_pex:
pip install --upgrade pip wheel pex
$(OUTPUT_NAME).pex: prepare_pex dist/$(OUTPUT_NAME).tar.gz requirements.txt
pex -o $(OUTPUT_NAME).pex --no-pypi -f dist/ -c minhoryang -r requirements.txt $(PACKAGE)
dist/$(OUTPUT_NAME).tar.gz: setup.py requirements.txt
python setup.py sdist
pip download -r requirements.txt -d dist/
.PHONY: clean
clean:
rm $(OUTPUT_NAME).pex
rm -rf dist/
rm -rf *.egg-info build/ */__pycache__/ ~/.pex/build/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment