-
Install all the packages listed in requirements.txt file
pip install -r requirements.txt
-
Docstring style checker
# Simple pydocstyle <package_name> # Config pydocstyle --config=config/.pydocstylerc <package_name> # Run pydocstyle for specific folder: # Ex: run pydocstyle for folder 'puneetha_python_template/utils' PYDOCSTYLE_FILES=$(find puneetha_python_template/utils -type f -name "*.py") echo PYDOCSTYLE_FILES pydocstyle --config=config/.pydocstylerc $PYDOCSTYLE_FILES
pydocstyle --config=config/.pydocstylerc puneetha_python_template
Note: When everything in package is adhering to standard, it will return no result. This means 100% success!
-
Codestyle checker
# Simple test without config pylint <package_name> pylint --load-plugins pylint_quotes --rcfile=config/.pylintrc puneetha_python_template # Custom config pylint --load-plugins pylint_quotes --rcfile=config/.pylintrc <package_name> # Add processes pylint --verbose -j 2 --load-plugins pylint_quotes --rcfile=config/.pylintrc <package_name> # Run pylint for specific folder - display errors only: # Ex: run pylint for folder 'puneetha_python_template/utils' PYLINT_FILES=$(find puneetha_python_template/utils -type f -name "*.py") echo $PYLINT_FILES pylint -E --load-plugins pylint_quotes --rcfile=config/.pylintrc $PYLINT_FILES
pylint --load-plugins pylint_quotes --rcfile=config/.pylintrc puneetha_python_template
pylint --load-plugins pylint_quotes --rcfile=config/.pylintrc --output-format=json puneetha_python_template | pylint-json2html -o auto_generated/pylint.html
-
Run tests
pytest -c ./config/tox.ini
pytest -c ./config/tox.ini --cov-report html:auto_generated/coverage --cov=usage
pytest --cache-clear -p no:warnings -rp --html=auto_generated/pytest_report.html --cov-report html:auto_generated/html_cov --ignore=puneetha_python_template/utils/custom_logger.py puneetha_python_template/utils
python -m unittest puneetha_python_template.tests.test_utils.test_general_utils.TestGeneralUtils
(or)
python -m unittest puneetha_python_template/tests/test_utils/test_general_utils.py
-
Generate docstring & publish
pdoc3 puneetha_python_template --http :8099
pdoc3 puneetha_python_template --force --html -o auto_generated/docstrings
-
Generate mkdocs
Configuration: https://www.mkdocs.org/user-guide/configuration/
# Start server: mkdocs serve --config-file ./config/mkdocs.yml # Output: Serving on http://127.0.0.1:8000/
mkdocs gh-deploy --clean --config-file ./config/mkdocs.yml
-
Build egg file
python setup.py bdist_egg # (or) with install python setup.py install bdist_egg
-
Loguru read more here