Update extension not including dependant library

Hi all,

For an extension, I added a dependent library extension in a new version/commit. When a user tried updating the extension, the dependent library extension is not installed. I would expect the update command to also check if new depencies are required. Or is this expected behavior?

I think I found the update method, but not sure if it would need to be implemented there?


I am not sure the builtin update method looks that far.
In my case, I have used the command line called from the startup script button and invoking the pyrevit extensions update command

import os
os.system('cmd /c "pyrevit extensions update NameOfUrExtension --token="xxxxxx321x64x6x65x""')

and eventually I got the same code in an update button of mine

It worked so I never took the time to look further

1 Like

Hi @Jean-Marc
This is not really what my problem is. Regarding your challenge, you could also enable autoupdate of extensions in pyRevit_config.INI file, right? As such:

verbose = false
debug = false
checkupdates = true
autoupdate = true
rocketmode = true
filelogging = false
loadbeta = false
colorize_docs = true

Questions 1 Do you have any idea if this will trigger every time a user launches Revit, or only when there is a new version of an extension (i.e. new latest commit id)?

My original question was regarding dependent library extension not being cloned when added to an already existing extension. I tried implementing a similar startup script, but it first checks if the library extension is not installed yet:

import os
import sys

paths_combined = '\t'.join(sys.path)

if 'your-library-extension-name' not in paths_combined:
    os.system('cmd /c "pyrevit extend your-library-extension-name')

Question 2: Any idea how to prevent the prevent the command window from showing? Is it possible to run silent or as background process?

I found the better way using the subprocess module by adding the below to startup.py :slight_smile:

import sys
import subprocess

paths_combined = '\t'.join(sys.path)

if 'your-library-extension-name' not in paths_combined:
    subprocess.call('cmd /c "pyrevit extend your-library-extension-name', shell=True)

Nice trick for the subprocess with shell to True.
completely counter intuitive to me but works just fine. No command line popping any more which is great.

Regarding Q1, no idea. I tried the auto update a long time ago and tried it again, but it did not update automatically my private extensions.
so I will stick with command line updating in my startup script.