aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author苏向夜 <fu050409@163.com>2024-03-12 13:38:26 +0800
committer苏向夜 <fu050409@163.com>2024-03-12 13:38:26 +0800
commitedf49c40a9fff72cfc46cf1036eea3790086fdea (patch)
tree4b505a8bdd0d186bc8466046da1715515fb6ac24 /src
parent53f8d97347a2fa8c1b714abaf08ae9749bd86d81 (diff)
downloadipm-edf49c40a9fff72cfc46cf1036eea3790086fdea.tar.gz
ipm-edf49c40a9fff72cfc46cf1036eea3790086fdea.zip
feat(project): add distribution check
Diffstat (limited to 'src')
-rw-r--r--src/ipm/project/toml_file.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/ipm/project/toml_file.py b/src/ipm/project/toml_file.py
index 510a75e..fdf7cfd 100644
--- a/src/ipm/project/toml_file.py
+++ b/src/ipm/project/toml_file.py
@@ -17,8 +17,6 @@ def init_infini(
author_name: str,
author_email: str,
license: str,
- webpage: str,
- unzip: str|int,
entry_file: str,
default_entries: List[str],
) -> None:
@@ -33,8 +31,6 @@ def init_infini(
author.multiline(True)
project.add("authors", author)
project.add("license", license)
- project.add("webpage", webpage)
- project.add("unzip", unzip)
toml_data.add("project", project)
toml_data.add("requirements", tomlkit.table())
toml_data.add("dependencies", tomlkit.table())
@@ -115,9 +111,8 @@ def init_pyproject(
description: str,
author_name: str,
author_email: str,
- webpage: str,
- unzip: int|str,
license: str,
+ standalone: bool,
):
toml_file = target_path.joinpath("pyproject.toml").open("w", encoding="utf-8")
toml_data = tomlkit.document()
@@ -132,15 +127,14 @@ def init_pyproject(
license_table = tomlkit.inline_table()
license_table.update({"text": license})
project.add("license", license_table)
- project.add("webpage", webpage)
- project.add("unzip", unzip)
- project.add("dependencies", tomlkit.array('["infini"]'))
+ project.add("dependencies", tomlkit.array('["infini>2.1.0"]'))
project.add("requires-python", ">=3.8")
project.add("readme", "README.md")
tool = tomlkit.table(True)
pdm = tomlkit.table(True)
- pdm.add("distribution", True)
+ if standalone:
+ pdm.add("distribution", True)
dev_dependencies = tomlkit.table()
dev_dependencies.add("dev", tomlkit.array('["pytest"]'))
pdm.append("dev-dependencies", dev_dependencies)