Skip to content

Conversation

@electron271
Copy link
Member

@electron271 electron271 commented Apr 19, 2025

Description

tux 0.0.0.dev2106+b731156.dynamicversioning
^   ^     ^       ^       ^
name^     commits commit  branch (escaped), is empty if its main
    ver   since   hash
          last
          tag

auto generates version based on this, also removes single-source as its broken with this (and also not needed)

Guidelines

  • My code follows the style guidelines of this project (formatted with Ruff)

  • I have performed a self-review of my own code

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation if needed

  • My changes generate no new warnings

  • I have tested this change

  • Any dependent changes have been merged and published in downstream modules

  • I have added all appropriate labels to this PR

  • I have followed all of these guidelines.

How Has This Been Tested? (if applicable)

Tested with different branches

Screenshots (if applicable)

Please add screenshots to help explain your changes.

Additional Information

Please add any other information that is important to this PR.

Summary by Sourcery

Implement dynamic versioning for the project using poetry-dynamic-versioning and remove the single-source dependency

New Features:

  • Introduce dynamic version generation based on git metadata, supporting different versioning for main and other branches

Enhancements:

  • Replace static version management with a more flexible dynamic versioning approach

Chores:

  • Remove single-source dependency
  • Update version retrieval method in project initialization

@trunk-io
Copy link

trunk-io bot commented Apr 19, 2025

⏱️ 56m total CI duration on this PR

Job Cumulative Duration Recent Runs
pyright 17m 🟩🟩🟩🟩🟩 (+22 more)
Analyze (python) 14m 🟩🟩🟩🟩🟩 (+9 more)
docker 14m 🟥🟥🟥🟥🟩 (+9 more)
Ruff 10m 🟩🟩🟩🟩🟩 (+22 more)

settingsfeedbackdocs ⋅ learn more about trunk.io

@trunk-io
Copy link

trunk-io bot commented Apr 19, 2025

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Apr 19, 2025

Reviewer's Guide by Sourcery

This pull request introduces dynamic versioning using the poetry-dynamic-versioning package and removes the single-source package. The version is now dynamically generated based on the git history, including commits since the last tag, commit hash, and branch name. The single-source package was removed as it was no longer needed and was causing issues with dynamic versioning.

Updated class diagram for tux package

classDiagram
  class tux {
    +__version__: str
  }
  note for tux "Version is now dynamically generated using poetry-dynamic-versioning"
Loading

File-Level Changes

Change Details Files
Implemented dynamic versioning using poetry-dynamic-versioning.
  • Added poetry-dynamic-versioning as a build system requirement.
  • Configured poetry-dynamic-versioning in pyproject.toml to enable dynamic versioning and set the version format.
  • Replaced the static version in pyproject.toml with dynamic = ["version"].
  • Updated the __init__.py file to retrieve the version using importlib.metadata.
pyproject.toml
tux/__init__.py
Removed the single-source package.
  • Removed single-source from the dependencies in pyproject.toml.
  • Removed the import and usage of single_source in tux/__init__.py.
pyproject.toml
tux/__init__.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @electron271 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider using version = "0.1.0" instead of version = "0.0.0" in pyproject.toml to better reflect the project's maturity.
  • It might be helpful to add a comment explaining why single-source was removed.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@electron271 electron271 merged commit c7a2230 into main Apr 19, 2025
8 checks passed
@electron271 electron271 deleted the dynamic-versioning branch April 19, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants