Hyperion icon indicating copy to clipboard operation
Hyperion copied to clipboard

Move versions declaration in pyproject.toml

Open Marc-Andrieu opened this issue 9 months ago • 2 comments

Why

  • Inspired by https://github.com/aeecleclair/Titan/pull/480
  • Now both the version of itself and of the Titan client are declared in the TOML config file

How

  • I tried cleverly adding toml_file="pyproject.toml", in the SettingsConfigDict (line 49) so that the model would load fields from both config files (.env and pyproject.toml), but it seems Pydantic does not allow that at all...
  • So I went using Python's native tomllib TOML parser : it the only solution that worked for me, and it's short.
    • (The with is out of the class because Pydantic started crying about the type of the bytes flow from reading the file)

pyproject.toml

  • I just wanted to add
version = "4.3.3"
minimal-titan-version-code = 139

to the [project] table, but I realized it didn't even exist, so I ended up writing the bare minimum.

  • Perhaps we should fill this file seriously...
    • it is powerful for automation and description (it could not hurt to have it filled),
    • and required to make a release on PyPI (we already release CalypSSO and the HA wrapper, why not Hyperion itself?).

Marc-Andrieu avatar May 02 '25 22:05 Marc-Andrieu

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.40%. Comparing base (3959662) to head (99e738c). Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #700      +/-   ##
==========================================
+ Coverage   81.38%   81.40%   +0.02%     
==========================================
  Files         163      163              
  Lines       12218    12232      +14     
==========================================
+ Hits         9944     9958      +14     
  Misses       2274     2274              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 02 '25 22:05 codecov[bot]

The workflow fails because we're still using Ruff 0.5 and it needs Ruff >=0.8 : https://github.com/astral-sh/ruff/issues/13869#issuecomment-2483651621

So I'm going to need https://github.com/aeecleclair/Hyperion/pull/697

Marc-Andrieu avatar May 02 '25 22:05 Marc-Andrieu