Skip to content

Allowed for -script, _script and .script.py file extensions#3131

Merged
jmcouffin merged 5 commits intopyrevitlabs:developfrom
sweco-beb283:feature/allow_for_script_prefixes
Feb 24, 2026
Merged

Allowed for -script, _script and .script.py file extensions#3131
jmcouffin merged 5 commits intopyrevitlabs:developfrom
sweco-beb283:feature/allow_for_script_prefixes

Conversation

@sweco-beb283
Copy link
Copy Markdown
Contributor

Allowed for -script, _script and .script.py file extensions

Description

This is more of a reinstation of an old convention if any, but I ran into an issue where my old scripts suddenly didn't work anymore. Figures it was the naming convention.

Up to PyRevit 4.X a script file inside a bundle could be called anything, as long as it ended with the word script.
Since 6 (maybe even 5) this is no longer the case, and I wanted to bring that back.
Specifically the following file name endings will be picked up as valid script files:

  • script.*
  • -script.*
  • .script.*
  • _script.*

Checklist

  • 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

None


Additional Notes

None

Copilot AI review requested due to automatic review settings February 23, 2026 20:38
Copy link
Copy Markdown
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 attempts to restore support for multiple script file naming conventions that were supported in pyRevit 4.x but broke in later versions. The change aims to allow script files within bundles to be named with various patterns ending in "script", specifically: script.*, -script.*, .script.*, and _script.*.

Changes:

  • Added a filter in ExtensionParser.cs to validate that discovered script files match one of four valid ending patterns: "script", "_script", "-script", or ".script"

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@pyrevitlabs pyrevitlabs deleted a comment from devloai bot Feb 24, 2026
@jmcouffin jmcouffin merged commit ba73ff9 into pyrevitlabs:develop Feb 24, 2026
@jmcouffin
Copy link
Copy Markdown
Contributor

@sweco-beb283
Thanks for this one too, keep them coming


For all changes to C#, for next time, please compile the necessary dll and make a specific commit once you feel the PR is good to go/be reviewed with the title:

chore: update binaries

This is both a convenience for reviewer and for people using the Clones functionality of the CLI

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2054-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2111-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2115-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2121-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26055+2123-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26057+1645-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26057+2022-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26058+1619-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2026

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

@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2026

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

@sweco-beb283
Copy link
Copy Markdown
Contributor Author

@jmcouffin Ooh, so you're saying the built binaries are included in git for a reason? Gotcha, will do.
There's a small little bug in here I have to mention. Right now the .EndsWith pattern is quite pointless as the first pattern will match anything that just ends with script.*.
I'll create a new PR to make it explicit to only allow either "script" without a prefix, OR script with a '-' or '_' prefix

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26069+2130-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26071+0706-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26073+1714-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26073+2220-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26074+1648-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26076+0001-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26077+2319-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26079+2333-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26080+1314-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26083+2031-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26083+2042-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26083+2045-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26083+2048-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26083+2106-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26083+2130-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26086+2004-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26088+1318-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26089+1231-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26090+0549-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26090+1533-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26090+1536-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26090+1540-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26090+1540-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 6.1.0.26090+1556-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New public release are available for 6.2.0.26090+1754

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants