variable expansion doesnt work inside Pipfile in order to install from a private repo
Issue description
I am trying to install a dependency from a private repo in order to this I have the following line
data = {editable = true, ref = "branch", git="https://${USER}:${ACCESS_TOKEN}@gitlab.com/private/repo"}
If I hardcode USER and ACCESS_TOKEN this work perfectly but not with shell expansion in order to pick the vairbles
Expected result
install packages and keep the env expansion inside the Pipfile and Pipfile.lock
Actual result
I cannot install from private repo without hardcode USER and ACCESS_TOKEN
Steps to replicate
Create a private repo in gitlab or github Create a env variables with your user and password Try to install that repository
$ pipenv --support
Pipenv version: '2022.6.7'
Pipenv location: '/home/user/a/.venv/lib/python3.9/site-packages/pipenv'
Python location: '/home/user/a/.venv/bin/python'
Python installations found:
3.9.12:/home/user/a/.venv/bin/python3.93.9.12:/home/user/a/.venv/bin/python3.9.12:/home/user/a/.venv/bin/python33.9.12:/home/user/a/.venv/bin/python3.93.9.12:/home/user/a/.venv/bin/python3.9.12:/home/user/a/.venv/bin/python33.9.12:/home/user/anaconda3/bin/python3.93.9.12:/home/user/anaconda3/bin/python3.9.12:/home/user/anaconda3/bin/python33.8.13:/home/user/.pyenv/versions/3.8.13/bin/python3.8.10:/home/user/.pyenv/versions/3.8.10/bin/python3.8.10:/usr/bin/python33.8.10:/usr/bin/python3.83.8.10:/bin/python33.8.10:/bin/python3.83.6.15:/home/user/.pyenv/versions/3.6.15/bin/python3.63.6.0:/home/user/.pyenv/versions/3.6.0/bin/python3.62.7.18:/usr/bin/python22.7.18:/usr/bin/python2.7.18:/usr/bin/python2.72.7.18:/bin/python22.7.18:/bin/python2.7.18:/bin/python2.7
PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '3.9.12',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '5.13.0-52-generic',
'platform_system': 'Linux',
'platform_version': '#59~20.04.1-Ubuntu SMP Thu Jun 16 21:21:28 UTC 2022',
'python_full_version': '3.9.12',
'python_version': '3.9',
'sys_platform': 'linux'}
System environment variables:
SHELLSESSION_MANAGERQT_ACCESSIBILITYCOLORTERMXDG_CONFIG_DIRSNVM_INCXDG_MENU_PREFIXTERM_PROGRAM_VERSIONGNOME_DESKTOP_SESSION_IDAPPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNELGNOME_SHELL_SESSION_MODESSH_AUTH_SOCKXMODIFIERSDESKTOP_SESSIONSSH_AGENT_PIDNO_AT_BRIDGEGTK_MODULESDBUS_STARTER_BUS_TYPEPWDKRB5CCNAMEXDG_SESSION_DESKTOPLOGNAMEXDG_SESSION_TYPEGPG_AGENT_INFOXAUTHORITYVSCODE_GIT_ASKPASS_NODEGJS_DEBUG_TOPICSWINDOWPATHHOMEUSERNAMEIM_CONFIG_PHASELANGLS_COLORSXDG_CURRENT_DESKTOPVTE_VERSIONGIT_ASKPASSGNOME_TERMINAL_SCREENINVOCATION_IDMANAGERPIDCHROME_DESKTOPGJS_DEBUG_OUTPUTNVM_DIRVSCODE_GIT_ASKPASS_EXTRA_ARGSLESSCLOSEXDG_SESSION_CLASSTERMLESSOPENLIBVIRT_DEFAULT_URIUSERVSCODE_GIT_IPC_HANDLEGNOME_TERMINAL_SERVICEDISPLAYSHLVLNVM_CD_FLAGSQT_IM_MODULEDBUS_STARTER_ADDRESSXDG_RUNTIME_DIRPYENV_ROOTVSCODE_GIT_ASKPASS_MAINJOURNAL_STREAMXDG_DATA_DIRSGDK_BACKENDPATHGDMSESSIONORIGINAL_XDG_CURRENT_DESKTOPDBUS_SESSION_BUS_ADDRESSNVM_BINGIO_LAUNCHED_DESKTOP_FILE_PIDGIO_LAUNCHED_DESKTOP_FILETERM_PROGRAM_OLDPWDP9K_TTY_P9K_TTYZSHPAGERLESSLSCOLORSP9K_SSHNOMAD_ADDRNOMAD_CLIENT_CERTNOMAD_CLIENT_KEYNOMAD_CACERTNOMAD_TOKENCONSUL_HTTP_ADDRCONSUL_HTTP_SSLCONSUL_HTTP_SSL_VERIFYCONSUL_CLIENT_CERTCONSUL_CLIENT_KEYCONSUL_CACERTCONSUL_HTTP_TOKENKAFKA_BINKAFKA_CONFIGGOPATHPYENV_SHELLPIPENV_VENV_IN_PROJECTbuildtime_USER_ACCESS_TOKENbuildtime_ACCESS_TOKENCONDA_EXE_CE_M_CE_CONDACONDA_PYTHON_EXECONDA_SHLVLPIP_DISABLE_PIP_VERSION_CHECKPYTHONDONTWRITEBYTECODEPIP_PYTHON_PATHPIPENV_ACTIVECONDA_PREFIXCONDA_DEFAULT_ENVCONDA_PROMPT_MODIFIERVIRTUAL_ENVPS1PIP_SHIMS_BASE_MODULEPYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
PIPENV_VENV_IN_PROJECT:enabledPIPENV_ACTIVE:1
Debug–specific environment variables:
PATH:/home/user/a/.venv/bin:/home/user/bin:/home/user/.local/bin:/usr/local/bin:/home/user/anaconda3/bin:/home/user/Software/Kafka/bin:/home/user/.nvm/versions/node/v16.14.0/bin:/home/user/bin:/home/user/.local/bin:/usr/local/bin:/home/user/anaconda3/condabin:/home/user/Software/Kafka/bin:/home/user/.nvm/versions/node/v16.14.0/bin:/home/user/.poetry/bin:/home/user/.pyenv/shims:/home/user/.pyenv/bin:/home/user/.local/bin:/home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/user/.fzf/bin:/home/user/bin:/home/user/bin:/usr/local/go/bin:/home/user/go/bin:/home/user/bin:/home/user/anaconda3/bin:/usr/local/go/bin:/home/user/go/bin:/home/user/bin:/home/user/anaconda3/binSHELL:/bin/bashLANG:es_ES.UTF-8PWD:/home/user/aVIRTUAL_ENV:/home/user/a/.venv
Contents of Pipfile ('/home/user/a/Pipfile'):
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
data = {editable = true, ref = "branch", git="https://${USER}:'${buildtime_ACCESS_TOKEN}'@gitlab.com/private/repo"}
[dev-packages]
pytest = "*"
[requires]
python_version = "3.9"
[scripts]
start = "python src/main.py"
test = "pytest -s"
I was not able to reproduce this issue. You can see in my output that it expanded the credentials I exported into the shell ahead of time. I didn't specify a real private repo to test this, but its apparent that the variables were expanded for me. @Tlaloc-Es Can you elaborate on your system and the steps you took?
(pipenv-5153) matteius@matteius-VirtualBox:~/pipenv-triage/pipenv-5153$ export USER=test
(pipenv-5153) matteius@matteius-VirtualBox:~/pipenv-triage/pipenv-5153$ export ACCESS_TOKEN=test
(pipenv-5153) matteius@matteius-VirtualBox:~/pipenv-triage/pipenv-5153$ pipenv lock -v
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
ERROR:pip.subprocessor:[present-diagnostic] git clone --filter=blob:none 'https://test:****@gitlab.com/private/repo' /tmp/pipenv-ayxamgxu-src/data exited with 128
....
pipenv.patched.notpip._internal.exceptions.InstallationSubprocessError: git clone --filter=blob:none 'https://test:****@gitlab.com/private/repo' /tmp/pipenv-ayxamgxu-src/data exited with 128
✘ Locking Failed!
(pipenv-5153) matteius@matteius-VirtualBox:~/pipenv-triage/pipenv-5153$ ls
Pipfile
(pipenv-5153) matteius@matteius-VirtualBox:~/pipenv-triage/pipenv-5153$ cat Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
data = {editable = true, ref = "branch", git="https://${USER}:${ACCESS_TOKEN}@gitlab.com/private/repo"}
[dev-packages]
[requires]
python_version = "3.10"
@Tlaloc-Es Can you check with pipenv=2022.8.31?