It's not packaged nor ready yet as some internal reworking has been discussed.
Related to T3412
Differential D5935
Make swh.graph dependency optional Authored by ardumont on Jun 28 2021, 3:38 PM.
Details
It's not packaged nor ready yet as some internal reworking has been discussed. Related to T3412 tox
Diff Detail
Event TimelineComment Actions Build is green Patch application report for D5935 (id=21309)Rebasing onto 0bec623156... Current branch diff-target is up to date. Changes applied before testcommit a97cd94fac73a76bec59b955c8bd9a132a65b8ab
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Mon Jun 28 15:36:26 2021 +0200
Make swh.graph dependency optional
It's not packaged nor ready yet as some internal reworking has been discussed.
Related to T3412See https://jenkins.softwareheritage.org/job/DVAU/job/tests-on-diff/120/ for more details. Comment Actions I would rather do this: if "graph" in vcfg:
from swh.graph.client import RemoteGraphClient
graph = RemoteGraphClient(**vcfg["graph"])
else:
graph = NoneSo that it errors if it's configured to use it but isn't available Comment Actions ack, that was my first implementation but i recall we did use the try except with import error instead... Comment Actions Adapt according to irc discussion [1] and review here. I may still need to update the tests with those corner case... [1] 15:42 <+olasd> you'll need an update to requirements-swh.txt too to make the dependency an extra
15:43 <+swhbot> icinga PROBLEM: service disk / on worker01.softwareheritage.org is WARNING: DISK WARNING - free space: / 6257 MB (18% inode=71%);
15:43 <+olasd> and probably test the new logic
15:43 <+olasd> I'd also replace `graph = RemoteGraphClient(**vcfg["graph"]) if "graph" in vcfg else None` with `graph = RemoteGraphClient(**vcfg["graph"]) if vcfg.get("graph") else None` to allow setting `graph: null` in the configComment Actions Build has FAILED Patch application report for D5935 (id=21312)Rebasing onto 0bec623156... Current branch diff-target is up to date. Changes applied before testcommit cd6ef1b2629f8246835ddb69e4094ce32611e88c
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Mon Jun 28 15:36:26 2021 +0200
Make swh.graph dependency optional
It's not packaged nor ready yet as some internal reworking has been discussed.
Related to T3412Link to build: https://jenkins.softwareheritage.org/job/DVAU/job/tests-on-diff/121/ Comment Actions
16:03:42 swh/vault/cookers/git_bare.py:30: error: Skipping analyzing "swh.graph.client": found module but no type hints or library stubs 16:03:42 swh/vault/cookers/__init__.py:94: error: Skipping analyzing "swh.graph.client": found module but no type hints or library stubs 16:03:42 swh/vault/cookers/__init__.py:94: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports 16:03:42 swh/vault/tests/test_git_bare_cooker.py:21: error: Skipping analyzing "swh.graph.naive_client": found module but no type hints or library stubs 16:03:42 swh/vault/cli.py:104: error: Skipping analyzing "swh.graph.client": found module but no type hints or library stubs 16:03:42 Found 4 errors in 4 files (checked 33 source files) Now what!? Comment Actions
Well, that game is not funny. Comment Actions Build has FAILED Patch application report for D5935 (id=21314)Rebasing onto 0bec623156... Current branch diff-target is up to date. Changes applied before testcommit 71a160b97c34089f5fc6c650627c17c72f2ff854
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Mon Jun 28 15:36:26 2021 +0200
Make swh.graph dependency optional
It's not packaged nor ready yet as some internal reworking has been discussed.
Related to T3412Link to build: https://jenkins.softwareheritage.org/job/DVAU/job/tests-on-diff/122/ Comment Actions Where? was it for something that was explicitly configured too?
What? You can do this to please mypy: graph: Optional[RemoteGraphClient]
if "graph" in vcfg:
from swh.graph.client import RemoteGraphClient
graph = RemoteGraphClient(**vcfg["graph"])
else:
graph = NoneComment Actions locally, prior to opening the diff so you did not see it.
No, it's not happy because the first implementation is actually a RemoteGraphClient and not an optional one. Comment Actions Build has FAILED Patch application report for D5935 (id=21319)Rebasing onto 0bec623156... Current branch diff-target is up to date. Changes applied before testcommit 6b5d173cb6ef22d81f27a12ec15a8d3e8fda5a3d
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Mon Jun 28 15:36:26 2021 +0200
Make swh.graph dependency optional
It's not packaged nor ready yet as some internal reworking has been discussed.
Related to T3412Link to build: https://jenkins.softwareheritage.org/job/DVAU/job/tests-on-diff/123/ Comment Actions Finally, what i forgot to say earlier: if "graph" in vcfg:
from swh.graph.client import RemoteGraphClient
graph = RemoteGraphClient(**vcfg["graph"])
...This form cannot work if we don't wrap this into a try...except ModuleNotFound... stanza when the dep is actually not installed. Comment Actions Build is green Patch application report for D5935 (id=21320)Rebasing onto 0bec623156... Current branch diff-target is up to date. Changes applied before testcommit eaab208f2242747f1821d361f6cf9625bb938fb4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Mon Jun 28 15:36:26 2021 +0200
Make swh.graph dependency optional
It's not packaged nor ready yet as some internal reworking has been discussed.
Related to T3412See https://jenkins.softwareheritage.org/job/DVAU/job/tests-on-diff/124/ for more details. Comment Actions Build is green Patch application report for D5935 (id=21322)Rebasing onto 0bec623156... Current branch diff-target is up to date. Changes applied before testcommit 9d0df34d412a235df1895e4d0077827371935ad8
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Mon Jun 28 15:36:26 2021 +0200
Make swh.graph dependency optional
It's not packaged nor ready yet as some internal reworking has been discussed.
Related to T3412See https://jenkins.softwareheritage.org/job/DVAU/job/tests-on-diff/125/ for more details. |