-
-
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
Warn users who try to use pipenv run before installing packages #1091
Warn users who try to use pipenv run before installing packages #1091
Conversation
techalchemy
commented
Nov 18, 2017
- Fixes a way to tell that the virtualenv and Pipfile.lock are in sync? #1080
- Currently, pipenv run will create a virtualenv if one doesnt exist
- However, it will not install packages if it needs to
- This allows us to install packages only if we have a new venv
Super fast fix, thanks! How long until this makes its way into PyPI? |
@cs01 We're unfortunately in a bit of a release freeze until we have everything ready for 9.0.0. I wanted to get it landed this week but we'll likely look at releasing something after Thanksgiving. |
Wow appveyor is 100% broken... erm... |
This fix definitely works but i dont know if it's a good idea |
These CI builds ran super slow... it’s possible this check is the cause. Don’t merge yet, I’ll just add some logic to bypass in most cases |
@techalchemy It could be that we just have a lot of builds going on right now, with my new branch and PR |
@kennethreitz this is partly why I needed --system available |
a2651f0
to
20dad57
Compare
73e01e7
to
847bfb6
Compare
pipenv/cli.py
Outdated
), | ||
err=True | ||
) | ||
sys.exit(1) |
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.
any chance an exception such as PipenvMissingVirtualenv
could be thrown so it could be caught and handled?
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.
Probably not since this is a CLI application, I'm guessing we will want to stick to exit codes
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.
$ pipenv install
should be the same color as literally every other shell example we spit out.
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.
@cs01 absolutely not.
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.
Ah yeah that makes sense. I only asked because I want to be able to programatically tell if I can skip running pipenv install
or not. This would take care of that too.
a6e021b
to
7ea769d
Compare
pipenv/cli.py
Outdated
), | ||
err=True | ||
) | ||
sys.exit(1) |
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.
$ pipenv install
should be the same color as literally every other shell example we spit out.
pipenv/utils.py
Outdated
@@ -843,6 +843,15 @@ def is_installable_file(path): | |||
path = urlparse(path['file']).path if 'file' in path else path['path'] | |||
if not isinstance(path, six.string_types) or path == '*': | |||
return False | |||
# If the string starts with a valid specifier operator, test if it is a valid |
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 seems like this should be in a seperate pull request, i have no idea what this is doing.
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.
it was required to pass appveyor tests in this one.
explain what is happening
…On Mon, Nov 20, 2017 at 6:48 PM, Dan Ryan ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pipenv/utils.py
<https://github.com/kennethreitz/pipenv/pull/1091#discussion_r152144055>:
> @@ -843,6 +843,15 @@ def is_installable_file(path):
path = urlparse(path['file']).path if 'file' in path else path['path']
if not isinstance(path, six.string_types) or path == '*':
return False
+ # If the string starts with a valid specifier operator, test if it is a valid
it was required to pass appveyor tests in this one.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/kennethreitz/pipenv/pull/1091#discussion_r152144055>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHUVeGI1JYfv3bYnHkW-mSGtC5T0xFAks5s4g_YgaJpZM4Qi0R8>
.
|
@kennethreitz explain what is happening to what |
If you're asking what was happening with regard to the specifier check, the appveyor builds are here and I excerpted the error below. This cropped up whenever the dependency resolution issue got extra visibility recently but I'm not sure what caused it or why. Let me try to remove it since it's not affecting any other prs, and i'll rebase onto master and squash OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '>=3.3.0,<4'
Command exited with code 1 |
- Fixes pypa#1080 - Currently, pipenv run will create a virtualenv if one doesnt exist - Now we will warn users if they are not using CI/System python - Tell them to run $ pipenv install - Catch pathlib.Path creation exception and return false - Add tests for run before install - Fix dotenv test which only called pipenv run before
cc13677
to
633abd7
Compare
ok seems like whenever we reverted that stuff it fixed appveyor's issues so we're all good on that end |
Py27 failure is transient: https://ci.appveyor.com/project/techalchemy/pipenv/build/job/0o0fv1wi20e725tv |
rebase required |
# This isn't required if we are in CI or are using system python | ||
if not project.virtualenv_exists and not PIPENV_USE_SYSTEM and not 'CI' in os.environ: | ||
click.echo( | ||
u'This project has no virtualenv yet! Use $ {0}, for example, to create one.'.format( |
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.
remove "for example"