Looking into pyrevit env was like the extension wasn’t even installed (but visible in the Revit ribbon bar)… then I tried deleting manually from the default extension path in %appdata% and installing the extension again but in a different folder… It worked!
I can’t be sure without knowing the code, but I think that is connected to the default path.
I wish it will be possible to deal with all of this simply using pyRevit, or maybe editing the extensions.json like I do for the public repositories.
Very interesting topic! At our company, we need to migrate extensions to GitHub, and with password authentication deprecating, extension manager installation will not work. I understand we can use the CLI, but most users will not be comfortable with that.
Is there any way that the extension manager can trigger an identity provider based on the extension url authication requirements (e.g. a GitHub organization that uses SAML)?
you might want to fill an issue for that one on pyRevit Github @GooseG
The CLI approach can be pretty seamless if you create a batch script to do the 'pyrevit extend ui ... --token=xxxxx' using a token
@GooseG replying to your second question first:
the token is produced only for the github admin (or whatever github manager role)
so only once.
my approach today, with my colleagues:
user installs pyrevit (could install pyrevit CLI only but that would require to clone and install pyrevit repo as an extra step (pyrevit clone …)
I get them to run from the command line : pyrevit extend ui extensionName https://github.com/gituser/repoName.git --dest="C:\xxxx" --token="6984ef654eaf6a54f65ef"
Note that I could have make a bat file to do that and provide them with a 1 click solution, but I tend to enforce the use and knowledge of the command line
then I have the following code in the startup.py script at root of my extension + a button in my toolbar to automatically (or by the push of that button) update the extension content. I also have the reload button from the pyrevit toolbar
then nothing to worry about, except for the “attach” to new revit version, but luckily, you can just add that to the startup.py script to run the cli : pyrevit attach ...
Wondering if anybody else saw this
When using this cli feature the config file only registers the path to the top folder not to the .extension folder which causes the addin to not load @Jean-Marc
Yes, @revitislife, and that is the exact reason my first few steps in pyRevit were so clumsy at first.
I did not see it at the time and thought that was something else.
Not the first and definitely not the last.
Learning programming and a framework feels like being a lemming
i have exactly the same issue , i tested with password, fine grained personal access token and personal access token classis, and nothing works for a private repo.
i then activated the github trial version of enterprise cloud , and make the repository internal, and create a fake github accoun and invited to my enterprise and tested again with the 3 methods (PW and 2 tokens) and it is not working, receiving the same error with status code : 401
What and why it does not work:
The window for the extension management is kind of broken as Github does not accept username+password combinations anymore.
It should be redesigned both on the backend and frontend to take only tokens.
What works:
using the pyrevit cli (that comes installed with pyRevit), you can specify the token with the --token key
while using the cli, if you don’t know what to do with it you can always use: pyrevit **keyword** -h -h will bring the help for the keyword you want to use
when i try as you said above, i got this error, how i can solve this?
(knowing that i renamed my branch to “master” as indicated in the above replies)
Error: Could not load file or assembly 'LibGit2Sharp, Version=0.29.0.0, Culture=neutral, PublicKeyToken=7cb........................' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Run with "--debug" option to see debug messages
--token = XXX
extend = True
<extension_name> = XXX
ui = True
<repo_url> = https://XXX.git
Debug: Checking for all: wiki
Debug: Missing: wiki
Debug: Checking for all: blog
Debug: Missing: blog
Debug: Checking for all: docs
Debug: Missing: docs
Debug: Checking for all: source
Debug: Missing: source
Debug: Checking for all: youtube
Debug: Missing: youtube
Debug: Checking for all: support
Debug: Missing: support
Debug: Checking for all: env
Debug: Missing: env
Debug: Checking for all: update
Debug: Missing: update
Debug: Checking for all: clone
Debug: Missing: clone
Debug: Checking for all: clones
Debug: Missing: clones
Debug: Checking for all: attach
Debug: Missing: attach
Debug: Checking for all: detach
Debug: Missing: detach
Debug: Checking for all: attached
Debug: Missing: attached
Debug: Checking for all: switch
Debug: Missing: switch
Debug: Checking for all: extend
Debug: Checking for any: ui,lib
Debug: Matching: ui
Error: Could not load file or assembly 'LibGit2Sharp, Version=0.29.0.0, Culture=neutral, PublicKeyToken=7cb.......XXX....' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (System.IO.FileLoadException)
at pyRevitLabs.PyRevit.PyRevitExtensions.InstallExtension(String extensionName, PyRevitExtensionTypes extensionType, String repoPath, String destPath, String branchName, GitInstallerCredentials credentials)
at pyRevitCLI.PyRevitCLI.ProcessArguments()
at pyRevitCLI.PyRevitCLI.Main(String[] args)```