tinysemver 2.0.5__tar.gz → 2.0.7__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.1
2
2
  Name: tinysemver
3
- Version: 2.0.5
3
+ Version: 2.0.7
4
4
  Summary: Tiny Semantic Versioning (SemVer) library, that doesn't depend on 300K lines of JavaScript
5
5
  Author-email: Ash Vardanian <1983160+ashvardanian@users.noreply.github.com>, Guillaume de Rouville <31691250+grouville@users.noreply.github.com>
6
6
  License: Apache License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tinysemver"
7
- version = "2.0.5"
7
+ version = "2.0.7"
8
8
  description = "Tiny Semantic Versioning (SemVer) library, that doesn't depend on 300K lines of JavaScript"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -27,7 +27,7 @@ classifiers = [
27
27
  ]
28
28
 
29
29
  [project.scripts]
30
- tinysemver = "tinysemver:main"
30
+ tinysemver = "tinysemver.tinysemver:main"
31
31
 
32
32
  [project.urls]
33
33
  Homepage = "https://pypi.org/project/tinysemver/"
@@ -56,6 +56,12 @@ BumpType = Literal["major", "minor", "patch"]
56
56
  PathLike = Union[str, os.PathLike]
57
57
 
58
58
 
59
+ class NoNewCommitsError(Exception):
60
+ """Raised when no new commits are found since the last tag."""
61
+
62
+ pass
63
+
64
+
59
65
  def get_last_tag(repository_path: PathLike) -> str:
60
66
  """Retrieve the last Git tag name from the repository."""
61
67
  result = subprocess.run(
@@ -403,7 +409,8 @@ def bump(
403
409
  print(f"Current version: {current_version[0]}.{current_version[1]}.{current_version[2]}")
404
410
 
405
411
  commits_hashes, commits_messages = get_commits_since_tag(repository_path, last_tag)
406
- assert len(commits_hashes), f"No new commits since the last {last_tag} tag, aborting."
412
+ if not len(commits_hashes):
413
+ raise NoNewCommitsError(f"No new commits since the last {last_tag} tag")
407
414
 
408
415
  if verbose:
409
416
  print(f"? Commits since last tag: {len(commits_hashes)}")
@@ -653,6 +660,9 @@ def main():
653
660
  push=args.push,
654
661
  create_release=args.create_release,
655
662
  )
663
+ except NoNewCommitsError as e:
664
+ print(f"! {e}")
665
+ exit(0)
656
666
  except AssertionError as e:
657
667
  print(f"! {e}")
658
668
  exit(1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinysemver
3
- Version: 2.0.5
3
+ Version: 2.0.7
4
4
  Summary: Tiny Semantic Versioning (SemVer) library, that doesn't depend on 300K lines of JavaScript
5
5
  Author-email: Ash Vardanian <1983160+ashvardanian@users.noreply.github.com>, Guillaume de Rouville <31691250+grouville@users.noreply.github.com>
6
6
  License: Apache License
@@ -1,9 +1,10 @@
1
1
  LICENSE
2
- MANIFEST.in
3
2
  README.md
4
- __init__.py
5
3
  pyproject.toml
6
- tinysemver.py
4
+ ./tinysemver/__init__.py
5
+ ./tinysemver/tinysemver.py
6
+ tinysemver/__init__.py
7
+ tinysemver/tinysemver.py
7
8
  tinysemver.egg-info/PKG-INFO
8
9
  tinysemver.egg-info/SOURCES.txt
9
10
  tinysemver.egg-info/dependency_links.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ tinysemver = tinysemver.tinysemver:main
@@ -0,0 +1,2 @@
1
+ dist
2
+ tinysemver
@@ -1,4 +0,0 @@
1
- include __init__.py
2
- include tinysemver.py
3
- include LICENSE
4
- include README.md
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- tinysemver = tinysemver:main
@@ -1 +0,0 @@
1
- dist
File without changes
File without changes
File without changes