pycommonlog 0.0.0__tar.gz → 0.1.0__tar.gz

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: pycommonlog
3
- Version: 0.0.0
3
+ Version: 0.1.0
4
4
  Summary: Unified logging and alerting library for Python.
5
5
  Home-page: https://github.com/alvianhanif/pycommonlog
6
6
  Author: Alvian Rahman Hanif
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycommonlog
3
- Version: 0.0.0
3
+ Version: 0.1.0
4
4
  Summary: Unified logging and alerting library for Python.
5
5
  Home-page: https://github.com/alvianhanif/pycommonlog
6
6
  Author: Alvian Rahman Hanif
@@ -1,17 +1,25 @@
1
1
  from setuptools import setup, find_packages
2
2
  import subprocess
3
+ import os
3
4
 
4
5
  def get_latest_git_tag():
5
- try:
6
- tag = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]).decode().strip()
7
- # Clean up invalid version formats
8
- if '-v' in tag:
9
- # Extract base version from tags like 0.1.7-v24
10
- base_version = tag.split('-v')[0]
11
- return base_version
12
- return tag
13
- except Exception:
14
- return "0.0.0"
6
+ # In GitHub Actions, use GITHUB_REF for release tags
7
+ if 'GITHUB_REF' in os.environ and os.environ['GITHUB_REF'].startswith('refs/tags/'):
8
+ tag = os.environ['GITHUB_REF'].replace('refs/tags/', '')
9
+ else:
10
+ try:
11
+ tag = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]).decode().strip()
12
+ except Exception:
13
+ return "0.0.0"
14
+
15
+ # Clean up invalid version formats
16
+ if tag.startswith('v'):
17
+ tag = tag[1:] # Remove leading 'v'
18
+ if '-v' in tag:
19
+ # Extract base version from tags like 0.1.7-v24
20
+ base_version = tag.split('-v')[0]
21
+ return base_version
22
+ return tag
15
23
 
16
24
  setup(
17
25
  name="pycommonlog",
File without changes
File without changes
File without changes