Skip to content
Snippets Groups Projects
Commit 4c131762 authored by Mayr, Hannes's avatar Mayr, Hannes
Browse files

Add version number to required_imports.txt

parent f99bce96
No related branches found
No related tags found
2 merge requests!65Release v0.3.0,!64New year developments
Pipeline #888485 failed
......@@ -13,6 +13,7 @@ import os
import shutil
import sys
import warnings
from importlib.metadata import version
from typing import TypedDict, Any
from plotid.save_plot import save_plot
from plotid.plotoptions import PlotIDTransfer, validate_list
......@@ -134,8 +135,7 @@ class PublishOptions:
" – plot has already been published."
)
overwrite_dir = input(
"Do you want to overwrite "
"the existing folder? "
"Do you want to overwrite the existing folder? "
"(yes/no[default])\n"
)
if overwrite_dir in ("yes", "y", "Yes", "YES"):
......@@ -155,10 +155,8 @@ class PublishOptions:
os.rename(dst_path_invisible, dst_path)
except FileExistsError as exc:
delete_dir = input(
"There was an error while "
"publishing the data. Should the "
"partially copied data at "
f"{dst_path_invisible} be"
"There was an error while publishing the data. Should the "
f"partially copied data at {dst_path_invisible} be"
" removed? (yes/no[default])\n"
)
if delete_dir in ("yes", "y", "Yes", "YES"):
......@@ -287,7 +285,8 @@ class Analyzer(ast.NodeVisitor):
# Write every item of the set to one line.
with open(output_file, "w", encoding="utf-8") as output:
for item in imports_as_set:
output.write(f"{item}\n")
module_version = version(item)
output.write(f"{item}=={module_version}\n")
output.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment