+import toml
from setuptools import setup
if __name__ == "__main__":
- setup()
+ with open("pyproject.toml", "r", encoding="UTF-8") as stream:
+ pyproject = toml.load(stream)
+ arguments = pyproject["project"]
+
+ arguments["packages"] = ["mdis"]
+ arguments["package_dir"] = {"": "src"}
+
+ authors = []
+ emails = []
+ for author in arguments.pop("authors"):
+ authors.append(author["name"])
+ emails.append(author["email"])
+ arguments["author"] = ", ".join(authors)
+ arguments["author_email"] = ", ".join(emails)
+
+ arguments.pop("urls")
+ arguments.pop("readme")
+ arguments.pop("requires-python")
+
+ setup(**pyproject["project"])