Skip to content

Commit

Permalink
Merge pull request #101 from Yelp/less-dependencies
Browse files Browse the repository at this point in the history
Removing unidiff from standard dependencies
  • Loading branch information
domanchi authored Dec 10, 2018
2 parents 564615f + 687074b commit d378815
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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

0 comments on commit d378815

Please sign in to comment.