Skip to content

Implement Revit version compatibility checks#3134

Merged
jmcouffin merged 9 commits intopyrevitlabs:developfrom
jchristel:develop
Mar 2, 2026
Merged

Implement Revit version compatibility checks#3134
jmcouffin merged 9 commits intopyrevitlabs:developfrom
jchristel:develop

Conversation

@jchristel
Copy link
Contributor

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_version support, 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:

  • Code follows the PEP 8 style guide.
  • Code has been formatted with Black using the command:
    pipenv run black {source_file_or_directory}
  • Changes are tested and verified to work as expected.

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! 🎉

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.
Copilot AI review requested due to automatic review settings February 23, 2026 22:00
@devloai
Copy link
Contributor

devloai bot commented Feb 23, 2026

Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔
Please upgrade your plan or buy additional credits from the subscription page.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 IsRevitVersionCompatible helper method to validate version ranges
  • Updated ParseInstalledExtensions, ParseExtension, and ParseComponents methods to accept and thread through a revitYear parameter
  • Implemented filtering logic at both extension and component levels to skip incompatible items

@romangolev
Copy link
Member

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.
Tests are located in here: dev/pyRevitLoader/pyRevitExtensionParserTester

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.

@jchristel
Copy link
Contributor Author

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?
Ah and is there a timeframe for this?

Cheers,
Jan

@romangolev
Copy link
Member

@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
@jmcouffin
Copy link
Contributor

jmcouffin commented Feb 24, 2026

No biggy, please, let's make it a draft PR until it is ready for review (and after Copilot/devloAI reviews)

@jmcouffin jmcouffin marked this pull request as draft February 24, 2026 20:36
@jmcouffin jmcouffin assigned jchristel and romangolev and unassigned romangolev Feb 24, 2026
@jmcouffin jmcouffin requested a review from romangolev February 24, 2026 21:24
@jmcouffin jmcouffin added the Backward Compatibility Backward Compatibility Issue with Older Revit Versions label Feb 24, 2026
@jchristel
Copy link
Contributor Author

jchristel commented Feb 24, 2026

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

@jmcouffin
Copy link
Contributor

@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.
The git flow we want to enforce is:
Branch from develop, PR against origin:develop

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
@jchristel
Copy link
Contributor Author

@romangolev

I think I'm done :)

  • Addressed the issues raised by Copilot
  • Added tests

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:
$(MSBuildThisFileDirectory)test.runsettings

I did not do that :) since I don't know the reason wy it is set up the way it is.

@romangolev
Copy link
Member

@jchristel cool, switch from draft PR to active PR, I'll test right away

@jmcouffin jmcouffin marked this pull request as ready for review February 26, 2026 06:31
@jchristel
Copy link
Contributor Author

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.
@jmcouffin jmcouffin added the Installer Issues related to the pyRevit installer [subsystem] label Mar 2, 2026
@jmcouffin
Copy link
Contributor

works for me, added binaries and made a totally unrelated test fix (dyn). bad boy!
@jchristel thanks for the contribution

@jmcouffin jmcouffin merged commit e99b812 into pyrevitlabs:develop Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1233-wip

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1244-wip

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1357-wip

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1403-wip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backward Compatibility Backward Compatibility Issue with Older Revit Versions Installer Issues related to the pyRevit installer [subsystem]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: New Loader does not respect min_revit_version / max_revit_version flags

4 participants