tinysemver 2.1.0__tar.gz → 2.1.1__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.1.0
3
+ Version: 2.1.1
4
4
  Summary: Semantic-Versioning with LLMs and without 300,000 lines of JS
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.1.0"
7
+ version = "2.1.1"
8
8
  description = "Semantic-Versioning with LLMs and without 300,000 lines of JS"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -15,7 +15,7 @@ Example:
15
15
  --minor-verbs 'feature,minor,add,new' \
16
16
  --patch-verbs 'fix,patch,bug,improve,docs,make' \
17
17
  --changelog-file 'CHANGELOG.md' \
18
- --guide-file 'CONTIBUTING.md' \
18
+ --guide-file 'CONTRIBUTING.md' \
19
19
  --version-file 'VERSION' \
20
20
  --update-version-in 'package.json' '"version": "(.*)"' \
21
21
  --update-version-in 'CITATION.cff' '^version: (.*)' \
@@ -479,7 +479,7 @@ def aggregate_release_notes_with_llms(
479
479
  You are a release notes generator for an advanced software project.
480
480
 
481
481
  Aggregate the release notes for the upcoming version based on the commits and their
482
- changes replying in a Github-flavored Markdown format.
482
+ changes replying in a GitHub-flavored Markdown format.
483
483
 
484
484
  - Mention the new features, improvements, and bug fixes.
485
485
  - Warn about potential breaking changes and vulnerabilities.
@@ -494,6 +494,8 @@ def aggregate_release_notes_with_llms(
494
494
  ```
495
495
 
496
496
  - Use alerting quotes, like: [!CAUTION] or [!TIP], when needed.
497
+
498
+ Most importantly, be concise and informative.
497
499
  """
498
500
  header_message = f"""Commits:
499
501
 
@@ -501,7 +503,7 @@ def aggregate_release_notes_with_llms(
501
503
  """
502
504
  changes_messages = [f"#{commit.hash}: {commit.message}\n{change}" for commit, change in zip(commits, changes)]
503
505
 
504
- client = OpenAI(base_url=base_url, api_key=api_key)
506
+ client = get_open_ai_client(base_url=base_url, api_key=api_key)
505
507
  response = client.chat.completions.create(
506
508
  messages=[
507
509
  {"role": "system", "content": prompt},
@@ -621,16 +623,16 @@ def bump(
621
623
 
622
624
  current_version = parse_version(last_tag)
623
625
  if verbose:
624
- print(f"Current version: {current_version[0]}.{current_version[1]}.{current_version[2]}")
626
+ print_to_console(f"Current version: {current_version[0]}.{current_version[1]}.{current_version[2]}")
625
627
 
626
628
  commits = get_commits_since_tag(repository_path, last_tag)
627
629
  if not len(commits):
628
630
  raise NoNewCommitsError(f"No new commits since the last {last_tag} tag")
629
631
 
630
632
  if verbose:
631
- print(f"? Commits since last tag: {len(commits)}")
633
+ print_to_console(f"? Commits since last tag: {len(commits)}")
632
634
  for hash, commit in commits:
633
- print(f"# {hash}: {commit}")
635
+ print_to_console(f"# {hash}: {commit}")
634
636
 
635
637
  major_commits, minor_commits, patch_commits = group_commits(commits, major_verbs, minor_verbs, patch_verbs)
636
638
  assert (
@@ -645,7 +647,7 @@ def bump(
645
647
  bump_type = "patch"
646
648
  new_version = bump_version(current_version, bump_type)
647
649
  if verbose:
648
- print(f"Next version: {new_version[0]}.{new_version[1]}.{new_version[2]} (type: {bump_type})")
650
+ print_to_console(f"Next version: {new_version[0]}.{new_version[1]}.{new_version[2]} (type: {bump_type})")
649
651
 
650
652
  new_version_str = f"{new_version[0]}.{new_version[1]}.{new_version[2]}"
651
653
  if version_file:
@@ -656,12 +658,12 @@ def bump(
656
658
  changes = f"\n## {now:%B %d, %Y}: v{new_version_str}\n"
657
659
  changes += convert_commits_to_message(major_commits, minor_commits, patch_commits)
658
660
 
659
- print(f"Will update file: {changelog_file}")
661
+ print_to_console(f"Will update file: {changelog_file}")
660
662
  if verbose:
661
663
  changes_lines = changes.count("\n") + 1
662
- print(f"? Appending {changes_lines} lines")
664
+ print_to_console(f"? Appending {changes_lines} lines")
663
665
  for line in changes.split("\n"):
664
- print(f"+ {line}")
666
+ print_to_console(f"+ {line}")
665
667
 
666
668
  if not dry_run:
667
669
  with open(changelog_file, "a") as file:
@@ -698,13 +700,13 @@ def bump(
698
700
  warnings_commits.append(commit)
699
701
  warnings.append(warning)
700
702
  except Exception as e:
701
- print(f"Failed to validate commit: {commit.hash} with error: {str(e)}")
703
+ print_to_console(f"Failed to validate commit: {commit.hash} with error: {str(e)}")
702
704
  traceback.print_exc()
703
705
 
704
706
  if len(warnings):
705
- print("## Potential issues")
707
+ print_to_console("## Potential issues")
706
708
  for commit, warning in zip(warnings_commits, warnings):
707
- print(f"- Commit #{commit.hash}: {warning}")
709
+ print_to_console(f"- Commit #{commit.hash}: {warning}")
708
710
 
709
711
  release_notes = aggregate_release_notes_with_llms(
710
712
  base_url=openai_base_url,
@@ -714,8 +716,8 @@ def bump(
714
716
  commits=commits,
715
717
  changes=changes,
716
718
  )
717
- print("## Generated release notes:")
718
- print(release_notes)
719
+ print_to_console("## Generated release notes:")
720
+ print_to_console(release_notes)
719
721
 
720
722
  if not dry_run:
721
723
  create_tag(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinysemver
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: Semantic-Versioning with LLMs and without 300,000 lines of JS
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
File without changes
File without changes
File without changes