Skip to content

Commit e8b2836

Browse files
committed
Do not unnecessarily map unimplemented manifest fields to an OrderedDict instance
Signed-off-by: Ritiek Malhotra <[email protected]>
1 parent bc20482 commit e8b2836

File tree

6 files changed

+15
-23
lines changed

6 files changed

+15
-23
lines changed

src/packagedcode/cargo.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,6 @@ def build_package(package_data):
110110
if description:
111111
description = description.strip()
112112

113-
# TODO: Remove this ordered_dict_map once cargo.py is able to handle
114-
# the appropriate data (source_packages, dependencies, etc..)
115-
# At the moment, this is only useful for making tests pass
116-
ordered_dict_map = {}
117-
for key in ('source_packages', 'dependencies', 'keywords'):
118-
ordered_dict_map[key] = OrderedDict()
119-
120113
authors = core_package_data.get('authors')
121114
parties = list(party_mapper(authors, party_role='author'))
122115

@@ -125,7 +118,6 @@ def build_package(package_data):
125118
version=version,
126119
description=description,
127120
parties=parties,
128-
**ordererd_dict_map,
129121
)
130122

131123
return package

tests/packagedcode/data/cargo/clap/Cargo.toml.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"url": null
1818
}
1919
],
20-
"keywords": {},
20+
"keywords": [],
2121
"homepage_url": null,
2222
"download_url": null,
2323
"size": null,
@@ -33,9 +33,9 @@
3333
"declared_license": null,
3434
"notice_text": null,
3535
"manifest_path": null,
36-
"dependencies": {},
36+
"dependencies": [],
3737
"contains_source_code": null,
38-
"source_packages": {},
38+
"source_packages": [],
3939
"purl": "pkg:cargo/[email protected]",
4040
"repository_homepage_url": "https://crates.io/crates/clap",
4141
"repository_download_url": "https://crates.io/api/v1/crates/clap/2.32.0/download",

tests/packagedcode/data/cargo/clippy/Cargo.toml.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"url": null
4646
}
4747
],
48-
"keywords": {},
48+
"keywords": [],
4949
"homepage_url": null,
5050
"download_url": null,
5151
"size": null,
@@ -61,9 +61,9 @@
6161
"declared_license": null,
6262
"notice_text": null,
6363
"manifest_path": null,
64-
"dependencies": {},
64+
"dependencies": [],
6565
"contains_source_code": null,
66-
"source_packages": {},
66+
"source_packages": [],
6767
"purl": "pkg:cargo/[email protected]",
6868
"repository_homepage_url": "https://crates.io/crates/clippy",
6969
"repository_download_url": "https://crates.io/api/v1/crates/clippy/0.0.212/download",

tests/packagedcode/data/cargo/mdbook/Cargo.toml.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"url": null
3232
}
3333
],
34-
"keywords": {},
34+
"keywords": [],
3535
"homepage_url": null,
3636
"download_url": null,
3737
"size": null,
@@ -47,9 +47,9 @@
4747
"declared_license": null,
4848
"notice_text": null,
4949
"manifest_path": null,
50-
"dependencies": {},
50+
"dependencies": [],
5151
"contains_source_code": null,
52-
"source_packages": {},
52+
"source_packages": [],
5353
"purl": "pkg:cargo/[email protected]",
5454
"repository_homepage_url": "https://crates.io/crates/mdbook",
5555
"repository_download_url": "https://crates.io/api/v1/crates/mdbook/0.2.4-alpha.0/download",

tests/packagedcode/data/cargo/rustfmt/Cargo.toml.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"url": null
2525
}
2626
],
27-
"keywords": {},
27+
"keywords": [],
2828
"homepage_url": null,
2929
"download_url": null,
3030
"size": null,
@@ -40,9 +40,9 @@
4040
"declared_license": null,
4141
"notice_text": null,
4242
"manifest_path": null,
43-
"dependencies": {},
43+
"dependencies": [],
4444
"contains_source_code": null,
45-
"source_packages": {},
45+
"source_packages": [],
4646
"purl": "pkg:cargo/[email protected]",
4747
"repository_homepage_url": "https://crates.io/crates/rustfmt-nightly",
4848
"repository_download_url": "https://crates.io/api/v1/crates/rustfmt-nightly/1.0.3/download",

tests/packagedcode/data/cargo/rustup/Cargo.toml.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"url": null
1818
}
1919
],
20-
"keywords": {},
20+
"keywords": [],
2121
"homepage_url": null,
2222
"download_url": null,
2323
"size": null,
@@ -33,9 +33,9 @@
3333
"declared_license": null,
3434
"notice_text": null,
3535
"manifest_path": null,
36-
"dependencies": {},
36+
"dependencies": [],
3737
"contains_source_code": null,
38-
"source_packages": {},
38+
"source_packages": [],
3939
"purl": "pkg:cargo/[email protected]",
4040
"repository_homepage_url": "https://crates.io/crates/rustup",
4141
"repository_download_url": "https://crates.io/api/v1/crates/rustup/1.17.0/download",

0 commit comments

Comments
 (0)