-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use pipx to install namespace package from private repo #635
Comments
I'm not super-familiar with this flow so I tested on a PyPI package. This finally worked:
So for the index url, you do need the The other thing (I believe) for your
(From my example, I can navigate to |
One snag may be that since you are using You could do this with pip user or global settings, or on pipx's command line or with the For pipx, I think it would be something like:
Although I tend to forget the right way to do the |
https://pip.pypa.io/en/stable/user_guide/?highlight=appdata#config-file |
Better |
@itsayellow Thanks for the info. Since my packages rely on both internal packages and packages from the main pypi, I ended up needing to use
|
Note that using |
@uranusjr Aside from packages not being what one expects (shadowing) or containing malicious code if the extra index was not my own, are there other security implications you are suggesting since I own and control this repo? |
Unless you also own the name on PyPI, people can shadow you on there as well. |
@uranusjr Interesting point. Do you know if there is a way to specifically set the index search order so that my private index is used first, and regular pypi is only used as a fallback? |
I suppose maybe something like this:
|
It does not help, indexes don’t have priorities because that’s not what multiple indexes are designed to solve. More context: pypa/pip#9612 |
I created this script to enable use of an internal PyPI server (pypiserver instance) and my group's shared unix drive space. However, creating the wrapper was awkward because I'm not allowed to give the --index-url unless it is actually needed. Wouldn't it make sense to enable pipx to accomplish the function of this wrapper using just env vars (PIPX_INDEX_URL, PIPX_PIP_ARGS)? #!/usr/bin/python3
import os
import sys
my_group_home = "/proj/my_group_space"
my_group_pyenv = f"{my_group_home}/envs/my_group_python3.11"
my_group_pipx_path = f"{my_group_pyenv}/bin/pipx"
os.environ["PIPX_HOME"] = f"{my_group_home}/envs/pipx"
os.environ["PIPX_BIN_DIR"] = f"{my_group_home}/bin"
os.environ["PIPX_DEFAULT_PYTHON"] = f"{my_group_pyenv}/bin/python3"
if len({"install", "upgrade"} & set(sys.argv[1:3])) > 0:
cmd = (
[my_group_pipx_path]
+ sys.argv[1:]
+ [
"--index-url",
"http://my.internal.pypi:8080/simple/",
"--pip-args",
"--trusted-host my.internal.pypi",
]
)
print(*cmd)
os.execv(my_group_pipx_path, cmd)
else:
cmd = [my_group_pipx_path] + sys.argv[1:]
os.execv(my_group_pipx_path, cmd) |
Describe the bug
Not really a bug, but I couldn't find an incantation that worked for my use-case. I have a private repo served on our local network, and would like to use pipx to install a namespace package from it. I'm guessing that this is possible, since
pipx
usespip
internally, and I know that my repo works correctly because I usepoetry
to install packages from it frequently.I have tried the following:
pipx install --index-url "http://<my index>:8885" my.special.namespace.package
pipx install --index-url "http://<my index>:8885/simple" my.special.namespace.package
pipx install --index-url "http://<my index>:8885/" my-special-namespace-package
pipx install --index-url "http://<my index>:8885/simple" my-special-namespace-package
Environment
macOS 10.14
pipx
installed viabrew
asdf
installed Python, and setPIPX_DEFAULT_PYTHON
pypiserver
The text was updated successfully, but these errors were encountered: