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.3 KB

Comment on lines L36

Dean Pleban Outdated

@ShambhaviCodes How does this line work? Can we have an install_precommits that automatically adds all the pre-commit hooks?

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
  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. ## Create virtualenv.
  11. ## Activate with the command:
  12. ## source env/bin/activate
  13. virtualenv:
  14. $(PYTHON_INTERPRETER) -m venv env
  15. $(info "Activate with the command 'source env/bin/activate'")
  16. ## Install Python Dependencies.
  17. ## Make sure you activate the virtualenv first!
  18. requirements:
  19. $(PYTHON_INTERPRETER) -m pip install -U pip setuptools wheel
  20. $(PYTHON_INTERPRETER) -m pip install -r requirements.txt
  21. ## Create directories that are ignored by git but required for the project
  22. dirs:
  23. mkdir -p data/raw data/processed models
  24. ## Delete all compiled Python files
  25. clean:
  26. find . -type f -name "*.py[co]" -delete
  27. find . -type d -name "__pycache__" -delete
  28. ## To use the pre-commit hooks
  29. pre-commit-install:
  30. pre-commit install
  31. setup-data-validation:
  32. cd src/data; great_expectations -y init; great_expectations datasource new
  33. run-data-validation:
  34. cd src/data; python data_validation.py
  35. ## Lint using flake8
  36. lint:
  37. flake8 src
  38. ## Upload Data to default DVC remote
  39. push:
  40. dvc push -r origin
  41. ## Download Data from default DVC remote
  42. pull:
  43. dvc pull -r origin
  44. ## Reproduce the DVC pipeline - recompute any modified outputs such as processed data or trained models
  45. reproduce:
  46. dvc repro
  47. #################################################################################
  48. # PROJECT RULES #
  49. #################################################################################
  50. #################################################################################
  51. # Self Documenting Commands #
  52. #################################################################################
  53. .DEFAULT_GOAL := reproduce
  54. # Inspired by <http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html>
  55. # sed script explained:
  56. # /^##/:
  57. # * save line in hold space
  58. # * purge line
  59. # * Loop:
  60. # * append newline + line to hold space
  61. # * go to next line
  62. # * if line starts with doc comment, strip comment character off and loop
  63. # * remove target prerequisites
  64. # * append hold space (+ newline) to line
  65. # * replace newline plus comments by `---`
  66. # * print line
  67. # Separate expressions are necessary because labels cannot be delimited by
  68. # semicolon; see <http://stackoverflow.com/a/11799865/1968>
  69. .PHONY: help
  70. help:
  71. @echo "$$(tput bold)Available rules:$$(tput sgr0)"
  72. @echo
  73. @sed -n -e "/^## / Missing" $Missing \
  74. | LC_ALL='C' sort --ignore-case \
  75. | awk -F '---' \
  76. -v ncol=$$(tput cols) \
  77. -v indent=19 \
  78. -v col_on="$$(tput setaf 6)" \
  79. -v col_off="$$(tput sgr0)" \
  80. 'Missing \
  81. printf "%s ", words[i]; \
  82. } \
  83. printf "\n"; \
  84. }' \
  85. | 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

Dean Pleban

commented in commit2dcd1f3e96on branch master

1 year ago Outdated

@ShambhaviCodes How does this line work? Can we have an install_precommits that automatically adds all the pre-commit hooks?

Updated, now 'make precommit' should add all the pre-commit hooks!

Loading...