Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Commit

Permalink
Hotfix 2.1/#530 - Rename --force to --taipy-force (#542)
Browse files Browse the repository at this point in the history
* fix: rename --force to --taipy-force
  • Loading branch information
trgiangdo authored Apr 6, 2023
1 parent baee7d0 commit d0ea634
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
5 changes: 2 additions & 3 deletions src/taipy/core/_version/_version_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ def _create_parser(cls):
)

core_parser.add_argument(
"--force",
"-f",
"--taipy-force",
action="store_true",
help="Force override the configuration of the version if existed. Default to False.",
)
Expand Down Expand Up @@ -153,4 +152,4 @@ def _parse_arguments(cls):
version_number = args.production
mode = "production"

return mode, version_number, args.force, args.clean_entities
return mode, version_number, args.taipy_force, args.clean_entities
2 changes: 1 addition & 1 deletion src/taipy/core/exceptions/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def __init__(self, config_diff):

message += "\n"

message += "To override these changes, run your application with --force option."
message += "To override these changes, run your application with --taipy-force option."

self.message = message

Expand Down
2 changes: 1 addition & 1 deletion src/taipy/core/version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"major": 2, "minor": 1, "patch": 3}
{"major": 2, "minor": 1, "patch": 4}
14 changes: 7 additions & 7 deletions tests/core/version/test_version_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_version_cli_return_value():
assert not force
assert not clean_entities

with patch("sys.argv", ["prog", "--experiment", "2.1", "--force"]):
with patch("sys.argv", ["prog", "--experiment", "2.1", "--taipy-force"]):
mode, version_number, force, clean_entities = _VersioningCLI._parse_arguments()
assert mode == "experiment"
assert version_number == "2.1"
Expand Down Expand Up @@ -301,13 +301,13 @@ def test_force_override_experiment_version():
Config.unblock_update()
Config.configure_global_app(clean_entities_enabled=True)

# Without --force parameter, a SystemExit will be raised
# Without --taipy-force parameter, a SystemExit will be raised
with pytest.raises(SystemExit):
with patch("sys.argv", ["prog", "--experiment", "1.0"]):
Core().run()

# With --force parameter
with patch("sys.argv", ["prog", "--experiment", "1.0", "--force"]):
# With --taipy-force parameter
with patch("sys.argv", ["prog", "--experiment", "1.0", "--taipy-force"]):
Core().run()
ver_2 = _VersionManager._get_latest_version()
assert ver_2 == "1.0"
Expand Down Expand Up @@ -351,13 +351,13 @@ def test_force_override_production_version():
Config.unblock_update()
Config.configure_global_app(clean_entities_enabled=True)

# Without --force parameter, a SystemExit will be raised
# Without --taipy-force parameter, a SystemExit will be raised
with pytest.raises(SystemExit):
with patch("sys.argv", ["prog", "--production", "1.0"]):
Core().run()

# With --force parameter
with patch("sys.argv", ["prog", "--production", "1.0", "--force"]):
# With --taipy-force parameter
with patch("sys.argv", ["prog", "--production", "1.0", "--taipy-force"]):
Core().run()
ver_2 = _VersionManager._get_latest_version()
assert ver_2 == "1.0"
Expand Down

0 comments on commit d0ea634

Please sign in to comment.