File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ def parse(root):
9090
9191 [setuptools_scm.local_scheme]
9292 node-and-date = setuptools_scm.version:get_local_node_and_date
93+ node-and-timestamp = \
94+ setuptools_scm.version:get_local_node_and_timestamp
9395 dirty-tag = setuptools_scm.version:get_local_dirty_tag
9496 """ ,
9597 classifiers = [
Original file line number Diff line number Diff line change @@ -144,6 +144,20 @@ def get_local_node_and_date(version):
144144 return version .format_choice ("+{node}" , "+{node}.d{time:%Y%m%d}" )
145145
146146
147+ def get_local_node_and_timestamp (version , fmt = '%Y%m%d%H%M%S' ):
148+ if version .exact or version .node is None :
149+ return version .format_choice ("" ,
150+ "+d{time:"
151+ + "{fmt}" .format (fmt = fmt )
152+ + "}" )
153+ else :
154+ return version .format_choice ("+{node}" ,
155+ "+{node}"
156+ + ".d{time:"
157+ + "{fmt}" .format (fmt = fmt )
158+ + "}" )
159+
160+
147161def get_local_dirty_tag (version ):
148162 return version .format_choice ('' , '+dirty' )
149163
You can’t perform that action at this time.
0 commit comments