Metadata-Version: 2.4
Name: micropos
Version: 0.1.0
Summary: A high-performance asynchronous micro-framework inspired by Spring Boot styling.
Author-email: lhawzed <lhawzed@gmail.com>
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Requires-Dist: aiofiles==25.1.0
Requires-Dist: uvicorn==0.49.0
Description-Content-Type: text/markdown

# MicroPos

一个由 asyncio 驱动、支持热重载、复刻 Spring Boot 启动风格的高性能异步微框架。

## 安装
```bash
pip install micropos
# 或者使用 uv
uv add micropos

```

## 快速开始

```python
import micropos
app = micropos.create_server(port=8000)
app.get("/", lambda: {"hello": "world"})
if __name__ == "__main__":
    micropos.run(app)

```

**2. 创建 `pyproject.toml`（核心配置文件）：**
在根目录下新建该文件，将以下内容粘贴进去。记得根据你的实际情况微调：

```toml
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "micropos"   # 你在 pip install 时用的名字。如果提示重名，你需要改个别的
version = "0.1.0"   # 版本号
description = "A high-performance asynchronous micro-framework inspired by Spring Boot styling."
readme = "README.md"
requires-python = ">=3.8"
license = { text = "MIT" }
authors = [
    { name = "YourName", email = "your_email@example.com" }
]
classifiers = [
    "Programming Language :: Python :: 3",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
]
dependencies = [
    "uvicorn>=0.20.0",
    "aiofiles>=23.0.0"
]

[tool.hatch.build.targets.wheel]
packages = ["micropos"]
```

---

### 第三步：使用 `uv` 极速构建与发布

既然你想对接 **uv 区域**，我们直接用 `uv` 来完成打包和发布（`uv` 内部集成了非常棒的构建引擎）。

1. **安装 uv**（如果你还没装）：
```bash
pip install uv

```

2. **在项目根目录下执行构建**（生成 `.whl` 和 `.tar.gz` 压缩包）：
```bash
uv build

```

*执行成功后，你会发现根目录下多出了一个 `dist/` 文件夹。*
3. **发布到 PyPI**：
使用 `uv` 推荐的发布命令：
```bash
uv publish

```

* 提示输入 **Username** 时，输入：`__token__` （固定就是这个，不要输你的用户名）。
* 提示输入 **Password** 时，粘贴你第一步在 PyPI 复制的那串 `pypi-` 开头的长 Token。

稍等几秒钟，终端就会提示：`Upload successful!` 🎉

---

### 第四步：去 `pip` 和 `uv` 区域检验成果！

发布成功大约 1 分钟后，你就可以在全球任何一台电脑上测试你的框架了！

**1. 传统的 pip 区域安装测试：**

```bash
pip install micropos

```

**2. 现代的 uv 区域安装与运行测试：**
如果你或你的用户使用 `uv`，可以新建一个空文件夹直接秒级下载并运行：

```bash
# 初始化一个 uv 项目
uv init my-web-app
cd my-web-app

# 使用 uv 一键添加你的微框架（uv 会自动解析 pyproject.toml 里的依赖）
uv add micropos

# 编写 main.py 后，直接用 uv 闪电启动
uv run python main.py
```