跳转到主要内容

示例包

项目描述

biocommons.example 测试包

codecov

此仓库提供了一个 biocommons Python 包的模板。以下是使用方法:

  1. 点击使用此模板按钮。将新仓库命名为“biocommons.something”。
  2. 在本地上克隆你的仓库。
  3. 在仓库中,输入make rename。新名称将基于仓库名称选择。
  4. 删除此标题。
  5. 提交并推送。

安装

从 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-py3-none-any.whl (14.6 kB 查看哈希值)

上传时间 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面