Skip to content

Commit

Permalink
Fix issues in suggest command.
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Oct 23, 2020
1 parent 152a039 commit ce8e201
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions repo_helper/cli/commands/suggest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from datetime import datetime
from functools import partial
from itertools import chain
from pprint import pprint

# 3rd party
import click
Expand Down Expand Up @@ -95,7 +94,6 @@ def classifiers(add: bool) -> int:

rh = RepoHelper(PathPlus.cwd())
config = rh.templates.globals
pprint(config["classifiers"])

pkg_dir = rh.target_repo / config["import_name"]

Expand Down Expand Up @@ -153,7 +151,7 @@ def classifiers(add: bool) -> int:
suggested_classifiers.add("Topic :: Software Development :: Documentation")
suggested_classifiers.add("Intended Audience :: Developers")

click.echo("What is the Development Status of this project>?")
click.echo("What is the Development Status of this project?")
development_status = choice(text="Status", options=development_status_options, start_index=1)
status_string = f"Development Status :: {development_status + 1} - {development_status_options[development_status]}"
suggested_classifiers.add(status_string)
Expand Down Expand Up @@ -200,7 +198,8 @@ def classifiers(add: bool) -> int:
yaml.preserve_quotes = True # type: ignore

data = yaml.load((rh.target_repo / "repo_helper.yml").read_text())
data["classifiers"] = sorted({(*data["classifiers"], *suggested_classifiers)})
data["classifiers"] = sorted({*data.get("classifiers", ()), *suggested_classifiers})
print(data["classifiers"])

with (rh.target_repo / "repo_helper.yml").open("w") as fp:
yaml.dump(data, fp)
Expand Down

0 comments on commit ce8e201

Please sign in to comment.