From c92b1b6a33fa36ee5cf062a561844884b34ded6c Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Tue, 3 Oct 2017 23:17:46 -0600 Subject: [PATCH 1/5] used pipenv check --style to make this compliant with pep8. Style :) --- pipenv/cli.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 4a32371e..84589cc0 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -44,9 +44,9 @@ from . import pep508checker, progress from . import environments from .environments import ( PIPENV_COLORBLIND, PIPENV_NOSPIN, PIPENV_SHELL_FANCY, - PIPENV_VENV_IN_PROJECT, PIPENV_USE_SYSTEM, PIPENV_TIMEOUT, - PIPENV_SKIP_VALIDATION, PIPENV_HIDE_EMOJIS, PIPENV_INSTALL_TIMEOUT, - PYENV_ROOT, PYENV_INSTALLED, PIPENV_YES, PIPENV_DONT_LOAD_ENV, + PIPENV_VENV_IN_PROJECT, PIPENV_TIMEOUT, PIPENV_SKIP_VALIDATION, + PIPENV_HIDE_EMOJIS, PIPENV_INSTALL_TIMEOUT, PYENV_ROOT, + PYENV_INSTALLED, PIPENV_YES, PIPENV_DONT_LOAD_ENV, PIPENV_DEFAULT_PYTHON_VERSION, PIPENV_MAX_SUBPROCESS, PIPENV_DONT_USE_PYENV, SESSION_IS_INTERACTIVE, PIPENV_USE_SYSTEM, PIPENV_DOTENV_LOCATION, PIPENV_SHELL @@ -409,7 +409,6 @@ def ensure_python(three=None, python=None): ), err=True ) - global USING_DEFAULT_PYTHON # Add pyenv paths to PATH. @@ -759,7 +758,6 @@ def do_install_dependencies( ) ) - # Allow pip to resolve dependencies when in skip-lock mode. no_deps = (not skip_lock) @@ -1128,7 +1126,6 @@ def do_lock(verbose=False, system=False, clear=False, pre=False): click.echo('Please run $ {0} to re-create your environment.'.crayons.red('pipenv --rm')) sys.exit(1) - # Write out the lockfile. with open(project.lockfile_location, 'w') as f: simplejson.dump(lockfile, f, indent=4, separators=(',', ': '), sort_keys=True) @@ -1545,6 +1542,7 @@ def warn_in_virtualenv(): ), err=True ) + def kr_easter_egg(package_name): if package_name in ['requests', 'maya', 'crayons', 'delegator.py', 'records', 'tablib', 'background', 'clint']: @@ -1968,7 +1966,6 @@ def lock(three=None, python=False, verbose=False, requirements=False, clear=Fals if not pre: pre = project.settings.get('pre') - if requirements: do_init(dev=True, requirements=requirements) @@ -2270,7 +2267,6 @@ def check(three=None, python=False, unused=False, style=False, args=None): sys.exit(1) - @click.command(help=u"Displays currently–installed dependency graph information.") @click.option('--bare', is_flag=True, default=False, help="Minimal output.") @click.option('--json', is_flag=True, default=False, help="Output JSON.") @@ -2329,6 +2325,7 @@ def graph(bare=False, json=False): # Return its return code. sys.exit(c.return_code) + @click.command(help="View a given module in your editor.", name="open") @click.option('--three/--two', is_flag=True, default=None, help="Use Python 3/2 when creating virtualenv.") @click.option('--python', default=False, nargs=1, help="Specify which version of Python virtualenv should use.") @@ -2356,7 +2353,6 @@ def run_open(module, three=None, python=None): sys.exit(0) - @click.command(help="Uninstalls all packages, and re-installs package(s) in [packages] to latest compatible versions.") @click.argument('package_name', default=False) @click.option('--verbose', '-v', is_flag=True, default=False, help="Verbose mode.") @@ -2372,7 +2368,7 @@ def update(ctx, dev=False, three=None, python=None, dry_run=False, bare=False, d # Ensure that virtualenv is available. ensure_project(three=three, python=python, validate=False) - + concurrent = (not sequential) # --dry-run: @@ -2479,7 +2475,6 @@ def update(ctx, dev=False, three=None, python=None, dry_run=False, bare=False, d ) - # Install click commands. cli.add_command(graph) cli.add_command(install) From 1a6dfe121d0788fd636c5ace9f961d45e4612b5d Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Tue, 3 Oct 2017 23:20:31 -0600 Subject: [PATCH 2/5] added a blank line --- pipenv/project.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pipenv/project.py b/pipenv/project.py index 3205e0e8..c96a2e86 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -24,6 +24,7 @@ if PIPENV_PIPFILE: else: PIPENV_PIPFILE = os.path.abspath(PIPENV_PIPFILE) + class Project(object): """docstring for Project""" From 63331fa53ea31a3768517ef29ad1d0f43d11312b Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Tue, 3 Oct 2017 23:27:16 -0600 Subject: [PATCH 3/5] fixed pep8 errors from flake8 for legacy tests --- tests/test_legacy.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/test_legacy.py b/tests/test_legacy.py index 20a3706e..a9c1df5e 100644 --- a/tests/test_legacy.py +++ b/tests/test_legacy.py @@ -2,14 +2,9 @@ import os from mock import patch, Mock, PropertyMock -import pytest -from pipenv.vendor import toml -from pipenv.vendor import delegator - from pipenv.cli import ( - activate_virtualenv, ensure_proper_casing, pip_install, pip_download + pip_install, pip_download ) -from pipenv.project import Project # Tell pipenv to ignore activated virtualenvs. os.environ['PIPENV_IGNORE_VIRTUALENVS'] = 'True' From 2d1a0e06023b27cd9cb577a55ecafdc50f772802 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Tue, 3 Oct 2017 23:29:01 -0600 Subject: [PATCH 4/5] flake 8 stuff for the main test suite --- tests/test_pipenv.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index ab115ebd..5aedbb98 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -12,6 +12,7 @@ from pipenv.project import Project os.environ['PIPENV_DONT_USE_PYENV'] = '1' + class PipenvInstance(): """An instance of a Pipenv Project...""" def __init__(self, pipfile=True, chdir=False): @@ -325,7 +326,7 @@ tpfd = "*" c = p.pipenv('run python -c "import requests; import idna; import certifi; import records; import tpfd; import parse;"') assert c.return_code == 0 - + @pytest.mark.sequential @pytest.mark.install @pytest.mark.update @@ -348,13 +349,13 @@ records = "*" assert 'urllib3' in p.lockfile['default'] assert 'certifi' in p.lockfile['default'] assert 'records' in p.lockfile['default'] - + c = p.pipenv('run python -c "import requests; import idna; import certifi; import records;"') assert c.return_code == 0 - + c = p.pipenv('update --sequential') - assert c.return_code == 0 - + assert c.return_code == 0 + assert 'requests' in p.lockfile['default'] assert 'idna' in p.lockfile['default'] assert 'urllib3' in p.lockfile['default'] @@ -362,7 +363,7 @@ records = "*" assert 'records' in p.lockfile['default'] c = p.pipenv('run python -c "import requests; import idna; import certifi; import records;"') - assert c.return_code == 0 + assert c.return_code == 0 @pytest.mark.run @pytest.mark.markers @@ -480,7 +481,6 @@ requests = {version = "*"} assert 'path' in p.pipfile['dev-packages'][key] assert 'requests' in p.lockfile['develop'] - @pytest.mark.code @pytest.mark.install def test_code_import_manual(self): @@ -582,7 +582,6 @@ pytest = "==3.1.1" for req in req_list: assert req in c.out - @pytest.mark.lock @pytest.mark.requirements @pytest.mark.complex From 5a297c094b8bb5dce0269aeb5f585264d932d713 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Tue, 3 Oct 2017 23:29:11 -0600 Subject: [PATCH 5/5] more flake 8 --- tests/test_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_project.py b/tests/test_project.py index af56438e..3375415c 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -3,7 +3,7 @@ from pipenv.vendor import delegator class TestProject(): - + def test_proper_names(self): proj = pipenv.project.Project() assert proj.virtualenv_location in proj.proper_names_location