zhost-cli-0.1.0
default.checks.x86_64-linux.package-zhost-cli
· build #37
· raw
1Sourcing python-remove-tests-dir-hook2Sourcing python-catch-conflicts-hook.sh3Sourcing python-remove-bin-bytecode-hook.sh4Sourcing pypa-build-hook5Using pypaBuildPhase6Sourcing python-runtime-deps-check-hook7Using pythonRuntimeDepsCheckHook8Sourcing pypa-install-hook9Using pypaInstallPhase10Sourcing python-imports-check-hook.sh11Using pythonImportsCheckPhase12Sourcing python-namespaces-hook13Sourcing python-catch-conflicts-hook.sh14Sourcing pytest-check-hook15Using pytestCheckPhase
unpackPhase
16unpacking source archive /nix/store/nbbck5mbjbvf4ndsly4l1kzm9i7lbczv-zhost-cli17source root is zhost-cli18setting SOURCE_DATE_EPOCH to timestamp 315619200 of file "zhost-cli/zhost_cli/pdf.py"configurePhase
19no configure script, doing nothingbuildPhase
20Executing pypaBuildPhase21Creating a wheel...22pypa build flags: --no-isolation --outdir dist/ --wheel23* Getting build dependencies for wheel...24* Building wheel...25Successfully built zhost_cli-0.1.0-py3-none-any.whl26Finished creating a wheel...27Finished executing pypaBuildPhasepythonRuntimeDepsCheckHook
28Executing pythonRuntimeDepsCheck29Checking runtime dependencies for zhost_cli-0.1.0-py3-none-any.whl30Finished executing pythonRuntimeDepsCheckinstallPhase
31Executing pypaInstallPhase32Successfully installed zhost_cli-0.1.0-py3-none-any.whl33Finished executing pypaInstallPhasepythonOutputDistPhase
34Executing pythonOutputDistPhase35Finished executing pythonOutputDistPhasefixupPhase
36shrinking RPATHs of ELF executables and libraries in /nix/store/xwmk6nwcd8qiyd9k3kzd6jvv53jxgc8x-zhost-cli-0.1.037checking for references to /build/ in /nix/store/xwmk6nwcd8qiyd9k3kzd6jvv53jxgc8x-zhost-cli-0.1.0...38patching script interpreter paths in /nix/store/xwmk6nwcd8qiyd9k3kzd6jvv53jxgc8x-zhost-cli-0.1.039stripping (with command strip and flags -S -p) in /nix/store/xwmk6nwcd8qiyd9k3kzd6jvv53jxgc8x-zhost-cli-0.1.0/lib /nix/store/xwmk6nwcd8qiyd9k3kzd6jvv53jxgc8x-zhost-cli-0.1.0/bin40shrinking RPATHs of ELF executables and libraries in /nix/store/5rj6v5fd4q4iprwv95vyv820fpymilkk-zhost-cli-0.1.0-dist41checking for references to /build/ in /nix/store/5rj6v5fd4q4iprwv95vyv820fpymilkk-zhost-cli-0.1.0-dist...42patching script interpreter paths in /nix/store/5rj6v5fd4q4iprwv95vyv820fpymilkk-zhost-cli-0.1.0-dist43Rewriting #!/nix/store/gxzhl7aaiid7zp3y47jqqiq7zg5mqpwp-python3-3.14.6/bin/python3.14 to #!/nix/store/gxzhl7aaiid7zp3y47jqqiq7zg5mqpwp-python3-3.14.644wrapping `/nix/store/xwmk6nwcd8qiyd9k3kzd6jvv53jxgc8x-zhost-cli-0.1.0/bin/zhost-cli'...45Executing pythonRemoveTestsDir46Finished executing pythonRemoveTestsDirinstallCheckPhase
47no Makefile or custom installCheckPhase, doing nothingpythonImportsCheckPhase
48Executing pythonImportsCheckPhasepytestCheckPhase
49Executing pytestCheckPhase5012 files already formatted51RUF012 Mutable default value for class attribute52 --> tests/test_cli.py:19:4653 |5417 | class State:5518 | version = 105619 | collections: dict[str, dict[str, Any]] = {}57 | ^^5820 | items: dict[str, dict[str, Any]] = {}5921 | settings: dict[str, dict[str, Any]] = {}60 |61help: Consider initializing in `__init__` or annotating with `typing.ClassVar`6263RUF012 Mutable default value for class attribute64 --> tests/test_cli.py:20:4065 |6618 | version = 106719 | collections: dict[str, dict[str, Any]] = {}6820 | items: dict[str, dict[str, Any]] = {}69 | ^^7021 | settings: dict[str, dict[str, Any]] = {}7122 | fulltext: dict[str, dict[str, Any]] = {}72 |73help: Consider initializing in `__init__` or annotating with `typing.ClassVar`7475RUF012 Mutable default value for class attribute76 --> tests/test_cli.py:21:4377 |7819 | collections: dict[str, dict[str, Any]] = {}7920 | items: dict[str, dict[str, Any]] = {}8021 | settings: dict[str, dict[str, Any]] = {}81 | ^^8222 | fulltext: dict[str, dict[str, Any]] = {}8323 | requests: list[dict[str, Any]] = []84 |85help: Consider initializing in `__init__` or annotating with `typing.ClassVar`8687RUF012 Mutable default value for class attribute88 --> tests/test_cli.py:22:4389 |9020 | items: dict[str, dict[str, Any]] = {}9121 | settings: dict[str, dict[str, Any]] = {}9222 | fulltext: dict[str, dict[str, Any]] = {}93 | ^^9423 | requests: list[dict[str, Any]] = []9524 | counter = 096 |97help: Consider initializing in `__init__` or annotating with `typing.ClassVar`9899RUF012 Mutable default value for class attribute100 --> tests/test_cli.py:23:38101 |10221 | settings: dict[str, dict[str, Any]] = {}10322 | fulltext: dict[str, dict[str, Any]] = {}10423 | requests: list[dict[str, Any]] = []105 | ^^10624 | counter = 0107 |108help: Consider initializing in `__init__` or annotating with `typing.ClassVar`109110UP043 [*] Unnecessary default type arguments111 --> tests/test_cli.py:261:48112 |113260 | @pytest.fixture()114261 | def server(monkeypatch: pytest.MonkeyPatch) -> Generator[str, None, None]:115 | ^^^^^^^^^^^^^^^^^^^^^^^^^^116262 | State.version, State.collections, State.items, State.requests, State.counter = (117263 | 10,118 |119help: Remove default type arguments120 |121260 | @pytest.fixture()122 - def server(monkeypatch: pytest.MonkeyPatch) -> Generator[str, None, None]:123261 + def server(monkeypatch: pytest.MonkeyPatch) -> Generator[str]:124262 | State.version, State.collections, State.items, State.requests, State.counter = (125 |126127RUF015 Prefer `next(...)` over single element slice128 --> tests/test_cli.py:325:9129 |130323 | main(["-j", "item", "find", "x"])131324 | assert {i["key"] for i in json.loads(capsys.readouterr().out)} == {"PAPER222"}132325 | q = [r for r in _reqs("GET", "/users/1/items") if "q" in r["query"]][0]133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^134326 | assert q["query"]["qmode"] == ["everything"]135 |136help: Replace with `next(...)`137138RUF015 Prefer `next(...)` over single element slice139 --> tests/test_cli.py:412:12140 |141410 | State.items["PAPER222"] = {"key": "PAPER222", "itemType": "journalArticle"}142411 | main(["note", "add", "PAPER222", "--text", "<p>hi</p>"])143412 | note = [144 | ____________^145413 | | r for r in _reqs("POST", "/users/1/items") if r["body"][0]["itemType"] == "note"146414 | | ][0]147 | |________^148415 | assert note["body"][0]["parentItem"] == "PAPER222"149416 | main(["note", "list", "PAPER222"])150 |151help: Replace with `next(...)`152153SIM115 Use a context manager for opening files154 --> tests/test_cli.py:424:5155 |156422 | ) -> None:157423 | pdf = f"{tmp_path}/p.pdf"158424 | open(pdf, "wb").write(b"%PDF-1.7 data")159 | ^^^^160425 | State.items["PAPER222"] = {"key": "PAPER222", "itemType": "journalArticle"}161426 | main(["pdf", "attach", "PAPER222", "--pdf", pdf])162 |163164RUF015 Prefer `next(...)` over single element slice165 --> tests/test_cli.py:429:11166 |167427 | assert any(r["path"].startswith("/uploads/") for r in State.requests)168428 | # the attachment was created under the paper169429 | att = [170 | ___________^171430 | | r172431 | | for r in _reqs("POST", "/users/1/items")173432 | | if r["body"][0]["itemType"] == "attachment"174433 | | ][0]175 | |________^176434 | assert att["body"][0]["parentItem"] == "PAPER222"177435 | out_path = f"{tmp_path}/dl.pdf"178 |179help: Replace with `next(...)`180181SIM115 Use a context manager for opening files182 --> tests/test_cli.py:437:12183 |184435 | out_path = f"{tmp_path}/dl.pdf"185436 | main(["pdf", "fetch", "PAPER222", "--output", out_path])186437 | assert open(out_path, "rb").read().startswith(b"%PDF")187 | ^^^^188189RUF015 Prefer `next(...)` over single element slice190 --> tests/test_cli.py:458:11191 |192456 | }193457 | main(["highlight", "add", "PAPER222", "--pdf", pdf, "--text", "highlight this"])194458 | ann = [195 | ___________^196459 | | r197460 | | for r in _reqs("POST", "/users/1/items")198461 | | if r["body"][0]["itemType"] == "annotation"199462 | | ][0]200 | |________^201463 | assert ann["body"][0]["parentItem"] == "ATTAC222"202464 | assert ann["body"][0]["annotationText"] == "highlight this"203 |204help: Replace with `next(...)`205206SIM115 Use a context manager for opening files207 --> tests/test_cli.py:503:5208 |209501 | ) -> None:210502 | pdf = f"{tmp_path}/p.pdf"211503 | open(pdf, "wb").write(b"%PDF-1.7 data")212 | ^^^^213504 | main(["-j", "item", "add", "--title", "P", "--pdf", pdf])214505 | out = json.loads(capsys.readouterr().out)215 |216217SIM115 Use a context manager for opening files218 --> tests/test_cli.py:546:5219 |220544 | ) -> None:221545 | pdf = f"{tmp_path}/p.pdf"222546 | open(pdf, "wb").write(b"%PDF-1.7 new")223 | ^^^^224547 | State.items["PAPER222"] = {"key": "PAPER222", "itemType": "journalArticle"}225548 | State.items["ATTAC222"] = {226 |227228SIM115 Use a context manager for opening files229 --> tests/test_cli.py:656:27230 |231654 | main(["library", "export", out])232655 |233656 | manifest = json.loads(open(f"{out}/manifest.json").read())234 | ^^^^235657 | assert manifest["counts"]["items"] == 1 # one top-level paper236 |237238SIM115 Use a context manager for opening files239 --> tests/test_cli.py:659:22240 |241657 | assert manifest["counts"]["items"] == 1 # one top-level paper242658 |243659 | rec = json.loads(open(f"{out}/items/PAPER222.json").read())244 | ^^^^245660 | assert rec["item"]["data"]["title"] == "P"246661 | assert {c["key"] for c in rec["children"]} == {"ATTAC222", "NOTE2222"}247 |248249SIM115 Use a context manager for opening files250 --> tests/test_cli.py:664:12251 |252662 | assert rec["fulltext"]["ATTAC222"]["content"] == "full body"253663 |254664 | assert open(f"{out}/files/ATTAC222/p.pdf", "rb").read().startswith(b"%PDF")255 | ^^^^256665 | colls = json.loads(open(f"{out}/collections.json").read())257666 | assert any(c["key"] == "FOLDER22" for c in colls)258 |259260SIM115 Use a context manager for opening files261 --> tests/test_cli.py:665:24262 |263664 | assert open(f"{out}/files/ATTAC222/p.pdf", "rb").read().startswith(b"%PDF")264665 | colls = json.loads(open(f"{out}/collections.json").read())265 | ^^^^266666 | assert any(c["key"] == "FOLDER22" for c in colls)267 |268269SIM115 Use a context manager for opening files270 --> tests/test_cli.py:717:43271 |272715 | exported_items = {p[:-5] for p in os.listdir(f"{out}/items")}273716 | assert exported_items == {"PAPER222", "SUBPAP22", "CROSS222"}274717 | colls = {c["key"] for c in json.loads(open(f"{out}/collections.json").read())}275 | ^^^^276718 | assert colls == {"ROOT2222", "FOLDER22", "SUBCOL22"}277719 | cross = json.loads(open(f"{out}/items/CROSS222.json").read())278 |279280SIM115 Use a context manager for opening files281 --> tests/test_cli.py:719:24282 |283717 | colls = {c["key"] for c in json.loads(open(f"{out}/collections.json").read())}284718 | assert colls == {"ROOT2222", "FOLDER22", "SUBCOL22"}285719 | cross = json.loads(open(f"{out}/items/CROSS222.json").read())286 | ^^^^287720 | assert cross["item"]["data"]["collections"] == ["FOLDER22"]288 |289290SIM115 Use a context manager for opening files291 --> tests/test_cli.py:734:27292 |293732 | main(["library", "export", out])294733 |295734 | settings = json.loads(open(f"{out}/settings.json").read())296 | ^^^^297735 | assert settings["tagColors"]["value"] == [{"name": "read", "color": "#5fb236"}]298 |299300SIM115 Use a context manager for opening files301 --> zhost_cli/client.py:274:16302 |303272 | ) -> Response:304273 | """Run the full authorize -> upload -> register sequence for `path`."""305274 | data = open(path, "rb").read()306 | ^^^^307275 | md5 = hashlib.md5(data).hexdigest()308276 | stat = os.stat(path)309 |310311Found 22 errors.312[*] 1 fixable with the `--fix` option (4 hidden fixes can be enabled with the `--unsafe-fixes` option).