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.2 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
  1. .PHONY: clean clean-test clean-pyc clean-build docs help
  2. .DEFAULT_GOAL := help
  3. define BROWSER_PYSCRIPT
  4. import os, webbrowser, sys
  5. from urllib.request import pathname2url
  6. webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
  7. endef
  8. export BROWSER_PYSCRIPT
  9. define PRINT_HELP_PYSCRIPT
  10. import re, sys
  11. for line in sys.stdin:
  12. match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
  13. if match:
  14. target, help = match.groups()
  15. print("%-20s %s" % (target, help))
  16. endef
  17. export PRINT_HELP_PYSCRIPT
  18. BROWSER := python -c "$$BROWSER_PYSCRIPT"
  19. help:
  20. @poetry run python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
  21. clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
  22. clean-build: ## remove build artifacts
  23. rm -fr build/
  24. rm -fr dist/
  25. rm -fr .eggs/
  26. find . -name '*.egg-info' -exec rm -fr {} +
  27. find . -name '*.egg' -exec rm -f {} +
  28. clean-pyc: ## remove Python file artifacts
  29. find . -name '*.pyc' -exec rm -f {} +
  30. find . -name '*.pyo' -exec rm -f {} +
  31. find . -name '*~' -exec rm -f {} +
  32. find . -name '__pycache__' -exec rm -fr {} +
  33. clean-test: ## remove test and coverage artifacts
  34. rm -fr .tox/
  35. rm -f .coverage
  36. rm -fr htmlcov/
  37. rm -fr .pytest_cache
  38. lint: checktypes checkstyle sast checklicenses ## run all checks
  39. checktypes: .venv ## check types with mypy
  40. poetry run mypy --ignore-missing-imports poi_analysis tests
  41. checkstyle: .venv ## check style with flake8, isort and black
  42. poetry run flake8 poi_analysis tests
  43. poetry run isort --check-only --profile black poi_analysis tests
  44. poetry run black --check --diff poi_analysis tests
  45. fixstyle: .venv ## fix black and isort style violations
  46. poetry run isort --profile black poi_analysis tests
  47. poetry run black poi_analysis tests
  48. sast: .venv ## run static application security testing
  49. poetry run bandit -r poi_analysis
  50. checklicenses: .venv requirements.txt ## check dependencies meet license rules
  51. poetry run liccheck -s liccheck.ini
  52. test: .venv ## run tests quickly with the default Python
  53. poetry run pytest --verbose --capture=no
  54. test-all: .venv ## run tests on every Python version with tox
  55. poetry run tox
  56. coverage: ## check code coverage quickly with the default Python
  57. poetry run coverage run --source poi_analysis -m pytest
  58. poetry run coverage report -m
  59. poetry run coverage html
  60. poetry run $(BROWSER) htmlcov/index.html
  61. release: dist ## package and upload a release, manage version yourself
  62. # poetry version prerelease/patch/minor/major
  63. # https://python-poetry.org/docs/cli/#version
  64. sed -i 's/simple/upload/g' pyproject.toml
  65. poetry publish -r ukhoget
  66. sed -i 's/upload/simple/g' pyproject.toml
  67. prerelease: dist ## package and upload a release, bump minor version
  68. poetry version prerelease
  69. sed -i 's/simple/upload/g' pyproject.toml
  70. poetry publish -r ukhoget
  71. sed -i 's/upload/simple/g' pyproject.toml
  72. dist: clean ## builds source and wheel package
  73. poetry build
  74. requirements.txt: poetry.lock ## create/update the requirements.txt file using poetry
  75. poetry export --format requirements.txt
  76. @touch requirements.txt # when there are no dependencies
  77. .venv: poetry.lock
  78. poetry config virtualenvs.in-project true
  79. poetry install
  80. @touch -c .venv
  81. poetry.lock:
  82. poetry update -vvv
  83. @touch -c poetry.lock
Tip!

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

Comments

Loading...