-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Inconsistent behaviour of pip-install when pipenv lock
is run from a setup.py on windows
#3443
Comments
pipenv lock
is run from a setup.py on windows
This was a known issue with timeouts being set incorrectly in the last release, we adjusted the timeouts (which won't fix the underlying issue) and you can also adjust this on the fly for now by setting |
This was actually fixed in #3298 but I haven't pushed a news entry up, I'll make sure to capture that in a pr shortly |
Hm any chance you can confirm if this is working? Just noticed the |
Also @theodox would you mind explaining the goal of your call to |
try:
requires = subprocess.check_output('pipenv lock -r',
stderr=subprocess.STDOUT,
shell=True,
timeout=3,
universal_newlines=True).decode('utf-8').splitlines() Under the new version(s) of pip, nothing causes setuptools to get invoked directly, which means you are never actually If you just want to add things from your pipfile, you can do this (since pipenv is already installed I can assume): import os
from pipenv.vendor.requirementslib.models.pipfile import Pipfile
pipfile = Pipfile.load(os.path.dirname(os.path.abspath(__file__)))
pipfile_requirements = [r for r in pipfile.dev_requirements] + [r for r in pipfile.requirements]
requirement_lines = [r.as_line(include_hashes=False) for r in pipfile_requirements] If you want to do this with the lockfile instead (you really should include the lockfile and not rely on locking on the fly with a 3 second timeout): import os
from pipenv.vendor.requirementslib.models.lockfile import Lockfile
lockfile = Lockfile.load(os.path.dirname(os.path.abspath(__file__)))
lockfile_requirements = [r for r in lockfile.dev_requirements] + [r for r in lockfile.requirements]
requirement_lines = [r.as_line(include_hashes=False) for r in lockfile_requirements] Let me know if any of this is helpful -- the subprocess call in your |
@theodox Could you please recheck with |
Issue description
I'm seeing different results when the same repo is used as an upstream dependency for two different pipenvs. One of them installs as expected with
pipenv
, the other fails with when the repo'ssetup.py
tries to generate therequirements
field using a call topipenv lock -r
. Same code, same OS, same machine -- different result. I added a debug printout to the setup.py and on the failure case it appears the callingpipenv lock
is trying and failing to create a virtualenv (error txt below).I've worked around the issue by converting the setup.py to have a conventional requirements field in
setup()
instead of invokingpipenv
to do so.Expected result
I'd expect that a repo which can be installed as a dependency works the same way for any pipfile in which it is included. AFAICT the only difference between the pipfile which install correctly and the one which does not is that the failing one installs the repo with editable=True -- however I tried installing it with out the -e flag and lock still failed (see below).
Actual result
The setup.py fails with exit code 1. I added a catch around the source of the error and captured the output, which indicates that
pipenv lock -r
is trying and failing to create a virtualenv. Here's the debug spew:Installing the same repo without the editable flag still failed, but with a different error:
Steps to replicate
I can't provide the repo, which is private and company specific. However here's the contents of its pipfile:
and here's the setup.py:
$ pipenv --support
Pipenv version:
'2018.11.26'
Pipenv location:
'c:\\ul\\tools\\python\\python_installs\\371\\lib\\site-packages\\pipenv'
Python location:
'c:\\ul\\tools\\python\\python_installs\\371\\python.exe'
Python installations found:
3.7.1
:C:\ul\tools\python\python_installs\371\python.exe
2.7
:C:\ul\tools\python\python_installs\2715\python.exe
PEP 508 Information:
System environment variables:
ACLOCAL_PATH
ADSK_CLM_WPAD_PROXY_CHECK
ALLUSERSPROFILE
ANSICON
ANSICON_DEF
APPDATA
COMMONPROGRAMFILES
COMPUTERNAME
COMSPEC
CONFIG_SITE
CHOCOLATEYINSTALL
CHOCOLATEYLASTPATHUPDATE
COMMONPROGRAMFILES(X86)
COMMONPROGRAMW6432
CONEMUANSI
CONEMUANSILOG
CONEMUARGS2
CONEMUARGS
CONEMUBACKHWND
CONEMUBASEDIR
CONEMUBUILD
CONEMUCONFIG
CONEMUDIR
CONEMUDRAWHWND
CONEMUDRIVE
CONEMUHWND
CONEMUHOOKS
CONEMUPID
CONEMUPALETTE
CONEMUSERVERPID
CONEMUTASK
CONEMUWORKDIR
CONEMUWORKDRIVE
DISPLAY
DRIVERDATA
DURANGOXDK
EXEPATH
FPS_BROWSER_APP_PROFILE_STRING
FPS_BROWSER_USER_PROFILE_STRING
GPA_GLOBAL_INJECTION_MODE
GPA_UWP_INJECTION_MODE
HOME
HOMEDRIVE
HOMEPATH
HOSTNAME
INFOPATH
INTEL_SEA_FILTER
LANG
LOCALAPPDATA
LOGONSERVER
MANPATH
MAYA_DISABLE_CER
MAYA_DISABLE_CIP
MAYA_DISABLE_CLIC_IPM
MINGW_CHOST
MINGW_PACKAGE_PREFIX
MINGW_PREFIX
MSYSTEM
MSYSTEM_CARCH
MSYSTEM_CHOST
MSYSTEM_PREFIX
NUMBER_OF_PROCESSORS
OLDPWD
ORIGINAL_PATH
ORIGINAL_TEMP
ORIGINAL_TMP
OS
PATH
PATHEXT
PKG_CONFIG_PATH
PLINK_PROTOCOL
PROCESSOR_ARCHITECTURE
PROCESSOR_IDENTIFIER
PROCESSOR_LEVEL
PROCESSOR_REVISION
PROGRAMFILES
PROJECT_HOME
PS1
PSMODULEPATH
PUBLIC
PWD
PROGRAMDATA
PROGRAMFILES(X86)
PROGRAMW6432
SESSIONNAME
SHELL
SHLVL
SSH_ASKPASS
SYSTEMDRIVE
SYSTEMROOT
TEMP
TERM
TMP
TMPDIR
UL_ENGINE
UL_PROJECT
USERDNSDOMAIN
USERDOMAIN
USERDOMAIN_ROAMINGPROFILE
USERNAME
USERPROFILE
VS140COMNTOOLS
WINDIR
WORKON_HOME
XBOXONEEXTENSIONSDKLATEST
XBOXONEXDKLATEST
_
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PIP_SHIMS_BASE_MODULE
PIP_PYTHON_PATH
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenvûspecific environment variables:
Debugûspecific environment variables:
PATH
:C:\Users\Steve\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\cmd;C:\Program Files\ConEmu\ConEmu\Scripts;C:\Program Files\ConEmu;C:\Program Files\ConEmu\ConEmu;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\OpenVPN\bin;C:\Program Files\Perforce;C:\Program Files (x86)\Xoreax\IncrediBuild;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ul\New folder\products\bin;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\Skype\Phone;C:\Program Files\Autodesk\Maya2016\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Perforce;C:\Users\Steve\AppData\Local\Microsoft\WindowsApps;C:\ul\labware\products\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;C:\ul\labware\products\bin;C:\ul\tools\python\python_installs\371\Scripts;C:\ul\tools\python\python_installs\371;C:\Users\Steve\AppData\Local\Programs\Python\Launcher;C:\ul\tools\python\python37\Scripts;C:\ul\tools\python\python37;C:\Users\Steve\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
SHELL
:C:\Program Files\Git\usr\bin\bash.exe
LANG
:en_US.UTF-8
PWD
:C:/ul/tools/python/launchpad
Contents of
Pipfile
('C:\ul\tools\python\launchpad\Pipfile'):The text was updated successfully, but these errors were encountered: