[ADD] poetry_update.py: dry option to execute without result
Signed-off-by: Mathieu Benoit <mathben@technolibre.ca>
This commit is contained in:
parent
02043d9467
commit
e919a2725c
1 changed files with 14 additions and 7 deletions
|
|
@ -54,6 +54,11 @@ def get_config():
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="More information in execution, show stats.",
|
help="More information in execution, show stats.",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--dry",
|
||||||
|
action="store_true",
|
||||||
|
help="Don't apply change, only show warning.",
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
@ -349,15 +354,17 @@ def main():
|
||||||
# repo = Repo(root_path)
|
# repo = Repo(root_path)
|
||||||
# lst_repo = get_all_repo()
|
# lst_repo = get_all_repo()
|
||||||
config = get_config()
|
config = get_config()
|
||||||
pyproject_toml_filename = f"{config.dir}pyproject.toml"
|
|
||||||
|
|
||||||
delete_dependency_poetry(pyproject_toml_filename)
|
if not config.dry:
|
||||||
|
pyproject_toml_filename = f"{config.dir}pyproject.toml"
|
||||||
|
delete_dependency_poetry(pyproject_toml_filename)
|
||||||
combine_requirements(config)
|
combine_requirements(config)
|
||||||
if config.force and os.path.isfile("./poetry.lock"):
|
if not config.dry:
|
||||||
os.remove("./poetry.lock")
|
if config.force and os.path.isfile("./poetry.lock"):
|
||||||
status = call_poetry_add_build_dependency()
|
os.remove("./poetry.lock")
|
||||||
if status:
|
status = call_poetry_add_build_dependency()
|
||||||
sorted_dependency_poetry(pyproject_toml_filename)
|
if status:
|
||||||
|
sorted_dependency_poetry(pyproject_toml_filename)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue