Skip to main content

基于 [copier](https://copier.readthedocs.io/) 的通用 Python 项目模板。

Project description

coopie

基于 copier 的通用 Python 项目模板。

PyPI CI Python License Coverage

特性

  • 构建工具链:hatchling + uv + ruff + pyrefly + pytest + coverage
  • Python 版本:3.8 ~ 3.14
  • 代码质量:pre-commit 钩子 + ruff lint/format,覆盖率阈值 95%
  • CI/CD:GitHub Actions(lint + typecheck + 多版本测试 + 自动发布到 PyPI)
  • 文档:Sphinx + ReadTheDocs(中文 zh_CN)
  • 多版本测试:tox + tox-uv(py38, py39, py310, py311, py312, py313, py314)
  • 项目结构:src layout + py.typed 类型标记

安装

pip install coopie

或使用 uv

uv add coopie

快速上手

import coopie

print(coopie.__version__)

开发

# 安装开发依赖
uv sync --extra dev

# 运行测试(含覆盖率,阈值 95%)
uv run pytest -m "not slow" --cov=coopie --cov-fail-under=95

# 类型检查
uv run pyrefly check .

# 代码风格
uv run ruff check src tests
uv run ruff format --check src tests

Make 快捷命令

项目提供 Makefile 封装常用操作,运行 make help 查看全部命令:

make sync     # 安装开发依赖
make check    # 全套门禁 (lint + typecheck + cov)
make build    # 构建分发包
make clean    # 清理构建产物
make bump PART=patch  # 版本号 bump

文档

文档由 Sphinx 构建,托管在 ReadTheDocs:

# 本地构建文档
make doc

多版本测试

使用 tox 在多个 Python 版本(py38, py39, py310, py311, py312, py313, py314)下运行测试:

make tox

许可证

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coopie-0.7.6.tar.gz (275.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coopie-0.7.6-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file coopie-0.7.6.tar.gz.

File metadata

  • Download URL: coopie-0.7.6.tar.gz
  • Upload date:
  • Size: 275.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for coopie-0.7.6.tar.gz
Algorithm Hash digest
SHA256 6f82f5887db89dc55bc3eb9103f2bf38ff2aedc8acd6425b738bd7bd5b43c0d0
MD5 4f2e49df495a22ef48b1aa4dcdd66423
BLAKE2b-256 f3b264067c77266a13cc9f9b0b00ccad947bb5549d45b39a48604e1d00747b5f

See more details on using hashes here.

File details

Details for the file coopie-0.7.6-py3-none-any.whl.

File metadata

  • Download URL: coopie-0.7.6-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for coopie-0.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a25871262d2936f2eecb56089ecbb4ee8de0108334f1792d24928522f7d5568e
MD5 8aaad24459b6e7267f2e7bfc6ef758d8
BLAKE2b-256 9c3fec586e4101787c4433e59b36e7a19709805408bf7aef3ffffe3c64a99e8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page