From 455dd1f8e6864115a839eab50de42769b8afef63 Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 29 Jun 2025 19:06:00 -0600 Subject: [PATCH] Adding DEVELOPMENT.md document to help a developer start with WROLPi. --- DEVELOPMENT.md | 22 ++++++++++++++++++++++ modules/archive/test/test_lib.py | 2 +- wrolpi/files/indexers.py | 1 + 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 DEVELOPMENT.md diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 00000000..da2e8745 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,22 @@ +This document contains instructions to set up your system for WROLPi development. + +# Setup + +## Debian 12 + +1. Install accessory packages necessary for testing: + * `sudo apt install ffmpeg chromium chromium-driver sysstat aria2 nodejs npm` +2. Create Python environment: + * `python -m venv venv` +3. Activate the new environment: + * `. venv/bin/activate` +4. Build the docker containers: + * `./scripts/dev_build.sh` +5. Start the docker containers: + * `docker compose up` +6. Browse to the development containers: + * https://localhost:8443 +7. Install npm dependencies used outside the app: + * `npm install single-file-cli@2.0.73 readability-extractor@0.0.6` +8. Run the tests. All tests should pass. + * `pytest` diff --git a/modules/archive/test/test_lib.py b/modules/archive/test/test_lib.py index f6ed8d30..8bc1d29e 100644 --- a/modules/archive/test/test_lib.py +++ b/modules/archive/test/test_lib.py @@ -277,7 +277,7 @@ def test_get_domains(test_session, archive_factory): @pytest.mark.asyncio -async def test_new_archive(test_session, fake_now): +async def test_new_archive(test_session, fake_now, test_directory): singlefile, readability, screenshot = make_fake_archive_result() fake_now(datetime(2000, 1, 1)) archive1 = await model_archive_result('https://example.com', singlefile, readability, screenshot) diff --git a/wrolpi/files/indexers.py b/wrolpi/files/indexers.py index 0b58997c..502fb3d2 100644 --- a/wrolpi/files/indexers.py +++ b/wrolpi/files/indexers.py @@ -150,6 +150,7 @@ class DocIndexer(Indexer, ABC): def create_index(cls, path: pathlib.Path): a = cls.get_title(path) + text = '' if CATDOC_PATH: # Use catdoc on Linux cmd = (CATDOC_PATH, str(path.absolute()))