semtag 0.1.3__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: semtag
3
- Version: 0.1.3
3
+ Version: 0.2.0
4
4
  Summary: A tool for managing semantic version tags in git repositories
5
5
  Author-email: Mateusz Mikrut <mateusz.mikrut@gmail.com>
6
6
  License-Expression: MIT
@@ -25,7 +25,7 @@ Dynamic: license-file
25
25
 
26
26
  # Semantic Version GIT Tagger
27
27
 
28
- A pretty trivial python script to easely manage git tags with semantic versioning (semver.org)
28
+ A pretty trivial python script to easily manage git tags with semantic versioning (semver.org)
29
29
 
30
30
  ## Usage
31
31
 
@@ -41,9 +41,10 @@ semtag [options]
41
41
  - `-b, --by` - Increment by a specific number (default: 1)
42
42
  - `-l, --label` - Add label to the version (e.g., -l rc1 creates 1.0.0-rc1)
43
43
  - `-u, --push` - Push the new tag to remote repository
44
+ - `-U, --pushall` - Push all local tags to remote repository
44
45
  - `-n, --nofetch` - Do not fetch tags from remote prior creating new one
45
46
  <!-- - `-f, --force` - Force operation even if not on main/master branch -->
46
- - `-v, --verbose` - Increase verbosity (use -v, -vv, or -vvv for more detail)
47
+ - `-v, --verbose` - Increase verbosity (use -v or -vv for more detail (INFO,DEBUG))
47
48
 
48
49
  ### Examples
49
50
 
@@ -0,0 +1,8 @@
1
+ SemanticVersion.py,sha256=twzdlvhigapvxv5b4dDNYUKtq4FGnga6MYeo5bnVfoA,2783
2
+ semtag.py,sha256=ILnDdP5nIhweVtoOGCzatCxaERasyljB5DGpoFXveW0,5947
3
+ semtag-0.2.0.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
4
+ semtag-0.2.0.dist-info/METADATA,sha256=VK87cpYvfop1VR8gJWGbpxn0h1VIhcnpVl8nWD-lTpA,2709
5
+ semtag-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ semtag-0.2.0.dist-info/entry_points.txt,sha256=vojSwqU_Ojr1MuLJE4gzbN4KDK-MObwL8VSNvpsaTGA,39
7
+ semtag-0.2.0.dist-info/top_level.txt,sha256=AfmWqKvB5cvvtynjVHYSYv0Qctx4XLUdhnChNRLiz1E,23
8
+ semtag-0.2.0.dist-info/RECORD,,
semtag.py CHANGED
@@ -39,6 +39,7 @@ Examples:
39
39
 
40
40
  parser.add_argument('-l', '--label', type=str, default=None, help='Add label to the version (e.g., -l rc1 creates 1.0.0-rc1)')
41
41
  parser.add_argument('-u', '--push', action='store_true', help='Push the new tag to remote repository', default=False)
42
+ parser.add_argument('-U', '--pushall', action='store_true', help='Push all local tags to remote repository', default=False)
42
43
  parser.add_argument('-n', '--no-fetch', action='store_true', help='Do not fetch tags from remote before operation', default=False)
43
44
  args = parser.parse_args()
44
45
 
@@ -73,7 +74,7 @@ Examples:
73
74
  exit(99)
74
75
 
75
76
  reponame = Path(repo.working_dir).name
76
- logger.debug(f"Repository name : {reponame}")
77
+ logger.info(f"Repository name : {reponame}")
77
78
 
78
79
  ## Check if on main/master branch (warning only)
79
80
  # try:
@@ -90,18 +91,19 @@ Examples:
90
91
  try:
91
92
  logger.debug("Fetching tags from remote...")
92
93
  repo.remotes.origin.fetch(tags=True)
93
- logger.debug("Tags fetched successfully")
94
+ logger.info("Tags fetched successfully")
94
95
  except Exception as e:
95
96
  logger.warning(f"Error fetching tags: {e}")
96
97
 
98
+ logger.debug(f"Tags in repository: {repo.tags}")
97
99
  tags = semsort([tag.name for tag in repo.tags])
98
-
100
+ logger.debug(f"Sorted semantic tags: {tags}")
99
101
  if tags:
100
102
  latest_tag = tags[0]
101
- logger.debug(f"Latest semantic version tag: {latest_tag}")
103
+ logger.info(f"Latest semantic version tag: {latest_tag}")
102
104
  else:
103
105
  # No tags found, start with 0.0.0
104
- logger.debug("No semantic version tags found. Starting with 0.0.0")
106
+ logger.info("No semantic version tags found. Starting with 0.0.0")
105
107
  latest_tag = '0.0.0'
106
108
 
107
109
  # Initialize obj
@@ -124,7 +126,7 @@ Examples:
124
126
  current_version.add_label(args.label)
125
127
 
126
128
  new_tag = str(current_version)
127
- logger.info(f"Generate tag: {new_tag}")
129
+ logger.debug(f"Generated new tag: {new_tag}")
128
130
 
129
131
  ### Create and push
130
132
  try:
@@ -134,8 +136,12 @@ Examples:
134
136
  logger.info(f"Successfully created tag: {new_tag}")
135
137
 
136
138
  # Push if requested
137
- if args.push:
138
- logger.info(f"Pushing tag '{new_tag}' to remote...")
139
+ if args.pushall:
140
+ logger.debug("Pushing all local tags to remote...")
141
+ repo.remote('origin').push(tags=True)
142
+ logger.info("Successfully pushed all tags to remote")
143
+ elif args.push:
144
+ logger.debug(f"Pushing tag '{new_tag}' to remote...")
139
145
  repo.remote('origin').push(new_tag) # It only pushes the new tag not all from local repo
140
146
  logger.info(f"Successfully pushed new tag: {new_tag}")
141
147
  else:
@@ -1,8 +0,0 @@
1
- SemanticVersion.py,sha256=twzdlvhigapvxv5b4dDNYUKtq4FGnga6MYeo5bnVfoA,2783
2
- semtag.py,sha256=9pr2pPB_WKUs1NBe5mKm2hDmFSwLJxY3xrCJvU3fDLA,5537
3
- semtag-0.1.3.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
4
- semtag-0.1.3.dist-info/METADATA,sha256=p8De-KzqAuxPoBnlqAfuW1dD4TkOmdl9pocPikm_VKc,2642
5
- semtag-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- semtag-0.1.3.dist-info/entry_points.txt,sha256=vojSwqU_Ojr1MuLJE4gzbN4KDK-MObwL8VSNvpsaTGA,39
7
- semtag-0.1.3.dist-info/top_level.txt,sha256=AfmWqKvB5cvvtynjVHYSYv0Qctx4XLUdhnChNRLiz1E,23
8
- semtag-0.1.3.dist-info/RECORD,,
File without changes