forked from python-poetry/poetry-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (24 loc) · 1021 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
30
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 --no-update
.PHONY: vendor/sync
vendor/sync:
# regenerate vendor.txt file (exported from lockfile)
@pushd $(VENDOR_SRC) && $(POETRY_BIN) export --without-hashes 2> /dev/null \
| grep -E -v "(importlib|zipp)" \
| 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
@: