Skip to content
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

Conversation

techalchemy
Copy link
Member

@cs01
Copy link
Member

cs01 commented Nov 18, 2017

Super fast fix, thanks! How long until this makes its way into PyPI?

@nateprewitt
Copy link
Member

nateprewitt commented Nov 18, 2017

@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.

@techalchemy
Copy link
Member Author

Wow appveyor is 100% broken... erm...

@techalchemy
Copy link
Member Author

This fix definitely works but i dont know if it's a good idea

@techalchemy
Copy link
Member Author

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

@erinxocon
Copy link
Contributor

@techalchemy It could be that we just have a lot of builds going on right now, with my new branch and PR

@techalchemy techalchemy added the Status: Requires Approval This issue requires additional approval to move forward. label Nov 20, 2017
@techalchemy
Copy link
Member Author

@kennethreitz this is partly why I needed --system available

@techalchemy techalchemy removed the Status: Requires Approval This issue requires additional approval to move forward. label Nov 20, 2017
@techalchemy techalchemy force-pushed the bugfix/1080-install-packages-on-run-after-create branch from a2651f0 to 20dad57 Compare November 20, 2017 22:04
@techalchemy techalchemy removed the request for review from kennethreitz November 20, 2017 22:05
@techalchemy techalchemy changed the title Install packages from Pipfile after creating env Warn users who try to use pipenv run before installing packages Nov 20, 2017
@techalchemy techalchemy force-pushed the bugfix/1080-install-packages-on-run-after-create branch from 73e01e7 to 847bfb6 Compare November 20, 2017 22:58
pipenv/cli.py Outdated
),
err=True
)
sys.exit(1)
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cs01 absolutely not.

Copy link
Member

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.

@techalchemy techalchemy force-pushed the bugfix/1080-install-packages-on-run-after-create branch from a6e021b to 7ea769d Compare November 20, 2017 23:43
pipenv/cli.py Outdated
),
err=True
)
sys.exit(1)
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Member Author

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.

@kennethreitz
Copy link
Contributor

kennethreitz commented Nov 20, 2017 via email

@techalchemy
Copy link
Member Author

@kennethreitz explain what is happening to what

@techalchemy
Copy link
Member Author

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
@techalchemy techalchemy force-pushed the bugfix/1080-install-packages-on-run-after-create branch 2 times, most recently from cc13677 to 633abd7 Compare November 21, 2017 00:36
@techalchemy
Copy link
Member Author

ok seems like whenever we reverted that stuff it fixed appveyor's issues so we're all good on that end

@techalchemy
Copy link
Member Author

@kennethreitz
Copy link
Contributor

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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove "for example"

@techalchemy techalchemy deleted the bugfix/1080-install-packages-on-run-after-create branch April 1, 2018 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants