Skip to content

Commit

Permalink
Feature/project conf version fix (#149)
Browse files Browse the repository at this point in the history
* fix: Exit `check_req` if `core_requirements` is None (#137)

Otherwise the following statement crashes.

---

Steps to reproduce:
1. Install viur-core as editable
2. deploy app

* added version string failsafe

---------

Co-authored-by: Sven Eberth <[email protected]>
  • Loading branch information
Grashalmbeisser and sveneberth authored May 7, 2024
1 parent 5f58658 commit 90f1a4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/viur_cli/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,15 @@ def migrate(self):
self.find_key(self, target_key="application_name", target="default", keep=True)
if "application_name" in self:
del self["application_name"]


if "version" not in self["default"]:
self.find_key(self, target_key="version", target="default", keep=True)
# Fail Safe
if "version" in self:
del self["version"]

self.remove_key(self, target_key="core")


if old_format := self["default"].get("format"):
self["format"] = old_format
del self["default"]["format"]
Expand Down
1 change: 1 addition & 0 deletions src/viur_cli/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def check_req(projects_requirements_path):

if not core_requirements:
echo_error("could now find core package, please update the core to validate the requirements.txt")
return

core_requirements_obj = utils.requirements_to_dict(parse_requirements(core_requirements, session=PipSession()))

Expand Down

0 comments on commit 90f1a4f

Please sign in to comment.