refactor: Rewrite pyRevit configurations - #2482
Conversation
|
@jmcouffin @sanzoghenzo how to trigger github action? |
|
|
I just launched it. I won't be able to review just now, best I can do is install the wip that will be created |
There was a problem hiding this comment.
Awesome job @dosymep !
I didn't run the code, only skimmed through, and only found some grammar to fix (ShouldThrows -> ShouldThrow).
Do you think it would be worth creating separate repo(s) and nuget package(s) for this feature (just to start the transition to a better code structure)?
it won't work, we have dependencies on this repo, at the moment I still don't know how to do this :( |
# Conflicts: # dev/pyRevitLabs/pyRevitLabs.PyRevit/PyRevitConfig.cs # pyrevitlib/pyrevit/userconfig.py
# Conflicts: # bin/netcore/pyRevitLabs.Emojis.dll # bin/netfx/pyRevitLabs.Emojis.dll # dev/pyRevitLabs/pyRevitLabs.PyRevit/PyRevitClones.cs # dev/pyRevitLabs/pyRevitLabs.PyRevit/PyRevitConfig.cs # dev/pyRevitLabs/pyRevitLabs.PyRevit/PyRevitConfigs.cs # pyrevitlib/pyrevit/coreutils/configparser.py
|
Should we keep this one opened? @dosymep |
Let it be, maybe I'll continue someday, or someone else will |
|
I've been testing the branch locally with Revit 2026 (build + smoke test, then fixing runtime issues so it runs). Here's a short summary and the list of changes I have made on top of the branch to get everything working. Sharing for discussion, as I'm not shure how to contribute to a PR on GH, but can contribute my code if someone can give me guidance (I assume I can make a PR to the feature/configuration branch?). SummaryThe new C# config stack (typed sections, INI provider, List of what I fixed locally (for testing)1.
|
|
Any objections to me taking a swing at bringing this up to date with develop? |
I don't have any, @dosymep you? a few notes though, I'd rather have a draft PR with no code changes and a clear plan that @dosymep or others can review before deeep diving. And there is a significant amount of drift between now and the start of this PR, 1 and a half year ago. |
|
I don't mind, but maybe everything there is already very outdated |
The override ported from pyrevitlabs#2482 only ever had a write half: setters took a Revit year and wrote pyRevit_config.<year>.ini, but every getter, the loader, and the migrator read the base config. The grammar was ambiguous too -- `[<revit_year>]` followed an optional value positional, so `pyrevit configs startuptimeout 2025` set the timeout instead of reading the 2025 override. Remove it and collapse the abstraction behind it: IConfigurationService now serves exactly one configuration. Names, layered reads, and the this[name] indexer give way to a single Configuration property; PyRevitConfigStore caches one Lazy; the 35 PyRevitConfigs setters lose their revitVersion parameter; UsagePatterns returns to its develop state. Configurations tests 16 -> 14 and 91 -> 89, dropping the name-keying and override-write cases.

ini-parserI think in general a start has been made, it remains to rewrite the logic of the config in python