Allow specifying pip `index-url` via settings when installing Python dependencies
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 74/100
Research direction
Start in python/scriptingprovider.py at PythonScriptingProvider._install_modules, especially lines 1396-1401, where the isolated pip command is built. Review how the network.httpsProxy setting is handled and how settings are defined, then make the configured python.pip.indexUrl affect dependency installation. Done means plugin dependencies can use the configured index URL without disabling isolated mode.
Written by the indexing model from the issue text.
Description
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:
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 🤔
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 298
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 19
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Vector35/binaryninja-api
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Vector35/binaryninja-api#8540 ·
-
Arch: MSP430
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Vector35/binaryninja-api#8516 · 1 assignee ·
-
Arch: MSP430
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Vector35/binaryninja-api#8503 · 1 assignee ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Vector35/binaryninja-api#8446 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Vector35/binaryninja-api#8444 ·
All issues in Vector35/binaryninja-api
Similar issues
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 88/100
QuantStack/git2cpp#187 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100