示例包
项目描述
biocommons.example 测试包
此仓库提供了一个 biocommons Python 包的模板。以下是使用方法:
- 点击使用此模板按钮。将新仓库命名为“biocommons.something”。
- 在本地上克隆你的仓库。
- 在仓库中,输入
make rename
。新名称将基于仓库名称选择。 - 删除此标题。
- 提交并推送。
安装
从 PyPI 安装:pip install biocommons.example
开发者设置
开发者必须安装 zsh,这是 Makefile 所需的。zsh 默认包含在 MacOS 中,并且在所有现代 Linux 发行版中均可轻松获得。
设置如下
make devready
source venv/bin/activate
代码格式化
make reformat
安装 pre-commit 钩子
# included in `make devready`, not necessary for new installations
pre-commit install
测试
make test # for current environment
make tox # for all supported versions
构建
git tag 0.0.0
make build
试试看
$ python3 -m biocommons.example
Marvin says:
There's only one life-form as intelligent as me within thirty parsecs...
$ marvin-quote
Marvin says:
You think you've got problems? What are you supposed to do if you...
$ ipython
>>> from biocommons.example import __version__, get_quote_from_marvin
>>> __version__
'0.1.dev8+gd5519a8.d20211123'
>>> get_quote()
"The first ten million years were the worst, ...
功能
代码结构和功能
- 基于 setuptools 的现代 pyproject.toml
- 基于 git 标签的版本控制(仅限)
- 易于设置的开发环境
- 支持命名空间
- 使用 pytest 进行覆盖率测试;测试可能位于
tests/
目录中,嵌入在包中,以及文档字符串中 - 日志记录和包数据的示例
- 使用 argparse 进行参数解析的命令行
DevOps
- 质量工具:使用 Ruff 进行代码检查和格式化
- GitHub Actions 进行测试和打包
待办事项
- 添加 devcontainer 支持
项目详情
下载文件
下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源分发
biocommons_example-0.0.5.tar.gz (21.7 kB 查看哈希值)
构建分发
关闭
biocommons_example-0.0.5.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 1b98e8c78426174032afe1f51196d39a3bf9cac8cf1cc51c96d9d1c1697961b7 |
|
MD5 | 197ee45461408bd29635e23b760a6532 |
|
BLAKE2b-256 | 30f60f4fd2d653253437bcef711a5a85eef51676254fc04f91b302eee0478f9c |
关闭
biocommons.example-0.0.5-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 95fdee77b3775e241d1a1a2d2e9ea60f9f23f397fc53c0e7dba685805532fe87 |
|
MD5 | fe3ee78bebc3c241c1c49ca0df405e95 |
|
BLAKE2b-256 | 9fcfb921abbc5b3ecb190dfce76d3d068d75d902fc8af2ab040245dcc075ee69 |