Cookiecutter template for a Python package.
- Python Packaging User Guide 반영
- MkDocs + mkdocstrings 를 이용한 docstring - html 자동 변환 및 github page 배
- pytest + pytest-cov 적용
- pipenv 적용 - 의존성 관리 및 개발환경 자동 생성
pip install cookiecutter
cookiecutter https://github.com/becky2sawyer/cookiecutter-pypackage-mkdocss.git
github_account [github_account]: ****
github_email [github_email]: ****@gmail.com
github_repo [github_repo]: mars-rover
package_name [mars-rover]: marsrover
short_description [short_description]: go grow potatoes on Mars!
version [0.1.0]:
pip_author : ****
pip_author_email : ****@gmail.com
google_analytics_property []: *****
# marsrover 는 각자 생성한 package-name 으로 바꾸어 수행 및 기타 정보는 사용자 정보로 입력
# pip_author 는 https://pypi.org/account/register/ 에서 등록후 사용
# google_analytics_property 는 https://analytics.google.com 에서 "측정 ID" 를 생성하여 입력(옵션)
$ pip install pipenv
$ cd mars-rover
$ pipenv shell
(mars-rover) $ pipenv install
(mars-rover) $ pipenv install --dev
(mars-rover) $ sh test.sh
============================== test session starts ===============================
platform darwin -- Python 3.6.12, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /Users/diginori/myhub/ppp/tests, configfile: ../pytest.ini
plugins: cov-2.12.1
collected 1 item
tests/ppp/test_ppp.py . [100%]
------ generated xml file: report/test/tests.xml -------
---------- coverage: platform darwin, python 3.6.12-final-0 ----------
Name Stmts Miss Cover
------------------------------------
src/ppp/ppp.py 7 1 86%
------------------------------------
TOTAL 12 1 92%
1 file skipped due to complete coverage.
Coverage XML written to file report/coverage/coverage.xml
=============================== 1 passed in 0.11s ================================
sh build.sh
$ pip install .
$ marsrover-ping
pong
$ marsrover-ping 3
pppong
# marsrover 는 각자 생성한 package-name 으로 바꾸어 수행
sh deploy_pip.sh
sh deploy_gitpage.sh