What is the feature you'd like to have?
Today, you're unable to specify an --index-url for pip to use when installing Python dependencies for plugins, which means internal mirrors, etc. are unavailable. In environments where direct access to the pypi.org index isn't available, this means that Binary Ninja fails to install Python dependencies of packages.
Rather than disabling --isolated, it'd be nice to be able to specify a global setting (e.g. python.pip.indexUrl) which adds the desired index to the generated pip command line.
Thanks!
Is your feature request related to a problem?
When installing Binary Ninja plugins today, PythonScriptingProvider._install_modules builds a pip command line to install the module in isolated mode:
|
args: List[str] = [str(python_bin), "-m", "pip", "--isolated", "--disable-pip-version-check"] |
|
proxy_settings = settings.Settings().get_string("network.httpsProxy") |
|
if proxy_settings: |
|
args.extend(["--proxy", proxy_settings]) |
|
|
|
args.extend(["install", "--upgrade", "--upgrade-strategy", "only-if-needed"]) |
This means that ~/.pip/pip.conf, etc. configuration settings from the environment are not used by pip - as described above, this means you can't set --index-url in environments where you can't directly hit PyPi
You can kinda hack around this by running something like this to manually install a package into BN's site-packages directory yourself:
uv run python3 -m pip --isolated \
--disable-pip-version-check install --upgrade --upgrade-strategy only-if-needed \
--target "$HOME/Library/Application Support/Binary Ninja/python313/site-packages" \
--index-url "<my_index_url>" \
<package>
Are any alternative solutions acceptable?
A setting like python.pip.indexUrl (used in the same way as network.httpsProxy) is probably the cleanest solution!
Alternatively a pip.conf file could be specified, but this seems like it could get a bit messy if settings other than index-url are configured 🤔
What is the feature you'd like to have?
Today, you're unable to specify an
--index-urlforpipto use when installing Python dependencies for plugins, which means internal mirrors, etc. are unavailable. In environments where direct access to thepypi.orgindex isn't available, this means that Binary Ninja fails to install Python dependencies of packages.Rather than disabling
--isolated, it'd be nice to be able to specify a global setting (e.g.python.pip.indexUrl) which adds the desired index to the generatedpipcommand line.Thanks!
Is your feature request related to a problem?
When installing Binary Ninja plugins today,
PythonScriptingProvider._install_modulesbuilds apipcommand line to install the module in isolated mode:binaryninja-api/python/scriptingprovider.py
Lines 1396 to 1401 in c54968e
This means that
~/.pip/pip.conf, etc. configuration settings from the environment are not used by pip - as described above, this means you can't set--index-urlin environments where you can't directly hit PyPiYou can kinda hack around this by running something like this to manually install a package into BN's
site-packagesdirectory yourself:uv run python3 -m pip --isolated \ --disable-pip-version-check install --upgrade --upgrade-strategy only-if-needed \ --target "$HOME/Library/Application Support/Binary Ninja/python313/site-packages" \ --index-url "<my_index_url>" \ <package>Are any alternative solutions acceptable?
A setting like
python.pip.indexUrl(used in the same way asnetwork.httpsProxy) is probably the cleanest solution!Alternatively a
pip.conffile could be specified, but this seems like it could get a bit messy if settings other thanindex-urlare configured 🤔