Metadata-Version: 2.2
Name: almeshopt
Version: 0.1.8
Summary: Meshoptimizer wrapper with cython
Requires-Python: <3.15,>=3.11
Requires-Dist: numpy>=2.0.1
Description-Content-Type: text/markdown

# 构建wheel
## 兼容性更好的分发版
```bash
uv build --wheel --out-dir dist
chcp 65001 && uv build --wheel --out-dir dist  # 修复中文乱码
```

## 性能更好的版本
优化项：
* 启用 AVX2
* 启用 LTO
* 启用 Fast Math
* 启用 march=native

### Linux
```bash
ALMESHOPT_BUILD_MODE=perf uv build --wheel --out-dir dist
```

### Winodws
cmd
```cmd
set ALMESHOPT_BUILD_MODE=perf && uv build --wheel --out-dir dist
```

powershell
```powershell
$env:ALMESHOPT_BUILD_MODE="perf"; uv build --wheel --out-dir dist
```

# 发布到 PyPI（AVX2 版 wheel，一键脚本）
本仓库发布到 PyPI 的项目名是 `almeshopt`，安装与导入都使用：
- `pip install almeshopt`
- `import almeshopt`

发布构建**强制开启 AVX2**（生成包内扩展 `almeshopt_avx2`，由 `almeshopt/__init__.py` 负责优先加载）。

## 前置要求（Windows）
- 已安装 **Python 3.11/3.12/3.13/3.14**
- 已安装 **MSVC Build Tools**（用于编译 C/C++ 扩展）
- 已安装 **CMake 3.15+**
- 已安装 **Docker Desktop（WSL2 backend）**（用于在 Windows 上构建 Linux manylinux wheel）

## 设置 PyPI Token
推荐使用环境变量 `PYPI_API_TOKEN`：

```powershell
$env:PYPI_API_TOKEN="pypi-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

## 一键构建并上传（默认 cp311/cp312/cp313/cp314；Windows+Linux）

```powershell
.\scripts\release.ps1
```

## 只构建 Windows wheel

```powershell
.\scripts\release.ps1 -Platform windows
```

## 只构建 Linux manylinux x86_64 wheel（Docker Desktop）

```powershell
.\scripts\release.ps1 -Platform linux -SkipUpload
```

## 只构建不上传（Windows+Linux）

```powershell
.\scripts\release.ps1 -SkipUpload
```