Skip to content

Commit d234b66

Browse files
author
Kazuki Suzuki Przyborowski
committed
Added toml file
1 parent ee46d5f commit d234b66

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[project]
2+
name = "PyUPC-EAN"
3+
version = "2.20.0"
4+
readme = "README.md"
5+
license = { text = "BSD-3-Clause" }
6+
keywords = []
7+
description = "A barcode library/module for python."
8+
authors = [
9+
{ name = "Kazuki Przyborowski", email = "kazuki.przyborowski@gmail.com" },
10+
]
11+

setup.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,26 @@ def pillow_installed():
197197
verinfofile.write(verinfodata)
198198
verinfofile.close()
199199

200+
if(len(sys.argv) > 1 and (sys.argv[1] == "buildcfg" or sys.argv[1] == "makecfg")):
201+
outcfgvar = """[project]
202+
name = "{}"
203+
version = "{}"
204+
readme = "README.md"
205+
license = {{ text = "BSD-3-Clause" }}
206+
keywords = []
207+
description = "{}"
208+
authors = [
209+
{{ name = "{}", email = "{}" }},
210+
]
211+
""".format(pymodule['name'], pymodule['version'], pymodule['description'], pymodule['author'], pymodule['authoremail'])
212+
mytoml = open("./pyproject.toml", "w")
213+
mytoml.write(outcfgvar)
214+
mytoml.flush()
215+
if(hasattr(os, "sync")):
216+
os.fsync(mytoml.fileno())
217+
mytoml.close()
218+
sys.exit()
219+
200220
setup(
201221
name=pymodule['name'],
202222
version=pymodule['version'],

0 commit comments

Comments
 (0)