You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make lighthouse an installable python package (#7)
The PR modifies `pyproject.toml` to make the content of `python/lighthouse` to be installable via `uv pip install .` For now the package is empty, but after #4 is merged users would be able to access ingress helper functions as part of the package:
```python
from lighthouse.ingress.torch import import_from_file
...
```
* install lighthouse on 'uv sync'
Signed-off-by: dchigarev <dmitry.chigarev@intel.com>
* use dynamic version in pyproject.toml
Signed-off-by: dchigarev <dmitry.chigarev@intel.com>
---------
Signed-off-by: dchigarev <dmitry.chigarev@intel.com>
Copy file name to clipboardExpand all lines: README.md
+51-2Lines changed: 51 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,10 +53,10 @@ The planned work is:
53
53
## Getting up and running
54
54
55
55
For the time being, `lighthouse` depends on just the Python bindings for [`mlir`](https://github.com/llvm/eudsl/releases).
56
-
To install this dependency, obtain the [`uv`](https://docs.astral.sh/uv/getting-started/installation/#pypi) Python package manager and run the following in the root of the project:
56
+
To install this dependency along with `lighthouse` python package, obtain the [`uv`](https://docs.astral.sh/uv/getting-started/installation/#pypi) Python package manager and run the following in the root of the project:
57
57
```
58
58
$ uv venv # Create a .venv virtualenv
59
-
$ uv sync # Install the `mlir-python-bindings` dependency into the virtualenv
59
+
$ uv sync # Install the `mlir-python-bindings` and `lighthouse` into the virtualenv
60
60
$ uv sync --extra ingress-torch-cpu # Optionally install the dependencies for torch ingress
61
61
```
62
62
@@ -68,3 +68,52 @@ For vendor-specific versions of `torch` use the targets `ingress-torch-nvidia`,
68
68
</details>
69
69
70
70
To run the Python programs in this repo, either enter the virtual environment (`$ source .venv/bin/activate`) and execute a program _or_ execute each of the programs through `uv` (i.e. `$ uv run $EXE`), which will automatically run them inside the virtualenv.
71
+
72
+
## Installing Lighthouse as a Python package
73
+
74
+
You can install `lighthouse` as a Python package using `uv` or `pip`:
75
+
76
+
#### Installing via `uv`
77
+
78
+
If you've run the steps from the [Getting up and running](#getting-up-and-running) section,
79
+
you already have `lighthouse` installed in your virtual environment:
80
+
81
+
```
82
+
$ uv run python
83
+
Python 3.12.11 | (main, Jun 4 2025, 14:45:31) [GCC 13.3.0] on linux
84
+
Type "help", "copyright", "credits" or "license" for more information.
85
+
>>> import lighthouse
86
+
>>> lighthouse.__version__
87
+
'0.1.0a1'
88
+
```
89
+
90
+
If you don't want to use the virtual environment created by `uv`, you can skip `uv venv; uv sync` steps and install Lighthouse in your current environment using:
91
+
92
+
```
93
+
$ source ../my_custom_venv/bin/activate # or conda activate my-venv
94
+
(my-venv) $ uv pip install . # installs Lighthouse along with its basic dependencies
95
+
(my-venv) $ uv pip install .[ingress_torch_cpu] # installs Lighthouse along with its torch-ingress dependencies
96
+
```
97
+
98
+
#### Installing via `pip`
99
+
100
+
If you don't want to use `uv` to install the package, you can install it directly with `pip`.
101
+
You'll need to specify the custom sources so `pip` can find all required dependencies (e.g., mlir-bindings). The sources are listed in the `pyproject.toml` file.
102
+
103
+
Here are some common installation examples:
104
+
105
+
1. Install Lighthouse only
106
+
```
107
+
pip install . \
108
+
--find-links https://llvm.github.io/eudsl/ \
109
+
--only-binary :all:
110
+
```
111
+
112
+
2. Install Lighthouse and torch-ingress dependencies
0 commit comments