Page MenuHomeSoftware Heritage

cli.client: Add types
ClosedPublic

Authored by ardumont on Oct 7 2020, 3:55 PM.

Details

Test Plan

tox

Diff Detail

Repository
rDDEP Push deposit
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16008
Build 24629: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 24628: arc lint + arc unit

Unit TestsFailed

TimeTest
0 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.cli.test_client
.tox/py3/lib/python3.7/site-packages/swh/deposit/tests/cli/test_client.py:15: in <module> from swh.deposit.cli import deposit as cli <frozen importlib._bootstrap>:983: in _find_and_load

Event Timeline

Build has FAILED

Patch application report for D4183 (id=14729)

Could not rebase; Attempt merge onto cd9c04afe6...

Updating cd9c04af..0abc6903
Fast-forward
 conftest.py               |   6 ++-
 pytest.ini                |   2 +-
 swh/deposit/cli/client.py | 105 ++++++++++++++++++++++++----------------------
 3 files changed, 61 insertions(+), 52 deletions(-)
Changes applied before test
commit 0abc69039216b87737f20f9b3780a79d92dffce1
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Oct 7 15:56:09 2020 +0200

    cli.client: Add types

commit 98dcf27419726acb0e3cefaf1859346abffa4546
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Oct 7 15:08:29 2020 +0200

    conftest: Declare swh.core pytest_plugin

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

Using a string as type (or from __future__ import annotations) only defers the evaluation, but mypy executes it eventually. So it needs to be available in the same scope as the functions.

Try writing the qualified name?

Build has FAILED

Patch application report for D4183 (id=14731)

Could not rebase; Attempt merge onto cd9c04afe6...

Updating cd9c04af..8665a162
Fast-forward
 conftest.py               |   6 ++-
 pytest.ini                |   2 +-
 swh/deposit/cli/client.py | 109 +++++++++++++++++++++++++---------------------
 3 files changed, 65 insertions(+), 52 deletions(-)
Changes applied before test
commit 8665a162b68199bde41eeb618e578526b5b3d23f
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Oct 7 15:56:09 2020 +0200

    cli.client: Add types

commit 98dcf27419726acb0e3cefaf1859346abffa4546
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Oct 7 15:08:29 2020 +0200

    conftest: Declare swh.core pytest_plugin

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

Build is green

Patch application report for D4183 (id=14732)

Could not rebase; Attempt merge onto cd9c04afe6...

Updating cd9c04af..7dc72708
Fast-forward
 conftest.py               |   6 ++-
 pytest.ini                |   2 +-
 swh/deposit/cli/client.py | 109 +++++++++++++++++++++++++---------------------
 3 files changed, 65 insertions(+), 52 deletions(-)
Changes applied before test
commit 7dc727087b99159335e3daf90b5a1c4180ebf5e6
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Oct 7 15:56:09 2020 +0200

    cli.client: Add types

commit 98dcf27419726acb0e3cefaf1859346abffa4546
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Oct 7 15:08:29 2020 +0200

    conftest: Declare swh.core pytest_plugin

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

vlorentz added inline comments.
swh/deposit/cli/client.py
103

doesn't need to be a string anymore

119

same

This revision is now accepted and ready to land.Oct 8 2020, 5:59 PM

(you'll have to add from __future__ import annotations though)

swh/deposit/cli/client.py
103

i thought as much but it failed without it...
see one iteration before that last diff update...

swh/deposit/cli/client.py
103

see my other comment

swh/deposit/cli/client.py
103

oh thanks, i did not notice it...
I'll fix in another diff (i built on this one and now, lazyness hit me ;)

This revision was automatically updated to reflect the committed changes.
swh/deposit/cli/client.py
103