Last active
January 7, 2018 22:43
-
-
Save mexisme/06370ac15946569e59d419f3a76c2846 to your computer and use it in GitHub Desktop.
Vendorising Python pips via Pipfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Makefile-friendly version of: | |
# | |
# pipenv run -- pip install -r <(pipenv lock -r) --target $PWD/vendored --no-deps | |
# You will need to add something like the following to your Main .py file: | |
# | |
# import os | |
# import sys | |
# parent_dir = os.path.abspath(os.path.dirname(__file__)) | |
# # (Might need to adjust the path, e.g. adding '..' if appropriate) | |
# vendor_dir = os.path.join(parent_dir, 'vendored') | |
# # (Add vendor directory to module search path) | |
# sys.path.append(vendor_dir) | |
PIPENV=pipenv | |
PIP=pip | |
VENDOR_DIR=vendored | |
$(VENDOR_DIR): requirements.txt | |
$(PIPENV) run -- $(PIP) install -r "$<" --target "$@" --no-deps | |
.INTERMEDIATE: requirements.txt | |
Pipfile.lock requirements.txt: Pipfile | |
$(PIPENV) lock -r >"$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment