forked from Giglium/vinted_scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (42 loc) · 1.58 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# ====================================================================================
# Setup Project
ROOT := $(shell pwd)
PROJECT_FOLDER := $(ROOT)/src
BUILD_TOOLS_FOLDER := $(ROOT)/build-tools
MODULE_NAME := vinted_scraper
TECHNOLOGY := python
include $(BUILD_TOOLS_FOLDER)/common.mk
include $(BUILD_TOOLS_FOLDER)/common_linters.mk
include $(BUILD_TOOLS_FOLDER)/$(TECHNOLOGY)/python.mk
include $(BUILD_TOOLS_FOLDER)/git.mk
include $(BUILD_TOOLS_FOLDER)/image/docker.mk
AUTOGENERATED_FILE_REGEX := .*/(docs|htmlcov)/.* # This exclude these folder from the linter
# ====================================================================================
# Actions
.PHONY: all
all: update fmt lint coverage
.PHONY: test
test: test.local
.PHONY: test.local
test.local:
export FROM_ROOT=true && $(MAKE) py.test
.PHONY: build
build: py.build
.PHONY: init
init: py.init git.hooks.setup
.PHONY: update
update: git.submodules py.update
.PHONY: update.user.agent
update.user.agent:
curl -s "https://www.useragents.me/#most-common-mobile-useragents-json-csv" | grep -A 20 'id="most-common-mobile-useragents-json-csv"' | grep -A 15 'class="col-lg-6"' | grep -o '<textarea class="form-control" rows="8">.*</textarea>' | sed -E 's/<textarea class="form-control" rows="8">//;s/<\/textarea>//' > $(PROJECT_FOLDER)/$(MODULE_NAME)/agents.json
.PHONY: coverage
coverage:
export FROM_ROOT=true && $(MAKE) py.coverage
.PHONY: docs
docs: py.docs
.PHONY: fmt
fmt: py.fmt
.PHONY: lint
lint: lint.checkmake lint.superlinter
.PHONY: clean
clean: py.clean lint.clean