ChatPyPI: ChatArch Python package lifecycle helper extracted from ChatTool.
Project description
ChatPyPI
ChatPyPI: ChatArch Python package lifecycle helper extracted from ChatTool.
快速开始
pip install -e ".[dev]"
chatpypi --help
chatpypi --version
chatpypi pkg init demo-pkg
python -m pytest -q
python -m build
当前 CLI 树
ChatPyPI 正在从单纯的包生命周期工具,扩展为“包 + 登录后 PyPI 操作”工具。当前公共树结构已经预留:
chatpypi
├── auth
│ ├── login
│ ├── logout
│ ├── whoami
│ ├── register
│ ├── verify-email
│ ├── setup-2fa
│ ├── recovery-codes
│ └── session
│ ├── show
│ ├── export
│ ├── import
│ └── clear
├── profile
│ ├── list
│ ├── show
│ ├── use
│ ├── create
│ └── delete
├── config
│ ├── list
│ ├── get
│ ├── set
│ └── unset
├── pkg
│ ├── init
│ ├── build
│ ├── check
│ ├── upload
│ └── probe
├── project
│ ├── list
│ └── show
├── publisher
│ ├── list
│ ├── pending-list
│ ├── pending-add
│ └── pending-remove
├── token
│ ├── list
│ ├── create
│ └── revoke
├── doctor
│ └── check
└── docs
├── links
├── examples
└── open
当前实现重点:
pkg:包初始化、构建、检查、上传、探测auth whoami/auth session show|clear:本地 session 摘要读取docs:输出文档链接与示例命令
其余子命令目前作为保留入口,先把稳定 CLI 树固定下来。
旧命令仍兼容:
chatpypi initchatpypi buildchatpypi checkchatpypi uploadchatpypi probe
手动 token 发布当前可直接走:
export PYPI_API_TOKEN=...
chatpypi pkg upload --project-dir ./demo-pkg --token-env PYPI_API_TOKEN
Env 配置
ChatPyPI 会通过 chatenv.configs 注册 pypi / chatpypi 配置类型,因此安装后可被 ChatEnv 发现和管理:
chatenv list
chatenv test -t pypi
chatenv new -t pypi default
当前建议把 PyPI 相关变量显式放到 ChatEnv profile、shell env、.env 或 profile 配置里。最小集合分两类:
- 登录后读取 / session 复用:
PYPI_SESSION_FILE:本地 session JSON 文件路径
- 手动发布:
PYPI_API_TOKEN:PyPI API token,配合chatpypi pkg upload --token-env PYPI_API_TOKEN
如果后续接入浏览器协作登录 / 2FA,常见可选变量包括:
PYPI_USERNAMEPYPI_PASSWORDPYPI_TOTP_SECRET
推荐约定:
- 不要把 token、密码直接写进命令行参数;
--token-env/--password-env只接收“环境变量名”,CLI 会在运行时读取其值;PYPI_SESSION_FILE指向单个 profile 的单个 session 文件,CLI 只输出非敏感摘要,不直接回显 cookie;.env中若有包含空格的值,不要直接source .env,应使用更安全的解析方式。
示例:
export PYPI_SESSION_FILE="$HOME/.config/chatpypi/default/session.json"
export PYPI_API_TOKEN="pypi-***"
chatpypi auth session show --format json
chatpypi pkg upload --project-dir ./demo-pkg --token-env PYPI_API_TOKEN
CLI 规范
这个模板默认依赖 chatstyle>=0.1.0,<0.2.0 和 chatenv>=0.2.0,<0.3.0,新的命令应优先使用:
CommandSchema/CommandField描述输入。add_interactive_option()提供统一-i/-I。resolve_command_inputs()统一缺参补问、默认值、TTY 与校验。chatpypi init -t chatarch默认生成config.py和chatenv.configsentry point;只有明确传--without-chatenv-provider时才跳过。
目录结构
src/:包源码tests/code-tests/:代码测试和历史测试迁移tests/cli-tests/:真实 CLI 测试,doc-firsttests/mock-cli-tests/:mock/fake CLI 测试,doc-firstdocs/:长期维护文档,由 mkdocs 构建
开发说明
扩展脚手架前,先阅读 DEVELOP.md 和 AGENTS.md。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chatpypi-0.2.1.tar.gz.
File metadata
- Download URL: chatpypi-0.2.1.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05437731458ddc1d6e99e91a4949d29a188a9088e0f0926a49a3fdfec9e9b794
|
|
| MD5 |
3d52a96ec844200f90b74eb9f11ac05e
|
|
| BLAKE2b-256 |
81b766377ecda830a8ba6c4d2b45b90017877569dce73df43f8a489030058bdc
|
Provenance
The following attestation bundles were made for chatpypi-0.2.1.tar.gz:
Publisher:
publish.yml on ChatArch/ChatPyPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chatpypi-0.2.1.tar.gz -
Subject digest:
05437731458ddc1d6e99e91a4949d29a188a9088e0f0926a49a3fdfec9e9b794 - Sigstore transparency entry: 1965432491
- Sigstore integration time:
-
Permalink:
ChatArch/ChatPyPI@eda52c86b6e62397eb302927c861780ae35a314f -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/ChatArch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eda52c86b6e62397eb302927c861780ae35a314f -
Trigger Event:
push
-
Statement type:
File details
Details for the file chatpypi-0.2.1-py3-none-any.whl.
File metadata
- Download URL: chatpypi-0.2.1-py3-none-any.whl
- Upload date:
- Size: 28.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
548670f9a30c9523a7dc238eabe4f23cf7299cfe47f3aab2879bfdb954146cb2
|
|
| MD5 |
e8c51948d1716e9c4d6d74436994f424
|
|
| BLAKE2b-256 |
b61efa2158e184c521226e6cacdf39d44eab6543216f9dffd9073f34ec0cc9db
|
Provenance
The following attestation bundles were made for chatpypi-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on ChatArch/ChatPyPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chatpypi-0.2.1-py3-none-any.whl -
Subject digest:
548670f9a30c9523a7dc238eabe4f23cf7299cfe47f3aab2879bfdb954146cb2 - Sigstore transparency entry: 1965432619
- Sigstore integration time:
-
Permalink:
ChatArch/ChatPyPI@eda52c86b6e62397eb302927c861780ae35a314f -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/ChatArch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eda52c86b6e62397eb302927c861780ae35a314f -
Trigger Event:
push
-
Statement type: