Metadata-Version: 2.1
Name: bin-package-manager
Version: 2.0.2
Summary: Bin package manager, a package manager based on Github release
Home-page: https://github.com/lxl66566/bpm
License: MIT
Keywords: binary,packaging,release
Author: lxl66566
Author-email: lxl66566@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: py7zr (>=0.20.8,<0.21.0) ; sys_platform == "win32"
Requires-Dist: pylnk3 (>=0.4.2,<0.5.0) ; sys_platform == "win32"
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: simpleufcs (>=1.0.0,<2.0.0)
Requires-Dist: tqdm (>=4.66.2,<5.0.0)
Project-URL: Repository, https://github.com/lxl66566/bpm
Description-Content-Type: text/markdown

# bin package manager

English | [简体中文](./docs/README.zh-CN.md)

Bin package manager (BPM) is a Github release-based package manager that allows users to install and manage binaries from any Github release.

BPM is currently supported on Linux and Windows, python >= 3.10.

> [!CAUTION]
> Risk Warning: BPM on Linux may damage your computer. By using BPM to install software, you accept this risk and trust third-party Github release packagers.

## Why use it?

In non-rolling release Linux distributions, the version of softwares in official source are often too low to use some new features.

Rolling distributions, such as Archlinux, are also unable to install software from the AUR as root.

A common way to manage packages on Windows is scoop, but it requires the packager to maintain a "manifest" list.

## Installation

BPM needs to be installed to root user.

### pip

#### Linux

```sh
sudo pip install bin-package-manager --break-system-packages
sudo bpm
```

Note the risk of potentially breaking system packages.

#### Windows

```sh
pip install bin-package-manager
bpm
```

### pipx

You can use pipx to install BPM.

```sh
sudo pipx install bin-package-manager
```

pipx will only install for the current user, so `sudo` is required. Alternatively, you can track on [this issue](https://github.com/pypa/pipx/issues/754) and use other methods mentioned there.

### Source code

If you don't want to use pipx, you can also download and use the source code.

BPM depends on Python modules: `requests`, `tqdm`, `py7zr` (optional), please install them manually.

```sh
git clone https://github.com/lxl66566/bpm.git
cd bpm
python3 -m bpm
# or use poetry to install dependencies and run: `poetry install && poetry run python -m bpm`
```

## Usage

- Install: `bpm i <package>`
- Run `bpm -h` for more help.

## How it works

### Linux

BPM automatically determines the file structure in the asset and installs it to the appropriate location on the system. The current installation is like:

1. install binary
2. merge the `lib`, `include`, `share`, `man`, `bin` directories into the system
3. install completions

BPM automatically adds the `.old` suffix to existing files to avoid overwrite. The `.old` files will be restored in uninstalling.

### Windows

BPM downloads asset into `%userprofile%/bpm/app/<name>` and creates shortcuts for the executables to `%userprofile%/bpm/bin`, which is added to `%path%`.

## Develop

```sh
git clone https://github.com/lxl66566/bpm.git
cd bpm
poetry install
poetry run python -m unittest bpm/**/*.py  # run tests
```

## TODO

- [ ] no pre release
- [x] try install
- [x] windows support

