File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
continuous_delivery_scripts Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -23,4 +23,4 @@ pre-commit = "*"
2323allow_prereleases = true
2424
2525[packages ]
26- continuous-delivery-scripts = {path = " ." }
26+ continuous-delivery-scripts = {editable = true , path = " ." }
Original file line number Diff line number Diff line change 1111import subprocess
1212from auto_version import auto_version_tool
1313from continuous_delivery_scripts .utils .definitions import CommitType
14+ from continuous_delivery_scripts .utils .git_helpers import LocalProjectRepository
1415from continuous_delivery_scripts .utils .configuration import configuration , ConfigurationVariable
1516from continuous_delivery_scripts .utils .logging import log_exception , set_log_level
1617from continuous_delivery_scripts .utils .filesystem_helpers import cd
@@ -85,12 +86,17 @@ def _update_version_string(
8586 version_elements: version elements
8687 """
8788 if commit_type == CommitType .DEVELOPMENT :
88- return "%s-%s+%s" % (
89+ commit_count = version_elements .get (auto_version_tool .Constants .COMMIT_COUNT_FIELD )
90+ if not commit_count :
91+ with LocalProjectRepository () as git :
92+ commit_count = git .get_commit_count ()
93+ return "%s-%s.%s+%s" % (
8994 new_version ,
9095 auto_version_tool .config .BUILD_TOKEN ,
96+ commit_count ,
9197 version_elements .get (auto_version_tool .Constants .COMMIT_FIELD ),
9298 )
93- return new_version
99+ return new_version
94100
95101
96102def _get_version_elements (native_version_elements : Dict [str , str ]) -> Dict [str , str ]:
Original file line number Diff line number Diff line change 1+ Fix development versions so that they can be used by any package managers i.e. pip and npm
You can’t perform that action at this time.
0 commit comments