deps: Switch from uv to plain venv and pip-tools
uv installs to ~/.local/bin which is not in PATH for systemd services, and keeping uv updated on Ubuntu requires manual steps outside of apt. Switch to a plain Python venv with pip-tools for dependency locking. - Replace uv venv/sync with python3 -m venv --system-site-packages - Generate requirements.txt with pip-compile from pyproject.toml - Update service ExecStart to use .venv/bin/python directly - Remove uv.lock and [tool.uv] from pyproject.toml - Update README to document venv+pip-tools workflow
This commit is contained in:
parent
b2646222f8
commit
025228b83c
5 changed files with 109 additions and 1100 deletions
22
README.md
22
README.md
|
|
@ -11,7 +11,6 @@ Designed for rooms bridged from WhatsApp via mautrix-whatsapp.
|
|||
## Requirements
|
||||
|
||||
- Python 3.11+
|
||||
- [uv](https://docs.astral.sh/uv/) (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
|
||||
- `libolm` + `python-olm` — must be installed via the system package manager
|
||||
because `python-olm`'s build system is incompatible with modern CMake
|
||||
|
||||
|
|
@ -32,8 +31,8 @@ sudo apt install libolm3 python3-olm
|
|||
```bash
|
||||
git clone <repo>
|
||||
cd matrix-paperless-ingest
|
||||
uv venv --system-site-packages
|
||||
uv sync --no-install-package python-olm
|
||||
python3 -m venv .venv --system-site-packages
|
||||
.venv/bin/pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### 2. Create a Matrix bot account
|
||||
|
|
@ -96,7 +95,7 @@ PAPERLESS_INBOX_TAG_ID=1
|
|||
### 7. Test
|
||||
|
||||
```bash
|
||||
uv run --no-sync python ingest.py
|
||||
.venv/bin/python ingest.py
|
||||
```
|
||||
|
||||
Watch the logs. It will process all historical messages, then listen for new ones.
|
||||
|
|
@ -118,6 +117,17 @@ systemctl --user enable --now matrix-paperless-ingest
|
|||
journalctl --user -u matrix-paperless-ingest -f
|
||||
```
|
||||
|
||||
## Updating dependencies
|
||||
|
||||
If you need to add or update a dependency, edit `pyproject.toml` and regenerate
|
||||
the locked `requirements.txt`:
|
||||
|
||||
```bash
|
||||
.venv/bin/pip install pip-tools
|
||||
.venv/bin/pip-compile pyproject.toml
|
||||
.venv/bin/pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Viewing retry queue
|
||||
|
||||
```bash
|
||||
|
|
@ -127,6 +137,6 @@ sqlite3 state.db "SELECT filename, status, retry_count, datetime(next_retry, 'un
|
|||
## Moving to a new server
|
||||
|
||||
1. Copy the project directory to `~/matrix-paperless-ingest` (including `.env` and `state.db`)
|
||||
2. Install `uv`, `libolm3`, and `python3-olm` on the new server
|
||||
3. Run `uv venv --system-site-packages && uv sync --no-install-package python-olm`
|
||||
2. Install `libolm3` and `python3-olm` via the system package manager
|
||||
3. Run `python3 -m venv .venv --system-site-packages && .venv/bin/pip install -r requirements.txt`
|
||||
4. Install the systemd user service as above
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue