Skip to content
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

pip run --pip-args #1386

Open
gsemet opened this issue May 1, 2024 · 5 comments
Open

pip run --pip-args #1386

gsemet opened this issue May 1, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@gsemet
Copy link

gsemet commented May 1, 2024

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

@chrysle
Copy link
Contributor

chrysle commented May 1, 2024

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 chrysle added the enhancement New feature or request label May 1, 2024
@gsemet
Copy link
Author

gsemet commented May 1, 2024

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

@chrysle
Copy link
Contributor

chrysle commented May 1, 2024

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.

@gsemet
Copy link
Author

gsemet commented May 1, 2024

Indeed, not tried with 1.5...

@GurjinderSingh
Copy link

GurjinderSingh commented May 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants