Skip to content

Commit

Permalink
Use default toml file for those without poetry item
Browse files Browse the repository at this point in the history
  • Loading branch information
waketzheng committed Jul 11, 2024
1 parent fd00c4d commit e30bb07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fast_dev_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,13 @@ def parse_filename() -> str:
continue
return line.split('path = "', 1)[-1].split('"')[0]
context = tomllib.loads(toml_text)
if (poetry_item := context["tool"]["poetry"])["version"] == "0":
try:
version_value = context["tool"]["poetry"]["version"]
except KeyError:
return TOML_FILE
if version_value == "0":
try:
package_item = poetry_item["packages"]
package_item = context["tool"]["poetry"]["packages"]
except KeyError:
packages = []
else:
Expand Down

0 comments on commit e30bb07

Please sign in to comment.