Implement Revit version compatibility checks#3134
Implement Revit version compatibility checks#3134jmcouffin merged 9 commits intopyrevitlabs:developfrom
Conversation
Added version compatibility checks for Revit extensions based on the specified Revit year. Updated methods to include revitYear parameter for filtering extensions and components accordingly.
|
Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔 |
There was a problem hiding this comment.
Pull request overview
This PR implements Revit version compatibility checks for pyRevit extensions and components based on min_revit_version and max_revit_version constraints declared in bundle.yaml files. This addresses issue #3112 where pyRevit 6 was not respecting these version flags, causing extensions to load in incompatible Revit versions.
Changes:
- Added
IsRevitVersionCompatiblehelper method to validate version ranges - Updated
ParseInstalledExtensions,ParseExtension, andParseComponentsmethods to accept and thread through arevitYearparameter - Implemented filtering logic at both extension and component levels to skip incompatible items
|
Hi @jchristel, appreciate your initiative. Check the copilot overview, it looks quite reasonable I'd also like to mention test, that wouldn't be a fail to implement tests for this case. If you don't mind adding them it's going to be lovely. Also, there was a mechanism in the code for logging parsing errors. For instance if somebody put string or some number which does not correspond with version, app should print the exception to the output window stating the line and the reason. Let me know what do you think and if you are down for it. |
|
Hi @romangolev, No problem at all, I'm happy to update the code, add the tests and see whether I can add the logging of parsing errors. I'm new to contributing to other repos...Do I make those changes suggested and then put up a new pull request? Cheers, |
|
@jchristel no sweat, you can just continue committing to your branch. Just push commits, they will appear in the PR automatically. Whenever you're ready you can request review again. |
passing on logger and Revit version to ExtensionManagerService to allow for version compatibility checks and logging thereof
updated constructor to take logger and Revit version
updated IsRevitVersionCompatible to - include more detailed logging of extensions min max Revit year values parse failures and Revit 0 year occurrence. - header xml docs added
|
No biggy, please, let's make it a draft PR until it is ready for review (and after Copilot/devloAI reviews) |
|
@jmcouffin @romangolev would it been better If I had moved this to a separate branch, rather than pushing it straight into develop? Apologies, I'm not familiar with working in larger projects on github. I'm happy to close this pull and re-open it on a separate branch if that helps? |
No worries, this is okay ish. |
updated logger usage ( removed set command since not required, left logger in place in case its required down the line)
Added 5 version filtering tests as suggested by Copilot
|
I think I'm done :)
I tried to run the tests but I couldn't get that going since Visual Studio could not find test.runsettings which is odd because I can see the file. Manual selection of the file didn't help either. Claude recommended to add it to the .csproj file: I did not do that :) since I don't know the reason wy it is set up the way it is. |
|
@jchristel cool, switch from draft PR to active PR, I'll test right away |
|
Great, let me know if something is amiss. |
…ve obsolete script file. The test now checks for 'folie_architecturale_script.dyn' instead of 'BIM1_ArrowHeadSwitcher_script.dyn', ensuring the correct file existence is asserted.
|
works for me, added binaries and made a totally unrelated test fix (dyn). bad boy! |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1233-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1244-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1357-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1403-wip |
Added version compatibility checks for Revit extensions based on the specified Revit year. Updated methods to include revitYear parameter for filtering extensions and components accordingly.
Name of your PR
Description
This patch updates current pyRevit loader architecture with respect to
min_revit_version/max_revit_versionsupport, and implements a design for enforcing those constraints at parse time in the C# extension parser.Checklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}Related Issues
If applicable, link the issues resolved by this pull request:
Additional Notes
Include any additional context, screenshots, or considerations for reviewers.
Thank you for contributing to pyRevit! 🎉