semtag 0.1.2__tar.gz → 0.2.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.
- semtag-0.2.0/.github/workflows/publish.yml +49 -0
- {semtag-0.1.2 → semtag-0.2.0}/.gitignore +3 -0
- {semtag-0.1.2 → semtag-0.2.0}/PKG-INFO +4 -3
- {semtag-0.1.2 → semtag-0.2.0}/README.md +3 -2
- {semtag-0.1.2 → semtag-0.2.0}/semtag.egg-info/PKG-INFO +4 -3
- {semtag-0.1.2 → semtag-0.2.0}/semtag.egg-info/SOURCES.txt +0 -2
- {semtag-0.1.2 → semtag-0.2.0}/semtag.py +14 -8
- semtag-0.1.2/.ansible/.lock +0 -0
- semtag-0.1.2/.github/workflows/publish.yml +0 -41
- semtag-0.1.2/.github/workflows/release.yml +0 -40
- {semtag-0.1.2 → semtag-0.2.0}/LICENSE +0 -0
- {semtag-0.1.2 → semtag-0.2.0}/SemanticVersion.py +0 -0
- {semtag-0.1.2 → semtag-0.2.0}/pyproject.toml +0 -0
- {semtag-0.1.2 → semtag-0.2.0}/requirements.txt +0 -0
- {semtag-0.1.2 → semtag-0.2.0}/semtag.egg-info/dependency_links.txt +0 -0
- {semtag-0.1.2 → semtag-0.2.0}/semtag.egg-info/entry_points.txt +0 -0
- {semtag-0.1.2 → semtag-0.2.0}/semtag.egg-info/requires.txt +0 -0
- {semtag-0.1.2 → semtag-0.2.0}/semtag.egg-info/top_level.txt +0 -0
- {semtag-0.1.2 → semtag-0.2.0}/setup.cfg +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
- '[0-9]+.[0-9]+.[0-9]+'
|
|
8
|
+
- '[0-9]+.[0-9]+.[0-9]+-*'
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build-and-publish:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write # Required for creating GitHub releases
|
|
15
|
+
id-token: write # Required for trusted publishing
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0 # Required for setuptools_scm to get git history
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: '3.x'
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install --upgrade pip
|
|
31
|
+
pip install build twine
|
|
32
|
+
|
|
33
|
+
- name: Build package
|
|
34
|
+
run: python -m build
|
|
35
|
+
|
|
36
|
+
- name: Check package
|
|
37
|
+
run: twine check dist/*
|
|
38
|
+
|
|
39
|
+
# Use the official PyPI publish action
|
|
40
|
+
- name: Publish to PyPI
|
|
41
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
42
|
+
|
|
43
|
+
# GH Release
|
|
44
|
+
- name: Create GitHub Release
|
|
45
|
+
uses: softprops/action-gh-release@v1
|
|
46
|
+
with:
|
|
47
|
+
generate_release_notes: true
|
|
48
|
+
files: |
|
|
49
|
+
dist/*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: semtag
|
|
3
|
-
Version: 0.
|
|
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
|
|
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
|
|
47
|
+
- `-v, --verbose` - Increase verbosity (use -v or -vv for more detail (INFO,DEBUG))
|
|
47
48
|
|
|
48
49
|
### Examples
|
|
49
50
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Semantic Version GIT Tagger
|
|
2
2
|
|
|
3
|
-
A pretty trivial python script to
|
|
3
|
+
A pretty trivial python script to easily manage git tags with semantic versioning (semver.org)
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -16,9 +16,10 @@ semtag [options]
|
|
|
16
16
|
- `-b, --by` - Increment by a specific number (default: 1)
|
|
17
17
|
- `-l, --label` - Add label to the version (e.g., -l rc1 creates 1.0.0-rc1)
|
|
18
18
|
- `-u, --push` - Push the new tag to remote repository
|
|
19
|
+
- `-U, --pushall` - Push all local tags to remote repository
|
|
19
20
|
- `-n, --nofetch` - Do not fetch tags from remote prior creating new one
|
|
20
21
|
<!-- - `-f, --force` - Force operation even if not on main/master branch -->
|
|
21
|
-
- `-v, --verbose` - Increase verbosity (use -v
|
|
22
|
+
- `-v, --verbose` - Increase verbosity (use -v or -vv for more detail (INFO,DEBUG))
|
|
22
23
|
|
|
23
24
|
### Examples
|
|
24
25
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: semtag
|
|
3
|
-
Version: 0.
|
|
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
|
|
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
|
|
47
|
+
- `-v, --verbose` - Increase verbosity (use -v or -vv for more detail (INFO,DEBUG))
|
|
47
48
|
|
|
48
49
|
### Examples
|
|
49
50
|
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
138
|
-
logger.
|
|
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:
|
semtag-0.1.2/.ansible/.lock
DELETED
|
File without changes
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
name: Publish to PyPI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*'
|
|
7
|
-
- '[0-9]+.[0-9]+.[0-9]+'
|
|
8
|
-
- '[0-9]+.[0-9]+.[0-9]+-*'
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build-and-publish:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
permissions:
|
|
14
|
-
contents: read
|
|
15
|
-
id-token: write # Required for trusted publishing
|
|
16
|
-
|
|
17
|
-
steps:
|
|
18
|
-
- name: Checkout code
|
|
19
|
-
uses: actions/checkout@v4
|
|
20
|
-
with:
|
|
21
|
-
fetch-depth: 0 # Required for setuptools_scm to get git history
|
|
22
|
-
|
|
23
|
-
- name: Set up Python
|
|
24
|
-
uses: actions/setup-python@v5
|
|
25
|
-
with:
|
|
26
|
-
python-version: '3.x'
|
|
27
|
-
|
|
28
|
-
- name: Install dependencies
|
|
29
|
-
run: |
|
|
30
|
-
python -m pip install --upgrade pip
|
|
31
|
-
pip install build twine
|
|
32
|
-
|
|
33
|
-
- name: Build package
|
|
34
|
-
run: python -m build
|
|
35
|
-
|
|
36
|
-
- name: Check package
|
|
37
|
-
run: twine check dist/*
|
|
38
|
-
|
|
39
|
-
# Use the official PyPI publish action
|
|
40
|
-
- name: Publish to PyPI
|
|
41
|
-
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
name: Create GitHub Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*'
|
|
7
|
-
- '[0-9]+.[0-9]+.[0-9]+'
|
|
8
|
-
- '[0-9]+.[0-9]+.[0-9]+-*'
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
release:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
permissions:
|
|
14
|
-
contents: write # Required for creating GitHub releases
|
|
15
|
-
|
|
16
|
-
steps:
|
|
17
|
-
- name: Checkout code
|
|
18
|
-
uses: actions/checkout@v4
|
|
19
|
-
with:
|
|
20
|
-
fetch-depth: 0
|
|
21
|
-
|
|
22
|
-
- name: Set up Python
|
|
23
|
-
uses: actions/setup-python@v5
|
|
24
|
-
with:
|
|
25
|
-
python-version: '3.x'
|
|
26
|
-
|
|
27
|
-
- name: Install dependencies
|
|
28
|
-
run: |
|
|
29
|
-
python -m pip install --upgrade pip
|
|
30
|
-
pip install build
|
|
31
|
-
|
|
32
|
-
- name: Build package
|
|
33
|
-
run: python -m build
|
|
34
|
-
|
|
35
|
-
- name: Create GitHub Release
|
|
36
|
-
uses: softprops/action-gh-release@v1
|
|
37
|
-
with:
|
|
38
|
-
generate_release_notes: true
|
|
39
|
-
files: |
|
|
40
|
-
dist/*
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|