Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite pyRevit configurations #2482

Draft
wants to merge 40 commits into
base: develop
Choose a base branch
from
Draft

Conversation

dosymep
Copy link
Member

@dosymep dosymep commented Dec 18, 2024

  • added config abstraction
  • added config overrides (need testing and design the logic of work)
  • replace ini lib to ini-parser
  • added json configuration
  • added yaml configuration (doesn't work I need to figure out the parser library)

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

@dosymep dosymep added Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] Enhancement Enhancement request [class->Improved #{number}: {title}] Backward Compatibility Backward Compatibility Issue with Older Revit Versions DotNet API Issues related to pyRevitLabs libraries [subsystem] API Change Revit API change that breaks pyRevit [class->Upgraded #{number}: {title}] labels Dec 18, 2024
@dosymep dosymep added this to the post pyRevit 5 RC milestone Dec 18, 2024
@dosymep dosymep linked an issue Dec 18, 2024 that may be closed by this pull request
5 tasks
@dosymep dosymep marked this pull request as ready for review December 18, 2024 11:21
@dosymep dosymep assigned dosymep and unassigned sanzoghenzo Dec 18, 2024
@dosymep dosymep marked this pull request as draft December 18, 2024 11:23
@dosymep
Copy link
Member Author

dosymep commented Dec 18, 2024

@jmcouffin @sanzoghenzo how to trigger github action?

@jmcouffin
Copy link
Contributor

@jmcouffin @sanzoghenzo how to trigger github action?

image

@jmcouffin
Copy link
Contributor

I just launched it.
15min+ to go

I won't be able to review just now, best I can do is install the wip that will be created

Copy link
Contributor

@sanzoghenzo sanzoghenzo left a comment

Choose a reason for hiding this comment

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

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)?

@dosymep
Copy link
Member Author

dosymep commented Dec 20, 2024

creating separate repo(s) and nuget package(s)

it won't work, we have dependencies on this repo, at the moment I still don't know how to do this :(

@sanzoghenzo
Copy link
Contributor

HI @dosymep,

The attributes solution is really nice!

Just one question, out of curiosity: why did you turn GetValueImpl into a non-generic method? wouldn't it work the same?

@dosymep
Copy link
Member Author

dosymep commented Dec 27, 2024

@sanzoghenzo
I updated internal API, to get values from reflection

https://github.com/pyrevitlabs/pyRevit/pull/2482/files#diff-3e1f8a1b067a136ccc1a3c88ee1bf54a3f0dac93b46c9ba785d9e86096f5e7c6R152

@sanzoghenzo
Copy link
Contributor

@sanzoghenzo I updated internal API, to get values from reflection

https://github.com/pyrevitlabs/pyRevit/pull/2482/files#diff-3e1f8a1b067a136ccc1a3c88ee1bf54a3f0dac93b46c9ba785d9e86096f5e7c6R152

Yes I saw that, i should have asked you "why can't you use generics with reflection?" but it doesn't matter as long as it works! 😉 it is just something I have to learn about .net...

@dosymep
Copy link
Member Author

dosymep commented Dec 27, 2024

Yes I saw that, i should have asked you "why can't you use generics with reflection?" but it doesn't matter as long as it works! 😉 it is just something I have to learn about .net...

because when I ask property type from reflections, reflection api return me an object of the Type. I can't pass it as a generic parameter

@dosymep
Copy link
Member Author

dosymep commented Dec 27, 2024

remaining

  • write tests
  • write code in python
  • fix tests

@sanzoghenzo
Copy link
Contributor

As for the python side, do you think that we can directly use these new classes in the userconfig.py?

Are user-defined sections and keys supported?

@dosymep
Copy link
Member Author

dosymep commented Dec 27, 2024

As for the python side, do you think that we can directly use these new classes in the userconfig.py?
Are user-defined sections and keys supported?

1 yep
2 yep
but need check :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Change Revit API change that breaks pyRevit [class->Upgraded #{number}: {title}] Backward Compatibility Backward Compatibility Issue with Older Revit Versions Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] DotNet API Issues related to pyRevitLabs libraries [subsystem] Enhancement Enhancement request [class->Improved #{number}: {title}]
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

[Bug]: manage access to pyrevit-config.ini at startup
3 participants