Page MenuHomeSoftware Heritage

deposit.api: Add types to main api
ClosedPublic

Authored by ardumont on Sep 17 2020, 7:47 PM.

Details

Reviewers
anlambert
Group Reviewers
Reviewers
Maniphest Tasks
T2223: Type checking
Commits
rDDEP027169a72bcc: deposit.api: Add types
Summary

This allows a better readability of the current code.
Related to T2223

Test Plan

tox

Diff Detail

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

Unit TestsFailed

TimeTest
671 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_deposit_private_read_archive::test_access_to_existing_deposit_with_multiple_archives
tmp_path = '/tmp/pytest-of-jenkins/pytest-0/test_access_to_existing_deposi1' authenticated_client = <rest_framework.test.APIClient object at 0x7fa66eeeed68> deposit_collection = <DepositCollection: {'id': 55, 'name': 'test'}>
619 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_deposit_private_read_archive::test_access_to_existing_deposit_with_one_archive
authenticated_client = <rest_framework.test.APIClient object at 0x7fa66ea940b8> deposit_collection = <DepositCollection: {'id': 54, 'name': 'test'}> complete_deposit = <Deposit: {'id': 42, 'reception_date': datetime.datetime(2020, 9, 17, 17, 49, 28, 392956, tzinfo=<UTC>), 'collection': 'test', 'external_id': 'external-id-complete', 'client': 'test', 'status': 'done'}>
370 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_converters::test_convert_status_detail
370 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_converters::test_convert_status_detail_2
266 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_converters::test_convert_status_detail_3
View Full Test Results (2 Failed · 140 Passed)

Event Timeline

Build has FAILED

Patch application report for D3980 (id=14035)

Rebasing onto 9d64e2f8c1...

Current branch diff-target is up to date.
Changes applied before test
commit 1b1e63b9041101ae54f9a5732ea8da3d3f4a831e
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Sep 17 19:47:54 2020 +0200

    deposit.api: Add types to main api

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

Update and fix remaining tests

Build is green

Patch application report for D3980 (id=14037)

Rebasing onto 9eef9228d6...

Current branch diff-target is up to date.
Changes applied before test
commit abe7d4442d82e7b60c0f1b9e64232b055c0914ba
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Sep 17 19:47:54 2020 +0200

    deposit.api: Add types to main api

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

ardumont edited the test plan for this revision. (Show Details)
ardumont added a project: SWORD deposit.
ardumont edited the test plan for this revision. (Show Details)

Add more types when possible

Build is green

Patch application report for D3980 (id=14039)

Rebasing onto 9eef9228d6...

Current branch diff-target is up to date.
Changes applied before test
commit 027169a72bcc125e758b26d8e0518bc7387fd11b
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Sep 17 19:47:54 2020 +0200

    deposit.api: Add types

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

ardumont added inline comments.
swh/deposit/api/common.py
759–761

otherwise cryptic message: error: Cannot determine type of 'objects'

anlambert added a subscriber: anlambert.

Nice typing party ;-)

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

Nice typing party ;-)

yeah, so it becomes nicer to get (back) into it ;)
And thanks for the review \o/

This revision was automatically updated to reflect the committed changes.