Skip to content

Commit 0235306

Browse files
author
notactuallyfinn
committed
fixed bugs, created more tests and switched to flake8 for linting
1 parent d41556e commit 0235306

File tree

4 files changed

+181
-143
lines changed

4 files changed

+181
-143
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-complexity = 15
3+
max-line-length = 120

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ src/hermes_toml/util/__pycache__/
1111
__pycache__/
1212
.hermes/
1313
.coverage
14-
.flake8

src/hermes_toml/harvest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class TomlHarvestPlugin(HermesHarvestPlugin):
3838
},
3939
"poetry": {
4040
"name": "schema:name", "version": "schema:version", "description": "schema:description",
41-
"keywords": "schema:keywords", "repository": "schema:CodeRepository"
41+
"keywords": "schema:keywords", "repository": "schema:codeRepository"
4242
},
4343
"flit": {
4444
"keywords": "schema:keywords", "dist-name": "schema:name",
@@ -375,6 +375,10 @@ def handle_pypi_classifieres(cls, classifiers: str | list[str], data):
375375
return
376376
if isinstance(classifiers, str):
377377
classifiers = [classifiers]
378+
else:
379+
classifiers = [classifier for classifier in classifiers if isinstance(classifier, str)]
380+
if len(classifiers) == 0:
381+
return
378382

379383
# remove duplicates
380384
classifiers = list(set(classifiers))
@@ -385,8 +389,6 @@ def handle_pypi_classifieres(cls, classifiers: str | list[str], data):
385389
}
386390
# iterate over all classifiers and put them into the correct buckets
387391
for classifier in classifiers:
388-
if not isinstance(classifier, str):
389-
continue
390392
classifier = classifier.split(" :: ")
391393
if len(classifier) < 2:
392394
continue

0 commit comments

Comments
 (0)