Skip to content

Commit

Permalink
dev: add makefile with vendor/sync target
Browse files Browse the repository at this point in the history
  • Loading branch information
abn authored and kasteph committed Aug 27, 2020
1 parent cf80762 commit 2bbb860
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
ROOT_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))

VENDOR_SRC := $(ROOT_DIR)/vendors
VENDOR_DIR := $(ROOT_DIR)/poetry/core/_vendor
POETRY_BIN ?= $(shell which poetry)


.PHONY: vendor/lock
vendor/lock:
# regenerate lock file
@pushd $(VENDOR_SRC) && $(POETRY_BIN) lock

# regenerate vendor.txt file (exported from lockfile)
@pushd $(VENDOR_SRC) && $(POETRY_BIN) export --without-hashes \
| egrep -v "(importlib|zipp)" \
| sort > $(VENDOR_DIR)/vendor.txt


.PHONY: vendor/sync
vendor/sync: | vendor/lock
# vendor packages
@vendoring sync

# strip out *.pyi stubs
@find "$(VENDOR_DIR)" -type f -name "*.pyi" -exec rm {} \;

0 comments on commit 2bbb860

Please sign in to comment.