## qpip

`qpip` is a thin wrapper around `python -m pip` that can automatically use a faster mirror for package downloads.

### Features

- Keeps using the current Python interpreter instead of relying on a separate `pip` binary.
- Injects a mirror only for network-facing subcommands like `install`, `download`, and `wheel`.
- Preserves user intent when `--index-url`, `--extra-index-url`, `--find-links`, or `--no-index` is already provided.
- Supports both `qpip tsinghua install numpy` and `qpip --mirror douban install pandas`.
- Works with `python -m qpip` and provides a `--dry-run` mode for inspection.

### Installation

```bash
pip install qpip
```

For local development:

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

### Usage

```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
```

If you need to pass an option that starts with `-` directly to `pip`, place `--` before the pip arguments:

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

### Default mirror

`qpip` uses `ali` by default. You can override it with the `QPIP_DEFAULT_MIRROR` environment variable:

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

### Supported mirrors

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

### Development

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