forked from python-poetry/poetry-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
29 lines (23 loc) · 972 Bytes
/
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
SHELL := $(shell which bash) -e
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
ROOT_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
VENDOR_SRC := $(ROOT_DIR)/vendors
VENDOR_DIR := $(ROOT_DIR)/src/poetry/core/_vendor
VENDOR_TXT := $(VENDOR_DIR)/vendor.txt
POETRY_BIN ?= $(shell which poetry)
.PHONY: vendor/lock
vendor/lock: $(VENDOR_LOCK)
# regenerate lock file
@pushd $(VENDOR_SRC) && $(POETRY_BIN) lock
.PHONY: vendor/sync
vendor/sync:
# regenerate vendor.txt file (exported from lockfile)
@pushd $(VENDOR_SRC) && $(POETRY_BIN) export --without-hashes 2> /dev/null \
| sort > $(VENDOR_TXT)
# vendor packages
@$(POETRY_BIN) run vendoring sync
# strip out *.pyi stubs
@find "$(VENDOR_DIR)" -type f -name "*.pyi" -exec rm {} \;
.PHONY: vendor/update
vendor/update: | vendor/lock vendor/sync
@: