Metadata-Version: 2.4
Name: top369
Version: 0.0.1
Summary: top369 - a minimal, dependency-free Python package.
Author: top369 maintainers
License-Expression: MIT
Keywords: top369
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# top369

一个最小化、零依赖的 Python 包骨架，可直接发布到 PyPI。

- 版本：0.0.1（Pre-Alpha）
- 依赖：无
- 支持：Python >= 3.9

## 为什么不做纯空包？

PyPI 的官方策略明确把「空包占名」列为无效项目：

> **Invalid projects** … project is name squatting (**package has no functionality or is empty**) …
> 这类项目会被直接从索引中移除。
> —— <https://docs.pypi.org/project-management/name-retention/>

也就是说，一个只含空 `__init__.py` 的包随时可能被管理员删掉，白忙一场。所以这里的做法是：
**保持体积最小的同时让它是一个真实可用的包**——能 import、有公开 API、有命令行入口、有测试。
这样它就不落进 "no functionality or is empty" 的判定里，名字也才真正守得住。

## 发布前先改这几处

1. `pyproject.toml` 里的 `description`、`authors`，以及被注释掉的 `[project.urls]`（填上仓库地址）。
2. `LICENSE` 里的版权主体。
3. `README.md` 改成你项目真正的内容。

## 本地安装与使用

```bash
python -m pip install -e .
python -m top369          # 打印包信息（JSON）
python -m top369 --version
top369                    # console script
```

跑测试：

```bash
python -m pip install pytest
python -m pytest -q
```

## 发布到 PyPI

前置：注册 PyPI 账号并**开启两步验证**（PyPI 强制要求），然后在
<https://pypi.org/manage/account/token/> 创建 API token。

```bash
# 1) 安装构建与上传工具
python -m pip install --upgrade build twine

# 2) 清理旧产物并构建（会在 dist/ 生成 .tar.gz 与 .whl）
rm -rf dist build src/*.egg-info
python -m build

# 3) 先上传到 TestPyPI 试一遍（强烈建议）
python -m twine upload --repository testpypi dist/*

# 4) 确认无误后上传正式 PyPI
python -m twine upload dist/*
```

上传时：
- 用户名填 `__token__`
- 密码填 `pypi-` 开头的 token 原文

也可以写进 `~/.pypirc` 免得每次输入：

```ini
[distutils]
index-servers =
    pypi
    testpypi

[pypi]
username = __token__
password = pypi-xxxxxxxx

[testpypi]
repository = https://test.pypi.org/legacy/
username = __token__
password = pypi-xxxxxxxx
```

> 注意：**PyPI 上的版本号只能前进不能复用**。同一个版本号即使删除后也无法重新上传，
> 所以每次改动记得升 `version`。

## 名字被占了怎么办？

PyPI 不做"占名"服务，但如果原持有者符合"被弃用"条件（联系不上 + 12 个月无发布 + 主页无活动），
可以走 PEP 541 流程申请转移：在 <https://github.com/pypi/support/issues> 用
`Name retention related request (PEP 541)` 模板提交。

## 目录结构

```
top369/
├─ pyproject.toml          # 包元数据 + 构建配置
├─ README.md               # 本文件（即 PyPI 项目页的正文）
├─ LICENSE                 # MIT
├─ .gitignore
├─ src/top369/
│  ├─ __init__.py          # 公开 API：__version__ / info()
│  ├─ __main__.py          # CLI 入口
│  └─ py.typed             # 声明带类型标注
└─ tests/test_smoke.py
```

## License

MIT
