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

Removing unidiff from standard dependencies #101

Merged
merged 1 commit into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions detect_secrets/core/secrets_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
from time import gmtime
from time import strftime

from unidiff import PatchSet
from unidiff.errors import UnidiffParseError

from detect_secrets import VERSION
from detect_secrets.core.log import log
from detect_secrets.core.potential_secret import PotentialSecret
Expand Down Expand Up @@ -128,6 +125,11 @@ def scan_diff(
:type repo_name: str
:param repo_name: used for logging only -- the name of the repo
"""
# Local imports, so that we don't need to require unidiff for versions of
# detect-secrets that don't use it.
from unidiff import PatchSet
from unidiff.errors import UnidiffParseError

try:
patch_set = PatchSet.from_string(diff)
except UnidiffParseError: # pragma: no cover
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
keywords=['secret-management', 'pre-commit', 'security', 'entropy-checks'],
install_requires=[
'pyyaml',
'unidiff',
],
extras_require={
':python_version=="2.7"': [
Expand Down