Skip to content

Commit

Permalink
Restore setup.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
jinningwang committed Sep 2, 2024
1 parent 69ceade commit d06e235
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions genconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,24 @@ def write_req():
print("Requirements files generated successfully.")


def write_cfg():
"""
Write versioneer configuration from pyproject.toml to setup.cfg.
"""
with open('pyproject.toml', 'r') as f:
pyproject = toml.load(f)

versioneer = pyproject['tool']['versioneer']

with open('setup.cfg', 'w') as f:
f.write(comment)
f.write("[versioneer]\n")
for key, value in versioneer.items():
f.write(f"{key} = {value}\n")

print("Versioneer configuration generated successfully.")


if __name__ == "__main__":
write_req()
write_cfg()
7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Generated on 2024-09-02.
[versioneer]
VCS = git
style = pep440-post
versionfile_source = ams/_version.py
versionfile_build = ams/_version.py
tag_prefix = v

0 comments on commit d06e235

Please sign in to comment.