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

[fix] allow the user to overwrite the no_input flag to pip #5036

Merged
merged 1 commit into from Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,38 @@ Environment variables in the URL part of requirement specifiers can also be expa

Keep in mind that environment variables are expanded in runtime, leaving the entries in ``Pipfile`` or ``Pipfile.lock`` untouched. This is to avoid the accidental leakage of credentials in the source code.

☤ Injecting credentials through keychain support
------------------------------------------------

Private regirstries on Google Cloud, Azure and AWS support dynamic credentials using
the keychain implementation. Due to the way the keychain is structured, it might ask
the user for input. Asking the user for input is disabled. This will disable the keychain
support completely, unfortunately.

If you want to work with private registries that use the keychain for authentication, you
can disable the "enforcement of no input".

**Note:** Please be sure that the keychain will really not ask for
input. Otherwise the process will hang forever!

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[[source]]
url = "https://europe-python.pkg.dev/my-project/python/simple"
verify_ssl = true
name = "private-gcp"

[packages]
flask = "*"
private-test-package = {version = "*", index = "private-gcp"}

[pipenv]
disable_pip_input = false

Above example will install ``flask`` and a private package ``private-test-package`` from GCP.

☤ Specifying Basically Anything
-------------------------------
Expand Down
1 change: 1 addition & 0 deletions news/4706.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow the user to disable the ``no_input`` flag, so the use of e.g Google Artifact Registry is possible.
2 changes: 1 addition & 1 deletion pipenv/utils/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def pip_options(self):
pip_options, _ = self.pip_command.parser.parse_args(self.pip_args)
pip_options.cache_dir = self.project.s.PIPENV_CACHE_DIR
pip_options.no_python_version_warning = True
pip_options.no_input = True
pip_options.no_input = self.project.settings.get("disable_pip_input", True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is going to at a minimum require some documentation around how to specify this in the Pipfile and what it does.

Copy link
Author

@ghost ghost Apr 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried figuring out how the documentation is built but failed. Can you point me in the right direction, @matteius?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure -- so you have to go into the docs directory and there is a separate requirements.txt in there to install using pip -r requirements.txt. I think after that you should just have to run make html to build the html docs. Going from memory here but I did it not so long ago ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't get the pipfile to show as syntax. But the doc is added. Maybe you can take it from here, @matteius ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since its in your fork, best I can do is address any formatting in a followup PR. I'll at least get this merged now.

pip_options.progress_bar = "off"
pip_options.ignore_requires_python = True
pip_options.pre = self.pre or self.project.settings.get(
Expand Down