From d42162d21d5fe0408d02966c9180817d54bcb66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81rni=20Dagur?= Date: Sat, 26 Jun 2021 19:27:41 +0000 Subject: Improve build instructions in README --- README.md | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 5889e57..2a3799b 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,48 @@ -python-adblock -========== +# python-adblock + Python wrapper for Brave's adblocking library, which is written in Rust. -### Building +### Building from source + +#### Build dependencies + +| Build Dependency | Versions | Arch Linux | Url | +| ---------------- | -------- | ---------- | ------------------------------- | +| Python | `>=3.6` | `python` | - | +| Rust | `>=1.45` | `rust` | - | +| Maturin | `>=0.10` | `maturin` | https://github.com/PyO3/maturin | + +#### PEP 517 + +The `python-adblock` library is [PEP 517](https://www.python.org/dev/peps/pep-0517/) compatible, so you can build and install it from source, simply by running ``` -maturin build --release +pip install . ``` -#### Build dependencies +from the root of this directory. -| Build Dependency | Versions | Arch Linux | Url | -|------------------|----------|------------|-----| -| Python | `>=3.6` | `python3` | - | -| Rust | `>=1.45` | `rust` | - | -| Maturin | `>=0.10` | `maturin` | https://github.com/PyO3/maturin | +#### Wheels + +To create a wheel for this library, run the following command + +``` +maturin build --release --no-sdist --out dist/ +``` + +the result can be found in the `dist/` directory. ### Developing I use Poetry for development. To create and enter a virtual environment, do + ``` poetry install poetry shell ``` + then, to install the `adblock` module into the virtual environment, do + ``` maturin develop ``` @@ -36,9 +55,9 @@ Rust documentation for the latest `master` branch can be found at https://arnida This project is licensed under either of - * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or - http://www.apache.org/licenses/LICENSE-2.0) - * MIT license ([LICENSE-MIT](LICENSE-MIT) or - http://opensource.org/licenses/MIT) +- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) +- MIT license ([LICENSE-MIT](LICENSE-MIT) or + http://opensource.org/licenses/MIT) at your option. -- cgit v1.2.3