Hyperion
Hyperion copied to clipboard
Move versions declaration in pyproject.toml
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 theSettingsConfigDict(line 49) so that the model would load fields from both config files (.envandpyproject.toml), but it seems Pydantic does not allow that at all... - So I went using Python's native
tomllibTOML parser : it the only solution that worked for me, and it's short.- (The
withis out of the class because Pydantic started crying about the type of the bytes flow from reading the file)
- (The
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?).
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.
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