Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Makefile 3.6 KB

You have to be logged in to leave a comment. Sign In
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
  1. .PHONY: clean dirs virtualenv lint requirements push pull reproduce
  2. #################################################################################
  3. # GLOBALS #
  4. #################################################################################
  5. PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
  6. PYTHON_INTERPRETER = python3
  7. #################################################################################
  8. # COMMANDS #
  9. #################################################################################
  10. ## Activate virtualenv.
  11. activate:
  12. $(PYTHON_INTERPRETER) -m pipenv shell
  13. ## Install Python Dependencies.
  14. dependencies:
  15. $(PYTHON_INTERPRETER) -m pip install -U pipenv setuptools wheel
  16. $(PYTHON_INTERPRETER) -m pipenv shell
  17. $(PYTHON_INTERPRETER) -m pipenv install
  18. ## Import Python Dependencies from requirements.txt.
  19. import:
  20. $(PYTHON_INTERPRETER) -m pip install -U pipenv setuptools wheel
  21. $(PYTHON_INTERPRETER) -m pipenv shell
  22. $(PYTHON_INTERPRETER) -m pipenv import -r requirements.txt
  23. $(PYTHON_INTERPRETER) -m pipenv install
  24. ## Install dependencies defined on Pipenv.lock
  25. install:
  26. $(PYTHON_INTERPRETER) -m pipenv install --ignore-pipfile
  27. ## Check if all the dependencies are installed correctly
  28. check:
  29. $(PYTHON_INTERPRETER) -m pipenv check
  30. ## Dependencies graph
  31. graph:
  32. $(PYTHON_INTERPRETER) -m pipenv graph
  33. ## Update Pipfile.lock dependencies
  34. lock:
  35. $(PYTHON_INTERPRETER) -m pipenv lock
  36. ## Create directories that are ignored by git but required for the project
  37. dirs:
  38. mkdir -p data/raw data/processed models
  39. ## Delete all compiled Python files
  40. clean:
  41. find . -type f -name "*.py[co]" -delete
  42. find . -type d -name "__pycache__" -delete
  43. ## Lint using flake8
  44. lint:
  45. flake8 src
  46. ## Upload Data to default DVC remote
  47. push:
  48. dvc push
  49. ## Download Data from default DVC remote
  50. pull:
  51. dvc pull
  52. ## Reproduce the DVC pipeline - recompute any modified outputs such as processed data or trained models
  53. reproduce:
  54. dvc repro eval.dvc
  55. #################################################################################
  56. # PROJECT RULES #
  57. #################################################################################
  58. #################################################################################
  59. # Self Documenting Commands #
  60. #################################################################################
  61. .DEFAULT_GOAL := help
  62. # Inspired by <http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html>
  63. # sed script explained:
  64. # /^##/:
  65. # * save line in hold space
  66. # * purge line
  67. # * Loop:
  68. # * append newline + line to hold space
  69. # * go to next line
  70. # * if line starts with doc comment, strip comment character off and loop
  71. # * remove target prerequisites
  72. # * append hold space (+ newline) to line
  73. # * replace newline plus comments by `---`
  74. # * print line
  75. # Separate expressions are necessary because labels cannot be delimited by
  76. # semicolon; see <http://stackoverflow.com/a/11799865/1968>
  77. .PHONY: help
  78. help:
  79. @echo "$$(tput bold)Available rules:$$(tput sgr0)"
  80. @echo
  81. @sed -n -e "/^## / Missing" $Missing \
  82. | LC_ALL='C' sort --ignore-case \
  83. | awk -F '---' \
  84. -v ncol=$$(tput cols) \
  85. -v indent=19 \
  86. -v col_on="$$(tput setaf 6)" \
  87. -v col_off="$$(tput sgr0)" \
  88. 'Missing \
  89. printf "%s ", words[i]; \
  90. } \
  91. printf "\n"; \
  92. }' \
  93. | more $(shell test $(shell uname) = Darwin && echo '--no-init --raw-control-chars')
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...