Metadata-Version: 2.1
Name: qpip
Version: 0.1.2
Summary: A fast pip tool with domestic mirror sources
Author-email: jvy <jvy@qq.com>
License: MIT License
        
        Copyright (c) 2026 jvy
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/jvy/qpip
Project-URL: Repository, https://github.com/jvy/qpip
Project-URL: Issues, https://github.com/jvy/qpip/issues
Keywords: pip,mirror,cli,python-package
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

## qpip

`qpip` 是一个对 `python -m pip` 的轻量封装，可以在安装 Python 包时自动使用更快的镜像源。

### 功能特性

- 始终使用当前 Python 解释器调用 `pip`，避免直接依赖独立的 `pip` 可执行文件。
- 仅在 `install`、`download`、`wheel` 这类需要联网的子命令上自动注入镜像源。
- 如果用户已经显式传入 `--index-url`、`--extra-index-url`、`--find-links` 或 `--no-index`，不会强行覆盖。
- 同时支持 `qpip tsinghua install numpy` 和 `qpip --mirror douban install pandas` 两种写法。
- 支持 `python -m qpip` 运行方式，并提供 `--dry-run` 用于预览最终命令。

### 安装

```bash
pip install qpip
```

本地开发安装示例：

```bash
python -m build
pip install dist/qpip-0.1.0-py3-none-any.whl
```

### 使用方法

```bash
qpip install requests
qpip tsinghua install numpy
qpip --mirror douban install pandas
qpip --dry-run install fastapi
qpip --list-mirrors
python -m qpip install rich
```

如果你要把以 `-` 开头的参数直接传给 `pip`，请在前面加上 `--`：

```bash
qpip -- --version
```

### 默认镜像

`qpip` 默认使用 `ali`。如果你想修改默认镜像，可以设置环境变量 `QPIP_DEFAULT_MIRROR`：

```bash
set QPIP_DEFAULT_MIRROR=tsinghua
qpip install httpx
```

### 支持的镜像源

- `ali`: `https://mirrors.aliyun.com/pypi/simple/`
- `tsinghua`: `https://pypi.tuna.tsinghua.edu.cn/simple/`
- `douban`: `https://pypi.doubanio.com/simple/`

### 开发

```bash
python -m unittest discover -s tests -v
python -m build
```
