Add optional dependecy

This commit is contained in:
shenjack 2023-11-25 03:33:48 +08:00
parent de5440adeb
commit 54bed5b64c
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 8 additions and 4 deletions

View File

@ -45,6 +45,9 @@ build-backend = "setuptools.build_meta"
#lib_not_dr = "lib_not_dr"
#lndl_nuitka = "lndl_nuitka"
[project.optional-dependencies]
toml = ["tomli >= 2.0.1"]
[tool.setuptools.dynamic]
version = { attr = "lib_not_dr.__version__"}

View File

@ -64,7 +64,8 @@ def get_toml_reader():
return toml_loads
except ImportError:
continue
error_msg = """No toml reader found, please install any below by pip:\n%s
error_msg = """No toml reader found, please install any below by pip:
%s
or use Python 3.11+""" % " ".join(
TOML_READERS
)
@ -100,15 +101,15 @@ def gen_subprocess_args(nuitka_config: dict) -> list:
for name, value in nuitka_config.items():
if value is True:
# --<name>
cmd_list.append("--%s" % name)
cmd_list.append(f"--{name}")
continue
elif isinstance(value, str):
# --<name>=<value>
cmd_list.append("--%s=%s" % (name, value))
cmd_list.append(f"--{name}={value}")
continue
elif isinstance(value, Iterable):
# --<name>=<value1>,<value2>,...
cmd_list.append("--%s=%s" % (name, ",".join(value)))
cmd_list.append(f"--{name}={','.join(value)}")
continue
return cmd_list