Skip to main content

pyweb_template

Template for python web apps.

PyPI CI Python License Coverage

特性

  • 构建工具链:hatchling + uv + ruff + pyrefly + pytest + coverage
  • Python 版本:3.13 ~ 3.14
  • 代码质量:pre-commit 钩子 + ruff lint/format,覆盖率阈值 95%
  • CI/CD:GitHub Actions(lint + typecheck + 多版本测试 + 自动发布到 PyPI)
  • 文档:Sphinx + ReadTheDocs(中文 zh_CN)
  • 多版本测试:tox + tox-uv(py313, py314)
  • 容器化:Dockerfile(含国内镜像源配置)
  • Web 框架:FastAPI + uvicorn
  • 项目结构:src layout + py.typed 类型标记

安装

pip install pyweb_template

或使用 uv:

uv add pyweb_template

快速上手

import pyweb_template

print(pyweb_template.__version__)

开发

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

# 运行测试(含覆盖率,阈值 95%)
uv run pytest -m "not slow" --cov=pyweb_template --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 版本(py313, py314)下运行测试:

make tox

许可证

MIT

Metadata

Release files for pyweb-template 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyweb-template 0.1.2
File Size Uploaded
pyweb_template-0.1.2.tar.gz 150.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyweb-template 0.1.2
File Interpreter ABI Platform
pyweb_template-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 172.0 kB

Release files / pyweb_template-0.1.2.tar.gz

Download URL pyweb_template-0.1.2.tar.gz
Size 150.0 kB
Tags Source
SHA-256 checksum
How to use checksums
17b9cdb5b0505b863e622095bd41c83c9d60df7a912cea5e6d077288bafa81f9
BLAKE2b-256 checksum
How to use checksums
9ad1300c99369648357d0bd17c68caad65103cf99a19a2c5be24d33be506946f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / pyweb_template-0.1.2-py3-none-any.whl

Download URL pyweb_template-0.1.2-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4f3afd26ce36ffdf6a613717ba85c02e00496c49da4542076a8ea57e0084af2
BLAKE2b-256 checksum
How to use checksums
89bffb30ecb5dd7cf9cbc707f6d761790c08be6a93e035b1eca468d2ce1beb8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page