-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix removal of incorrect packages for pipfiles with comments on preceding lines - Improved error handling and added a framework for exception handling - Fixes #2411 - Fixes #3099 - Fixes #2885 - Fixes #1977 Signed-off-by: Dan Ryan <dan@danryan.co>
- Loading branch information
1 parent
2835ff5
commit b57240d
Showing
7 changed files
with
161 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Improved exceptions and error handling on failures. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added improved messaging about available but skipped updates due to dependency conflicts when running ``pipenv update --outdated``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fixed a bug which caused uninstallation to sometimes fail to successfullly remove packages from ``Pipfiles`` with comments on preceding or following lines. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fixed a bug which caused uninstallation to sometimes fail to successfullly remove packages from ``Pipfiles`` with comments on preceding or following lines. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# -*- coding=utf-8 -*- | ||
from .vendor.click.exceptions import ( | ||
ClickException, | ||
Abort, | ||
Exit, | ||
UsageError, | ||
BadParameter, | ||
FileError, | ||
MissingParameter, | ||
BadOptionUsage | ||
) | ||
from .vendor.click import echo as click_echo | ||
from .core import project, fix_utf8 | ||
from .patched import crayons | ||
|
||
|
||
class PipenvException(ClickException): | ||
pass | ||
|
||
|
||
class PipfileNotFound(ClickException): | ||
message = "{0}: Pipfile is missing! Cannot proceed.".format( | ||
crayons.red("Error", bold=True), | ||
) | ||
|
||
|
||
class LockfileNotFound(ClickException): | ||
message = "{0}: Pipfile.lock is missing! You need to run {1} first.".format( | ||
crayons.red("Error", bold=True), crayons.red("$ pipenv lock", bold=True) | ||
) | ||
|
||
|
||
class DeployException(ClickException): | ||
message = crayons.normal("Aborting deploy", bold=True) | ||
|
||
|
||
class PipenvOptionsError(BadOptionUsage): | ||
def format_message(self): | ||
return "{0}: {1}".format(crayons.red("Warning", bold=True), self.message) | ||
|
||
|
||
class PipfileException(FileError): | ||
def __init__(self, hint=None): | ||
hint = "{0} {1}".format(crayons.red("ERROR (PACKAGE NOT INSTALLED):"), hint) | ||
filename = project.pipfile_location | ||
super(PipfileException, self).__init__(filename, hint) | ||
|
||
|
||
class SetupException(ClickException): | ||
pass | ||
|
||
|
||
class VirtualenvException(ClickException): | ||
def __init__(self, message=None): | ||
if not message: | ||
message = ( | ||
"There was an unexpected error while activating your virtualenv. " | ||
"Continuing anyway..." | ||
) | ||
message = fix_utf8("{0}: {1}".format(crayons.red("Warning", bold=True), message)) | ||
super(VirtualenvException, self).__init__(message) | ||
|
||
|
||
class VirtualenvActivationException(VirtualenvException): | ||
message = ( | ||
"activate_this.py not found. Your environment is most certainly " | ||
"not activated. Continuing anyway…" | ||
) | ||
|
||
|
||
class VirtualenvCreationException(VirtualenvException): | ||
message = "Failed to create virtual environment." |
Oops, something went wrong.