diff options
| author | Árni Dagur <arni@dagur.eu> | 2021-06-26 19:27:41 +0000 |
|---|---|---|
| committer | Árni Dagur <arni@dagur.eu> | 2021-06-26 19:27:41 +0000 |
| commit | d42162d21d5fe0408d02966c9180817d54bcb66e (patch) | |
| tree | 0280b886d2566d3bc89e37c111fa274242b63324 /README.md | |
| parent | 822855b20a7864838084a813c457e2eb1f9570d5 (diff) | |
Improve build instructions in README
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 47 |
1 files changed, 33 insertions, 14 deletions
| @@ -1,29 +1,48 @@ | |||
| 1 | python-adblock | 1 | # python-adblock |
| 2 | ========== | 2 | |
| 3 | Python wrapper for Brave's adblocking library, which is written in Rust. | 3 | Python wrapper for Brave's adblocking library, which is written in Rust. |
| 4 | 4 | ||
| 5 | ### Building | 5 | ### Building from source |
| 6 | |||
| 7 | #### Build dependencies | ||
| 8 | |||
| 9 | | Build Dependency | Versions | Arch Linux | Url | | ||
| 10 | | ---------------- | -------- | ---------- | ------------------------------- | | ||
| 11 | | Python | `>=3.6` | `python` | - | | ||
| 12 | | Rust | `>=1.45` | `rust` | - | | ||
| 13 | | Maturin | `>=0.10` | `maturin` | https://github.com/PyO3/maturin | | ||
| 14 | |||
| 15 | #### PEP 517 | ||
| 16 | |||
| 17 | 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 | ||
| 6 | 18 | ||
| 7 | ``` | 19 | ``` |
| 8 | maturin build --release | 20 | pip install . |
| 9 | ``` | 21 | ``` |
| 10 | 22 | ||
| 11 | #### Build dependencies | 23 | from the root of this directory. |
| 12 | 24 | ||
| 13 | | Build Dependency | Versions | Arch Linux | Url | | 25 | #### Wheels |
| 14 | |------------------|----------|------------|-----| | 26 | |
| 15 | | Python | `>=3.6` | `python3` | - | | 27 | To create a wheel for this library, run the following command |
| 16 | | Rust | `>=1.45` | `rust` | - | | 28 | |
| 17 | | Maturin | `>=0.10` | `maturin` | https://github.com/PyO3/maturin | | 29 | ``` |
| 30 | maturin build --release --no-sdist --out dist/ | ||
| 31 | ``` | ||
| 32 | |||
| 33 | the result can be found in the `dist/` directory. | ||
| 18 | 34 | ||
| 19 | ### Developing | 35 | ### Developing |
| 20 | 36 | ||
| 21 | I use Poetry for development. To create and enter a virtual environment, do | 37 | I use Poetry for development. To create and enter a virtual environment, do |
| 38 | |||
| 22 | ``` | 39 | ``` |
| 23 | poetry install | 40 | poetry install |
| 24 | poetry shell | 41 | poetry shell |
| 25 | ``` | 42 | ``` |
| 43 | |||
| 26 | then, to install the `adblock` module into the virtual environment, do | 44 | then, to install the `adblock` module into the virtual environment, do |
| 45 | |||
| 27 | ``` | 46 | ``` |
| 28 | maturin develop | 47 | maturin develop |
| 29 | ``` | 48 | ``` |
| @@ -36,9 +55,9 @@ Rust documentation for the latest `master` branch can be found at https://arnida | |||
| 36 | 55 | ||
| 37 | This project is licensed under either of | 56 | This project is licensed under either of |
| 38 | 57 | ||
| 39 | * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or | 58 | - Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or |
| 40 | http://www.apache.org/licenses/LICENSE-2.0) | 59 | http://www.apache.org/licenses/LICENSE-2.0) |
| 41 | * MIT license ([LICENSE-MIT](LICENSE-MIT) or | 60 | - MIT license ([LICENSE-MIT](LICENSE-MIT) or |
| 42 | http://opensource.org/licenses/MIT) | 61 | http://opensource.org/licenses/MIT) |
| 43 | 62 | ||
| 44 | at your option. | 63 | at your option. |
