Page MenuHomeSoftware Heritage

cli: speedup the `swh` cli command startup time
ClosedPublic

Authored by douardda on Sep 10 2020, 4:30 PM.

Details

Summary

by moving import statements in functions.

Also remove WebAPIClient from the swh.web.client namespace
so loading the cli sunmodule does not trigger the loading of
230+ modules.

Related to T2575.

Diff Detail

Repository
rDWCLI Web client
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build has FAILED

Patch application report for D3923 (id=13783)

Rebasing onto f3d89ebc4e...

Current branch diff-target is up to date.
Changes applied before test
commit 55e942ce159b175014cf5ad2e086ab186339bb7d
Author: David Douard <david.douard@sdfa3.org>
Date:   Thu Sep 10 10:30:39 2020 +0200

    cli: speedup the `swh` cli command startup time
    
    by moving import statements in functions.
    
    Related to T2575.

commit 572e8769857fae532ec2d052abdc18ac0d6afb9b
Author: David Douard <david.douard@sdfa3.org>
Date:   Thu Sep 10 15:04:12 2020 +0200

    Remove WebAPIClient from the swh.web.client namespace
    
    so loading the cli sunmodule does not trigger the loading of
    230+ modules.
    
    Related to T2575.

Link to build: https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/14/
See console output for more information: https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/14/console

Build has FAILED

Patch application report for D3923 (id=13785)

Rebasing onto f3d89ebc4e...

Current branch diff-target is up to date.
Changes applied before test
commit 0bc74c28c028d90f09b0349106fcfb151e566f98
Author: David Douard <david.douard@sdfa3.org>
Date:   Thu Sep 10 10:30:39 2020 +0200

    cli: speedup the `swh` cli command startup time
    
    by moving import statements in functions.
    
    Related to T2575.

commit ab96dae9f035f8728802352af53373222384e0eb
Author: David Douard <david.douard@sdfa3.org>
Date:   Thu Sep 10 15:04:12 2020 +0200

    Remove WebAPIClient from the swh.web.client namespace
    
    so loading the cli sunmodule does not trigger the loading of
    230+ modules.
    
    Related to T2575.

Link to build: https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/15/
See console output for more information: https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/15/console

This revision is now accepted and ready to land.Sep 10 2020, 4:46 PM

fix test_cli

mocking was broken

Build is green

Patch application report for D3923 (id=13787)

Rebasing onto f3d89ebc4e...

Current branch diff-target is up to date.
Changes applied before test
commit ade9e0cf6e38738408b2d8ae43de6e3089efcb01
Author: David Douard <david.douard@sdfa3.org>
Date:   Thu Sep 10 10:30:39 2020 +0200

    cli: speedup the `swh` cli command startup time
    
    by moving import statements in functions.
    
    Related to T2575.

commit ab96dae9f035f8728802352af53373222384e0eb
Author: David Douard <david.douard@sdfa3.org>
Date:   Thu Sep 10 15:04:12 2020 +0200

    Remove WebAPIClient from the swh.web.client namespace
    
    so loading the cli sunmodule does not trigger the loading of
    230+ modules.
    
    Related to T2575.

See https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/16/ for more details.