gmu pypi模板存储库。
thegmu-pypi-template的Python项目详细描述
GMU-PyPi模板
Authors: | Mybrid Wonderful, Gregg Yearwood |
---|---|
Date: | 03/19/2019 |
Support: | mybrid@thegmu.com |
Version: | 1.2.0 |
简介
gmu pypi模板是创建pypi项目的通用python项目布局,用于gregg&mybrid upgrade,inc.(gmu)的所有pypi python项目。提供的makefile可以立即将包文件发布到https://pypi.org,前提是您有一个帐户。
请随意克隆源代码,使其成为您自己的:
git clone https://bitbucket.org/thegmu/thegmu-pypi-template
“乐趣”示例说明
# Create /tmp/fun_stuff sample project # 1. Create a Python3 virtualenv. mkdir -p /tmp/venv python3 -m venv /tmp/venv/py3_fun_stuff # 3. Activate the Python3 virtualenv. . /tmp/venv/py3_fun_stuff/bin/activate # 2. Create an empty Python3 project directory. mkdir -p /tmp/git/fun_stuff # 5. Change directory into the empty Python3 project directory. cd /tmp/git/fun_stuff # 4. Install thegmu-pypi-template. # TEST: pip install --index-url https://test.pypi.org/simple/ thegmu-pypi-template pip install thegmu-pypi-template # 6. Run the install script to install the files into the current directory. thegmu-pypi-template # 7. Activate the PYPI environment from directory /tmp/fun_stuff . bin/activate-fun-stuff # 8. Validate the fun-stuff configuration by running the following make commands. make init make test make dist make test-dist # 9. Repeat the above for your new project configuration your development environment. # Follow the same steps above but: # Replace '/tmp/venv/fun_stuff' with your Python development virtualenv root directory and project name, i.e. "$HOME/venv/py3_my_project". # Replace '/tmp/git/fun_stuff' with your development source code repository root directory, i.e. "$HOME/workspace/git/my_project". # Create a new activation file and update the environment variables. # cp bin/activate-fun-stuff bin/activate-my-projectname # replace '. bin/activate-fun-stuff' with '. bin/activate-my-projectname' # 10. To make Sphinx documentation. make backup-docs # Create backup to compare your files with. make destroy-docs # Delete everything under docs/ make docs # Runs the Sphinx wizard to initialize the conf.py file and then 'make html'. # Open HTML index file in browser: docs/_build/html/index.html
要求
- 鼓励在打包和源代码方面遵循python标准。
- 用于验证PEP8代码标准的Pylint。
- Sphinx文档与readthedocs.org集成
- 专用测试目录中的测试自动化。
- PyPi包部署
- 已阅读DOCS文档部署
工具:
- autopep8:pep8代码美化器
- pylint:编码标准
- pytest:测试源
- readthedocs.org:使用sphinx的公共文档
- sphinx:html文档
- tox:测试源作为已安装包
- tween:将包部署到pypi.org、test.pypi.org
- Makefile:运行工具
配置文件:
- .gitignore:忽略eclipse中的pylint、pytest、tox和build文件以及.settings、.project和.pydevproject目录。
- .pylintrc:GMU特定的PEP8抑制。
生成文件选项
使<;选项>
- 默认值:
- 与帮助相同。
- 备份文档:
- 使用mktemp创建一个临时目录“docs.tmp.xxx”,并将docs目录复制到其中。
- 清洁:
- 删除python编译的文件、pytest文件和tox测试文件。 参见清洁PYC和清洁TOX。
- 清洁距离:
- 删除Python打包文件。
- 清除文档:
- 删除sphinx文档生成文件未删除配置文件。
- 清洁PYC:
- 删除python编译的文件和pytest文件。
- 清洁毒物:
- 删除毒性测试文件。
- 销毁文档
- 删除所有sphinx配置和手动编辑的文档文件以及所有生成的文件。 见清洁文件。 请参阅备份文档。
- 距离:
- 创建适合pypi的源和二进制python包。
- 文档:
- 在docs/u Build中生成HTML文档文件。
- 帮助:
- 显示此文件。 初始值:
- 安装此生成文件使用的python工具。
- 运行project init,请参阅project init
- 第8页:
- 运行autopep8,并用空格更改更新所有项目和测试文件。
- 项目初始:
- setup.py:名称、作者、作者电子邮件、URL、脚本都已更新。
- tests/sample_test.py:项目名称的导入已更新。
- tox.ini:envlist已更新
- 发布:
- 将包发布到产品“pypi.org”
- 给出用户名和密码提示
- 发布测试:
- 发布包以测试“test pypi.org”。 给出用户名和密码提示。
- Pylint:
- 运行pylint并输出结果没有采取其他行动。请参阅pep8选项以解决空白问题。
- 要求:
- 工具的python“pip”包。
- 测试:
- 使用pytest从源代码运行测试。
- 测试距离:
- 从virtual运行测试我希望有人使用毒物。构建包,然后在临时Python virtualenv环境中作为包运行测试。
- 升级:
- 升级工具的Python“pip”包。
The reasonable person adapts themself to the world; the unreasonable one persists in trying to adapt the world to themself. Therefore all progress depends on the unreasonable person. –George Bernard Shaw
结束