Metadata-Version: 2.4
Name: lorax-arg
Version: 0.1.1
Summary: Lorax single-port app (bundled UI + backend)
Author: Lorax Team
License: MIT
Keywords: lorax,arg,visualization,evolution,genomics,biology
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn>=0.20.0
Requires-Dist: python-socketio>=5.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: click>=8.0.0
Requires-Dist: aiofiles>=24.0.0
Requires-Dist: aiohttp>=3.0.0
Requires-Dist: numpy>=2.0.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: pyarrow>=18.0.0
Requires-Dist: tskit>=1.0.0
Requires-Dist: tszip>=0.2.0
Requires-Dist: redis>=5.0.0
Requires-Dist: google-cloud-storage>=3.0.0
Requires-Dist: starlette>=0.40.0
Requires-Dist: psutil>=5.0.0
Requires-Dist: ete3>=3.1.0
Requires-Dist: numba>0.57.1
Requires-Dist: python-multipart>=0.0.10
Provides-Extra: prod
Requires-Dist: gunicorn>=23.0.0; extra == "prod"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: httpx>=0.24.0; extra == "dev"
Requires-Dist: locust>=2.15.0; extra == "dev"
Requires-Dist: python-socketio[client]>=5.0.0; extra == "dev"
Requires-Dist: msprime>=1.2.0; extra == "dev"

# lorax-arg

`lorax-arg` is a pip-installable distribution that runs Lorax as a **single-port app**.
It ships the backend package in the same wheel so the install does not depend on a separate `lorax` PyPI release.
CLI entrypoint: `lorax` (with `lorax-arg` as an alias).

- React UI served at `/`
- Backend API served at `/api/*`
- Socket.IO served at `/api/socket.io/`

## Development (monorepo)

This package can run against the backend Python package from `packages/backend/` during development.

### Build + sync UI assets (for wheel builds)

Build the website with `VITE_API_BASE=/api`, then copy the `dist/` output into the Python package:

```bash
npm ci
VITE_API_BASE=/api npm --workspace packages/website run build
python packages/app/scripts/sync_ui_assets.py
```

### Run from source without copying assets

```bash
export LORAX_APP_STATIC_DIR=packages/website/dist
python -m pip install -e .
lorax
```

## Clean (remove build artifacts)

```bash
rm -rf build dist *.egg-info
find packages/app -type d -name __pycache__ -prune -exec rm -rf {} +
```

## Production build (bundled UI)

Build the UI and bundle it into the Python package, then build the wheel/sdist:

```bash
npm ci
VITE_API_BASE=/api npm --workspace packages/website run build
python packages/app/scripts/sync_ui_assets.py

python -m pip install -U build
python -m build .
```

You can also run:

```bash
lorax build
```

## Production install

Install the built wheel locally (recommended for production verification):

```bash
python -m pip install --force-reinstall dist/lorax_arg-*.whl
lorax
```

## Publish online (PyPI)

1) Update `version` in the repo-root `pyproject.toml`.
2) Build fresh artifacts:

```bash
rm -rf build dist *.egg-info
npm ci
VITE_API_BASE=/api npm --workspace packages/website run build
python packages/app/scripts/sync_ui_assets.py
python -m pip install -U build twine
python -m build .
```

3) Upload to TestPyPI (recommended), then PyPI:

```bash
python -m twine upload --repository testpypi dist/*
# verify: python -m pip install -i https://test.pypi.org/simple lorax-arg
python -m twine upload dist/*
```

Notes:
- You need PyPI credentials (or a token) configured in `~/.pypirc` or via `TWINE_USERNAME`/`TWINE_PASSWORD`.
- Keep `README.md` and metadata in sync with what you want on PyPI.
