Skip to content

Commit

Permalink
Fix flake8 lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Ryan committed Sep 8, 2017
1 parent 698e419 commit d1d3e73
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
25 changes: 13 additions & 12 deletions pipenv/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def resolve_deps(deps, sources=None, verbose=False, hashes=False):
cleaned_releases = {}
for api_version, api_info in api_releases.items():
cleaned_releases[clean_pkg_version(api_version)] = api_info

for release in cleaned_releases[version]:
collected_hashes.append(release['digests']['sha256'])

Expand Down Expand Up @@ -259,6 +259,7 @@ def is_vcs(pipfile_entry):


def pep440_version(version):
"""Normalize version to PEP 440 standards"""
# use pip built in version parser
return str(pip.index.parse_version(version))

Expand Down Expand Up @@ -351,14 +352,14 @@ def walk_up(bottom):


def find_requirements(max_depth=3):
"""Returns the path of a Pipfile in parent directories."""
i = 0
for c, d, f in walk_up(os.getcwd()):
i += 1

if i < max_depth:
if 'requirements.txt':
r = os.path.join(c, 'requirements.txt')
if os.path.isfile(r):
return r
raise RuntimeError('No requirements.txt found!')
"""Returns the path of a Pipfile in parent directories."""
i = 0
for c, d, f in walk_up(os.getcwd()):
i += 1

if i < max_depth:
if 'requirements.txt':
r = os.path.join(c, 'requirements.txt')
if os.path.isfile(r):
return r
raise RuntimeError('No requirements.txt found!')
2 changes: 1 addition & 1 deletion tests/test_pipenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_cli_usage(self):
assert delegator.run('pipenv --python python').return_code == 0
assert delegator.run('pipenv install Werkzeug').return_code == 0
assert delegator.run('pipenv install pytest --dev').return_code == 0
assert delegator.run('pipenv install regex').return_code == 0 # failing before
assert delegator.run('pipenv install regex').return_code == 0 # failing before
assert delegator.run('pipenv install git+https://github.com/requests/requests.git@v2.18.4#egg=requests').return_code == 0
assert delegator.run('pipenv lock').return_code == 0

Expand Down

0 comments on commit d1d3e73

Please sign in to comment.