-
-
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
Pass 'allow_global' to resolve_deps #1097
Pass 'allow_global' to resolve_deps #1097
Conversation
techalchemy
commented
Nov 19, 2017
- Fixes Pipenv doesn't resolve --system python correctly. #1002
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get a test on this and then I think we're set.
Once I remember how to cause the problem |
@techalchemy I think there is bug here. I think You should add it. |
Yep, this is the same thing that wasn't addressed in the last attempted patch for this. Good spot @galuszkak, thanks! |
- Add --system Flag to all CLI functions that interact with python environments - Add 'envvar' parameter to click options to parse into system flag if we miss it in environments.py
OK, and now we pray to the ci gods. That was a good catch, and I realized we aren't passing the |
@kennethreitz and this is the rest of why i needed |
pipenv/cli.py
Outdated
@@ -1764,7 +1766,7 @@ def do_py(system=False): | |||
@click.option('--dev', '-d', is_flag=True, default=False, help="Install package(s) in [dev-packages].") | |||
@click.option('--three/--two', is_flag=True, default=None, help="Use Python 3/2 when creating virtualenv.") | |||
@click.option('--python', default=False, nargs=1, help="Specify which version of Python virtualenv should use.") | |||
@click.option('--system', is_flag=True, default=False, help="System pip management.") | |||
@click.option('--system', is_flag=True, default=False, help="System pip management.", envvar='PIPENV_USE_SYSTEM') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't use envvar anywhere else -- I don't think it's inherently bad, but i think we should stick to the conventions established.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk, I wasn't sure so I'll nix it
I don't think the title of this pull request encapsulates what's going on here, which is a lot. What are you trying to accomplish, specifically? |
pipenv/cli.py
Outdated
@@ -1970,7 +1972,7 @@ def uninstall( | |||
system = True | |||
|
|||
# Ensure that virtualenv is available. | |||
ensure_project(three=three, python=python) | |||
ensure_project(three=three, python=python, system=system) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kennethreitz are you ok with this change in particular? this is for uninstall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this essentially just doesn't create a virtualenv
This doesn't work, because now we still I don't know. What is the best option here? |
From a reviewing standpoint, can we get a few changes made It's difficult to tell what this issue is about now, could we get a brief synopsis of the problem and the proposed solution in the original post? There are now multiple sytlistic changes in the PR which make telling which changes are relevant and which are cosmetic difficult. Let's spin cleanup off to a new PR if we need to make those changes. We don't have a hard cap at 80 though, so I'm not sure they're needed. The test also isn't very clear what it's trying to prove. Can we get a docstring on that? |
Ok. Let me describe the problem. I am a user. I am using pipenv with When we resolve currently, we create a fake python version using I would like to note that this error doesn't occur in master due to the use of a backup resolver: python_path = which('python', allow_global=allow_global)
backup_python_path = shellquote(sys.executable) But I don't really feel like that is a justification for leaving what is definitively a bug in the code. I have now spent a significant amount of time explaining why we should pass a necessary argument to a function that expects it, trying to prove that the issue did exist, create a test for a thing that can't currently be reproduced, and this feels pretty silly at this point so I'll undo all of my changes and if that still isn't sufficient I'll just close the pull request and we can leave the bug in the code. |
f64e739
to
e244e45
Compare
@techalchemy in original issue I attached how to reproduce it. If You are unable to do so I can create instruction or code that reproduce that issue from ground, and put it in repository. Thanks for hard work on that @techalchemy |
@galuszkak no worries I grabbed your instructions and included them in the docstring for the test. It just took me awhile to figure out what exactly caused it to error out, turns out the projects first parent has to be |
my inclination here is that when using install --system, lock and other
commands are not useful or needed, and that virtualenv creation is
neccessary for those features (e.g. the current implementation is just
fine).
…On Tue, Nov 21, 2017 at 12:34 AM, Dan Ryan ***@***.***> wrote:
@galuszkak <https://github.com/galuszkak> no worries I grabbed your
instructions and included them in the docstring for the test. It just took
me awhile to figure out what exactly caused it to error out, turns out the
projects first parent has to be / as well. We’ll see if this one passes
muster.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/kennethreitz/pipenv/pull/1097#issuecomment-345921895>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHUVYhixDN7Y_kw2ZtSkubQQS4vrjHkks5s4mDdgaJpZM4QjfPM>
.
|
@kennethreitz for me that contradicts purpose. So proposed solution with Docker workflow is using --system (per documentation), but when I want to pindown version through docker workflow You are saying it's not necessary. For me it doesn't matter if it's with --system flag or not, I expect that for example |
I envision a dock or user generating a locked file before sending things to Docker, always
…Sent from my iPad
On Nov 21, 2017, at 3:55 AM, Kamil Gałuszka ***@***.***> wrote:
@kennethreitz for me that contradicts purpose. So proposed solution with Docker workflow is using --system (per documentation), but when I want to pindown version through docker workflow You are saying it's not necessary. For me it doesn't matter if it's with --system flag or not, I expect that for example pipenv lock will work correctly with or without that flag, because people have different workflows, and if they are using docker they don't need virtualenv because they isolate on container level, and they still need Pipfile.lock for their peer workers when they will work on that codebase.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
In other words this functionality is offered for deployments not for development workflow
…Sent from my iPad
On Nov 21, 2017, at 3:55 AM, Kamil Gałuszka ***@***.***> wrote:
@kennethreitz for me that contradicts purpose. So proposed solution with Docker workflow is using --system (per documentation), but when I want to pindown version through docker workflow You are saying it's not necessary. For me it doesn't matter if it's with --system flag or not, I expect that for example pipenv lock will work correctly with or without that flag, because people have different workflows, and if they are using docker they don't need virtualenv because they isolate on container level, and they still need Pipfile.lock for their peer workers when they will work on that codebase.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@techalchemy I think this PR needs to be rebased. Is this PR waiting still for review of @kennethreitz ? |
…l-resolving Pass 'allow_global' to resolve_deps