deepmodeling / DeePTB

DeePTB: A deep learning package for tight-binding approach with ab initio accuracy.
GNU Lesser General Public License v3.0
54 stars 16 forks source link

update(pyproject.toml): To allow write out a _version.py file that contrains the current version information #159

Closed floatingCatty closed 6 months ago

floatingCatty commented 6 months ago

This is achieved by the following method:

  1. modify format jinja: format-jinja = """ {%- if distance == 0 -%} {{ serialize_pep440(base, stage, revision) }} {%- elif revision is not none -%} {{ serialize_pep440(base, stage, revision + 1, dev=distance, metadata=[commit]) }} {%- else -%} {{ serialize_pep440(bump_version(base), stage, revision, dev=distance, metadata=[commit]) }} {%- endif -%} """ Which have 3 cases: 1. if the commit version is consistent with the tag, then use the tag 2. If the revision (小版本) is not 0, and commit have some history, then new version will be x.x.x+1+devxxxxxxxx. 3. if the revision is 0, them the stage 中版本,will increase by 1 and the dev string will be added.

  2. add [tool.poetry-dynamic-versioning.files.] tool to write out files _version.py [tool.poetry-dynamic-versioning.files."dptb/_version.py"] persistent-substitution = true initial-content = """

    These version placeholders will be replaced later during substitution.

    version = "0.0.0" __version_tuple__ = (0, 0, 0) """