Packaging: the wheel carries the PWA, so a release install serves the UI (v2.7.10)
- pyproject declared build-backend = "setuptools.backends._legacy:_Backend", which does not exist: `python -m build`, `pip install .` and even `pip install -e .` died with "Backend ... is not available". It is setuptools.build_meta now. - the wheel and sdist carried only the Python packages, and _default_web_dir() resolved <site-packages>/../frontend, so an installed server started fine but answered every static request with 404. setup.py's build_py now copies the checkout's frontend/ into simtrace_analyser/web/ inside the build (the PWA's tests excluded), and _default_web_dir() prefers that packaged copy, falling back to <repo>/frontend for source and editable runs. The source directory is resolved from setup.py (so an sdist build works) and a missing frontend/ fails the build loudly instead of shipping a package without its UI. - MANIFEST.in grafts frontend/ (with the READMEs, the udev rule and the four launch scripts) into the sdist, so a wheel built from the sdist has the PWA. - README (EN/RU): an install-from-a-release section (pipx/pip with the wheel, the direct release URL for pip) and the --web-dir default documented as the bundled PWA, or <repo>/frontend from source. - tests/test_packaging.py pins the packaged-first resolution (including the empty-directory fallback), the source checkout default, the real build backend, the manifest graft and setup.py's bundling. - verified: a fresh venv install from the wheel and from the sdist serve GET / (200, byte-identical index.html, PWA v2.7.10) out of site-packages/simtrace_analyser/web; an editable install still resolves <repo>/frontend. 547 Python + 80 Node tests.
This commit is contained in:
1 parent
4a03f83459
commit
25aa87ba1e
11 files changed
+196
-16
No files matched your search
@@ -108,12 +108,34 @@ pip install -e .
|
||||
# or: simtrace2-pysniff [opts]
|
||||
```
|
||||
|
||||
### From a release (no git checkout)
|
||||
|
||||
The release artifacts bundle the PWA, so an installed server serves the same UI
|
||||
as a clone. Download the wheel from the
|
||||
[latest release](https://github.com/anttro/simtrace-analyser/releases/latest)
|
||||
and install it:
|
||||
|
||||
```sh
|
||||
pipx install ./simtrace_analyser-2.7.10-py3-none-any.whl
|
||||
# or: pip install ./simtrace_analyser-2.7.10-py3-none-any.whl
|
||||
|
||||
# then run (the UI is served at http://127.0.0.1:8081/):
|
||||
simtrace-analyser-server --capture gsmtap
|
||||
```
|
||||
|
||||
`pip` can also fetch the wheel straight from the release page:
|
||||
|
||||
```sh
|
||||
pip install https://github.com/anttro/simtrace-analyser/releases/download/v2.7.10/simtrace_analyser-2.7.10-py3-none-any.whl
|
||||
```
|
||||
|
||||
## Running
|
||||
|
||||
### Analysis server + PWA (`simtrace-analyser-server`)
|
||||
|
||||
Stores captured APDU traffic in SQLite and serves it over HTTP, together with
|
||||
the bundled **SIMtrace Analyser** PWA (`frontend/`) on the same origin. Three
|
||||
the bundled **SIMtrace Analyser** PWA (`frontend/` in a source checkout,
|
||||
bundled into the package on install) on the same origin. Three
|
||||
capture modes:
|
||||
|
||||
```sh
|
||||
@@ -283,13 +305,14 @@ Server options:
|
||||
--db FILE SQLite database path (default: ~/.simtrace-analyser/sessions.db)
|
||||
--capture MODE gsmtap | direct | disabled (default: gsmtap)
|
||||
--gsmtap-port PORT UDP port for the GSMTAP listener (default: 4729)
|
||||
--web-dir PATH PWA static files directory (default: <repo>/frontend)
|
||||
--web-dir PATH PWA static files directory (default: the PWA bundled in
|
||||
the installed package, or <repo>/frontend from source)
|
||||
```
|
||||
|
||||
Then open **http://127.0.0.1:8081/** in a browser — the PWA is served by the
|
||||
server, so the UI and the API share an origin and no CORS/Private-Network-Access
|
||||
setup is involved. Use `--web-dir PATH` to serve a different PWA directory
|
||||
(default: `<repo>/frontend`).
|
||||
(default: the bundled PWA, or `<repo>/frontend` in a source checkout).
|
||||
|
||||
### Hosted PWA (landing page)
|
||||
|
||||
|
||||
Reference in new issue
Block a user