ref: Remove property setters from dataclass
Some checks failed
website / deploy (push) Has been cancelled
website / build (push) Has been cancelled

Removed the property setters and getters from variables with complex
defaults. Instead, they are now given a specific const default value
`Path("%%%%I_DONT_EXIST_%%%%")` which is very unlikely to be used by a user
in normal circumstances.

This is necessary to be able to remove the properties since Python does
not distinguish between an empty Path() and a non-given Path() (i.e.
there is no Path value which returns Falsy).

However, this slightly clunky construct does allow setting the various
Paths once and only once, and also to remove all the previously
necessary getters and setters with their hidden backing variables.

Lastly it should open the gates for changing the _real_path
transformation to be part of the TConf class itself and not a global
function.
This commit is contained in:
Marty Oehme 2025-04-22 21:49:24 +02:00
parent b0a71e804d
commit 7dbd93796d
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 25 additions and 33 deletions

View file

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Fixed
- Default paths are only calculated once, though users can now not use specifically '%%%%I_DONT_EXIST_%%%%' as a path for the taskrc file and task data directory.
## [0.2.0] - 2025-04-09
### Added