pipx icon indicating copy to clipboard operation
pipx copied to clipboard

pip run --pip-args

Open gsemet opened this issue 2 months ago • 5 comments

Hello

Using pipx 1.4, I need to manually add --pip-args in my install command to hit my private artifactory repository, despite my pip config pointing to it by default:

$ python3 -m pipx install 'pygount' --force --pip-args="--index-url=https://artifactory.my.company.com/artifactory/api/pypi/pypi/simple --trusted-host=artifactory.my.company.com"

How can I set this by default, by defining a configuration file or an environment variable ?

Thanks

gsemet avatar May 01 '24 08:05 gsemet

I think it would be good to enable configuring standard pip args via an environment variable, thanks for raising this issue! I'll have a look today.

chrysle avatar May 01 '24 09:05 chrysle

I have actually 2 pc I think configured the same way, one pipx install kind of use the global pip config, the other not, I do not understand the difference.

I would expect pipx to use pip, so if pip config is made to hit my private pipy be default I would expect pipx run to use the same, but there is a details that I do no catch

gsemet avatar May 01 '24 12:05 gsemet

For me, with 1.5.0 pipx-managed pip can access the configuration. Have you set it globally? Also, if you run pip in one of your venvs and list the config, it should show your settings? pipx does nothing other than calling pip giving its full path.

chrysle avatar May 01 '24 13:05 chrysle

Indeed, not tried with 1.5...

gsemet avatar May 01 '24 13:05 gsemet

I tested not working for me and 'pip config list' command list all configurations. I tried copying 'pip.ini' to the path 'C:\Users***\pipx\shared', but it didn't work. Is there a simpler way to just list the configurations with pipx?"

C:\Users\***>pipx -v
pipx >(setup:924): pipx version is 1.5.0
pipx >(setup:925): Default python interpreter is 'c:\users\***\appdata\local\programs\python\python39\python.exe'


C:\Users\***>pipx run pycowsay
Fatal error from pip prevented installation. Full pip output in file:
    C:\Users\***\pipx\logs\cmd_2024-05-06_08.48.41_pip_errors.log

Some possibly relevant errors from pip install:
    ERROR: Could not find a version that satisfies the requirement cowsay (from versions: none)
    ERROR: No matching distribution found for cowsay
Error installing cowsay.

C:\Users\***>pip config list
global.extra-index='https://registry.cnfi.stratus.int.**.ca/service/rest/repository/browse/iaas-pypi/'
global.extra-index-url='https://registry.cnfi.stratus.int.**.ca/repository/iaas-pypi/simple/'
global.trusted-host='pypi.org files.pythonhosted.org pypi.python.org registry.cnfi.stratus.int.***.ca'

Edit:

pip do use config files from virtual environments too %UserProfile%\Envs\environment_DIR\pip.ini

GurjinderSingh avatar May 06 '24 12:05 GurjinderSingh