@@ -2,50 +2,59 @@ TEST_PATH=./tests
22
33.DEFAULT_GOAL := help
44
5- .PHONY : help clean-pyc build clean-build venv dependencies test-dependencies clean-venv test test-reports clean-test check-codestyle check-docstyle
6-
75help :
8- @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
6+ @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
7+ .PHONY : help
98
109clean-pyc : # # Remove python artifacts.
1110 find . -name ' *.pyc' -exec rm -f {} +
1211 find . -name ' *.pyo' -exec rm -f {} +
1312 find . -name ' *~' -exec rm -f {} +
13+ .PHONY : clean-pyc
1414
15- build : # # build a package
15+ build : # # Build the package
1616 python setup.py sdist bdist_wheel
17+ .PHONY : build
1718
18- clean-build : # # clean build artifacts
19+ clean-build : # # Clean build artifacts
1920 rm -rf build
2021 rm -rf dist
2122 rm -rf vendors
2223 rm -rf ml_base.egg-info
24+ .PHONY : clean-build
2325
24- venv : # # create virtual environment
26+ venv : # # Create virtual environment
2527 python3 -m venv venv
28+ .PHONY : venv
2629
27- dependencies : # # install dependencies from requirements.txt
30+ dependencies : # # Install dependencies from requirements.txt
2831 python -m pip install --upgrade pip
2932 python -m pip install --upgrade setuptools
3033 python -m pip install --upgrade wheel
3134 pip install -r requirements.txt
35+ .PHONY : dependencies
3236
33- test-dependencies : # # install dependencies from test_requirements.txt
37+ test-dependencies : # # Install dependencies from test_requirements.txt
3438 pip install -r test_requirements.txt
39+ .PHONY : test-dependencies
3540
36- doc-dependencies : # # install dependencies from doc_requirements.txt
41+ doc-dependencies : # # Install dependencies from doc_requirements.txt
3742 pip install -r doc_requirements.txt
43+ .PHONY : doc-dependencies
3844
3945update-dependencies : # # Update dependency versions
4046 pip-compile requirements.in > requirements.txt
4147 pip-compile test_requirements.in > test_requirements.txt
4248 pip-compile doc_requirements.in > doc_requirements.txt
49+ .PHONY : update-dependencies
4350
44- clean-venv : # # remove all packages from virtual environment
51+ clean-venv : # # Remove all packages from virtual environment
4552 pip freeze | grep -v " ^-e" | xargs pip uninstall -y
53+ .PHONY : clean-venv
4654
4755test : clean-pyc # # Run unit test suite.
4856 pytest --verbose --color=yes $(TEST_PATH )
57+ .PHONY : test
4958
5059test-reports : clean-pyc clean-test # # Run unit test suite with reporting
5160 mkdir -p reports
@@ -55,42 +64,55 @@ test-reports: clean-pyc clean-test ## Run unit test suite with reporting
5564 python -m coverage run --source ml_base -m pytest --verbose --color=yes --html=./reports/unit_tests/report.html --junitxml=./reports/unit_tests/report.xml $(TEST_PATH )
5665 coverage html -d ./reports/coverage
5766 coverage-badge -o ./reports/badge/coverage.svg
67+ .PHONY : test-reports
5868
5969clean-test : # # Remove test artifacts
6070 rm -rf .pytest_cache
6171 rm -rf .coverage
6272 rm -rf reports
6373 rm -rf .pytype
74+ .PHONY : clean-test
6475
65- check-codestyle : # # checks the style of the code against PEP8
76+ check-codestyle : # # Check the style of the code against PEP8
6677 pycodestyle ml_base --max-line-length=120
78+ .PHONY : check-codestyle
6779
68- check-docstyle : # # checks the style of the docstrings against PEP257
80+ check-docstyle : # # Check the style of the docstrings against PEP257
6981 pydocstyle ml_base
82+ .PHONY : check-docstyle
7083
71- check-security : # # checks for common security vulnerabilities
84+ check-security : # # Checks for common security vulnerabilities
7285 bandit -r ml_base
86+ .PHONY : check-security
7387
74- check-dependencies : # # checks for security vulnerabilities in dependencies
88+ check-dependencies : # # Check for security vulnerabilities in dependencies
7589 safety check -r requirements.txt
90+ .PHONY : check-dependencies
7691
77- check-codemetrics : # # calculate code metrics of the package
92+ check-codemetrics : # # Calculate code metrics of the package
7893 radon cc ml_base
94+ .PHONY : check-codemetrics
7995
80- check-pytype : # # perform static code analysis
81- pytype ml_base
96+ check-annotations : # # Check for type annotations coverage
97+ flake8 ml_base --max-line-length=120 --ignore=ANN101,ANN102,ANN401
98+ .PHONY : check-annotations
8299
83- build-docs : # # build the documentation
100+ build-docs : # # Build the documentation
84101 mkdocs build
102+ .PHONY :build-docs
85103
86- view-docs : # # open a web browser to view the documentation
104+ view-docs : # # Open a web browser to view the documentation
87105 open site/index.html
106+ .PHONY : view-docs
88107
89- clean-docs : # # clean up the files in the docs build folder
108+ clean-docs : # # Clean up the files in the docs build folder
90109 rm -rf site
110+ .PHONY : clean-docs
91111
92- run-examples : # # run all example notebooks in examples directory
112+ run-examples : # # Run all example notebooks in examples directory
93113 jupyter nbconvert --to notebook --execute examples/basic.ipynb
114+ .PHONY : run-examples
94115
95- convert-examples : # # convert the example notebooks into Markdown files in docs folder
96- jupyter nbconvert --to markdown examples/* .ipynb --output-dir=' ./docs'
116+ convert-examples : # # Convert the example notebooks into Markdown files in docs folder
117+ jupyter nbconvert --to markdown examples/* .ipynb --output-dir=' ./docs'
118+ .PHONY :convert-examples
0 commit comments