Open ricolxwz opened 4 months ago
The user is questioning the use case of the --ignore-pipfile
flag in the pipenv install
command. Their experiments show no difference in behavior between using the flag and omitting it, as both scenarios seem to prioritize Pipfile.lock
for installation.
They also point out that the pipenv sync
command already provides the functionality of installing directly from Pipfile.lock
.
There are no comments on this issue, indicating a lack of community engagement or a clear understanding of the intended use of the --ignore-pipfile
flag.
The issue highlights a potential redundancy or misunderstanding regarding the --ignore-pipfile
flag. It seems the flag's intended behavior might not align with its actual implementation, as it doesn't appear to genuinely ignore Pipfile
during installation.
Possible solutions:
pipenv install
. This simplifies the command interface and eliminates confusion.pipenv sync
, then its functionality needs to be clarified. Update the documentation to explain its purpose and the scenarios where it differs from pipenv install
without the flag. This ensures users understand when and how to use it effectively.--ignore-pipfile
to install packages only from Pipfile.lock
without even considering Pipfile
, then the code needs to be adjusted to achieve this behavior.If opting to re-implement the functionality:
Modify pipenv/routines/install.py
inside the do_install
function:
if not packages and not editable_packages:
# ... existing code ...
else:
if skip_lock:
# ... existing code ...
elif ignore_pipfile:
# Install only from Pipfile.lock, ignoring Pipfile completely.
for category in categories:
lockfile_category = get_lockfile_section_using_pipfile_category(category)
for package_name, package_info in lockfile[lockfile_category].items():
# Construct pip installation command for each package in lockfile
pip_line = requirement_from_lockfile(
package_name, package_info, include_hashes=True, include_markers=True
)
# ... append pip_line to a list for installation ...
else:
# ... existing code ...
This modification directly constructs installation commands from Pipfile.lock
, bypassing any Pipfile
checks or updates if --ignore-pipfile
is provided.
pipenv install
to identify any test cases covering the --ignore-pipfile
flag. If no such tests exist, create new ones to validate the intended behavior after implementing any changes.--ignore-pipfile
flag. This can help determine the most appropriate course of action.By either removing, clarifying, or re-implementing the functionality of the --ignore-pipfile
flag, Pipenv can maintain a consistent and predictable command interface, aligning with user expectations and avoiding unnecessary confusion.
AVOID POSTING ISSUES UNDER THIS CATEGORY.
If Pipenv is not functioning as you would like it to, consider filing either a bug report, or a feature request instead.
Please refer to StackOverflow tag for more information.
Please run
$ pipenv --support
, and paste the results here. Don't put backticks (`
) around it! The output already contains Markdown formatting.$ pipenv --support
Pipenv version: `'2024.0.1'` Pipenv location: `'/home/wenzexu/.pyenv/versions/3.12.4/lib/python3.12/site-packages/pipenv'` Python location: `'/home/wenzexu/.pyenv/versions/3.12.4/bin/python3.12'` OS Name: `'posix'` User pip version: `'24.0'` user Python installations found: PEP 508 Information: ``` {'implementation_name': 'cpython', 'implementation_version': '3.12.4', 'os_name': 'posix', 'platform_machine': 'x86_64', 'platform_python_implementation': 'CPython', 'platform_release': '6.9.7-200.fc40.x86_64', 'platform_system': 'Linux', 'platform_version': '#1 SMP PREEMPT_DYNAMIC Thu Jun 27 18:11:45 UTC 2024', 'python_full_version': '3.12.4', 'python_version': '3.12', 'sys_platform': 'linux'} ``` System environment variables: - `SHELL` - `SESSION_MANAGER` - `PYENV_HOOK_PATH` - `COLORTERM` - `PYENV_SHELL` - `NVM_INC` - `HISTCONTROL` - `XDG_MENU_PREFIX` - `TERM_PROGRAM_VERSION` - `CONDA_EXE` - `_CE_M` - `HOSTNAME` - `HISTSIZE` - `DOTNET_ROOT` - `SSH_AUTH_SOCK` - `WARP_USE_SSH_WRAPPER` - `MEMORY_PRESSURE_WRITE` - `XMODIFIERS` - `DESKTOP_SESSION` - `EDITOR` - `PYENV_VERSION` - `PWD` - `XDG_SESSION_DESKTOP` - `LOGNAME` - `XDG_SESSION_TYPE` - `SYSTEMD_EXEC_PID` - `XAUTHORITY` - `GJS_DEBUG_TOPICS` - `GDM_LANG` - `HOME` - `USERNAME` - `LANG` - `LS_COLORS` - `XDG_CURRENT_DESKTOP` - `MEMORY_PRESSURE_WATCH` - `WAYLAND_DISPLAY` - `WARP_HONOR_PS1` - `WARP_COMBINED_PROMPT_COMMAND_GRID` - `SSH_SOCKET_DIR` - `INVOCATION_ID` - `MANAGERPID` - `DOTNET_BUNDLE_EXTRACT_BASE_DIR` - `PYENV_DIR` - `GJS_DEBUG_OUTPUT` - `NVM_DIR` - `GNOME_SETUP_DISPLAY` - `XDG_SESSION_CLASS` - `TERM` - `_CE_CONDA` - `LESSOPEN` - `USER` - `CONDA_SHLVL` - `DISPLAY` - `SHLVL` - `NVM_CD_FLAGS` - `QT_IM_MODULE` - `CONDA_PYTHON_EXE` - `XDG_RUNTIME_DIR` - `PYENV_ROOT` - `DEBUGINFOD_URLS` - `WARP_IS_LOCAL_SHELL_SESSION` - `JOURNAL_STREAM` - `XDG_DATA_DIRS` - `PATH` - `GDMSESSION` - `DBUS_SESSION_BUS_ADDRESS` - `NVM_BIN` - `MAIL` - `GIO_LAUNCHED_DESKTOP_FILE_PID` - `GIO_LAUNCHED_DESKTOP_FILE` - `OLDPWD` - `TERM_PROGRAM` - `PIP_DISABLE_PIP_VERSION_CHECK` - `PYTHONDONTWRITEBYTECODE` - `PYTHONFINDER_IGNORE_UNSUPPORTED` Pipenv–specific environment variables: Debug–specific environment variables: - `PATH`: `/home/wenzexu/.pyenv/versions/3.6.15/bin:/home/wenzexu/.pyenv/versions/3.9.19/bin:/home/wenzexu/.pyenv/versions/3.12.4/bin:/home/wenzexu/.pyenv/versions/3.8.19/bin:/home/wenzexu/.pyenv/versions/3.7.17/bin:/home/wenzexu/.pyenv/versions/3.12.4/bin:/home/wenzexu/.pyenv/libexec:/home/wenzexu/.pyenv/plugins/python-build/bin:/home/wenzexu/.pyenv/plugins/pyenv-virtualenv/bin:/home/wenzexu/.pyenv/plugins/pyenv-update/bin:/home/wenzexu/.pyenv/plugins/pyenv-doctor/bin:/home/wenzexu/.pyenv/shims:/home/wenzexu/.pyenv/bin:/home/wenzexu/.nvm/versions/node/v20.15.0/bin:/home/wenzexu/miniconda3/condabin:/home/wenzexu/.local/bin:/home/wenzexu/bin:/home/wenzexu/.pyenv/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/wenzexu/.dotnet/tools:/home/wenzexu/.cargo/bin:/usr/local/bin:/home/wenzexu/.local/share/JetBrains/Toolbox/scripts:/home/wenzexu/.cargo/bin:/usr/local/bin:/home/wenzexu/.local/share/JetBrains/Toolbox/scripts` - `SHELL`: `/bin/bash` - `EDITOR`: `/usr/bin/nano` - `LANG`: `zh_CN.UTF-8` - `PWD`: `/home/wenzexu` ---------------------------My question is what is the use case of
pipenv install --ignore-pipfile
, to me, there is no difference betweenpipenv install
andpipenv install --ignore-pipfile
.For example:
If I run
pipenv install
:If I run
pipenv install --ignore-pipfile
:No difference at all.
If I want to install from
Pipfile.lock
and really ignore thePipfile
I can runpipenv sync
: