Skip to content

Commit

Permalink
Minor control flow and test logic updates
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <dan@danryan.co>
  • Loading branch information
techalchemy committed Jun 22, 2018
1 parent f91c9e0 commit b74c658
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
32 changes: 18 additions & 14 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,8 @@ def do_install(
# Allow more than one package to be provided.
package_names = [package_name] + more_packages
# Support for --selective-upgrade.
# We should do this part first to make sure that we actually do selectively upgrade
# the items specified
if selective_upgrade:
for i, package_name in enumerate(package_names[:]):
section = project.packages if not dev else project.dev_packages
Expand All @@ -1950,6 +1952,8 @@ def do_install(
except KeyError:
pass
# Install all dependencies, if none was provided.
# This basically ensures that we have a pipfile and lockfile, then it locks and
# installs from the lockfile
if package_name is False:
# Update project settings with pre preference.
if pre:
Expand All @@ -1967,8 +1971,8 @@ def do_install(
requirements_dir=requirements_directory,
pypi_mirror=pypi_mirror,
)
requirements_directory.cleanup()

# This is for if the user passed in dependencies, then we want to maek sure we
else:
for package_name in package_names:
click.echo(
Expand Down Expand Up @@ -2057,18 +2061,18 @@ def do_install(
# Update project settings with pre preference.
if pre:
project.update_settings({'allow_prereleases': pre})
if lock and not skip_lock:
do_init(
dev=dev,
system=system,
allow_global=system,
concurrent=concurrent,
verbose=verbose,
keep_outdated=keep_outdated,
requirements_dir=requirements_directory,
deploy=deploy,
pypi_mirror=pypi_mirror,
)
do_init(
dev=dev,
system=system,
allow_global=system,
concurrent=concurrent,
verbose=verbose,
keep_outdated=keep_outdated,
requirements_dir=requirements_directory,
deploy=deploy,
pypi_mirror=pypi_mirror,
skip_lock=skip_lock
)
requirements_directory.cleanup()
sys.exit(0)

Expand Down Expand Up @@ -2327,7 +2331,7 @@ def do_run(command, args, three=None, python=False):
try:
script = project.build_script(command, args)
except ScriptEmptyError:
click.echo("Can't run script {0!r}—it's empty?", err=True)
click.echo("Can't run script {0!r}-it's empty?", err=True)
if os.name == 'nt':
do_run_nt(script)
else:
Expand Down
1 change: 0 additions & 1 deletion tests/integration/test_install_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def test_global_overrides_environment_markers(PipenvInstance, pypi):
@pytest.mark.complex
@flaky
@py3_only
@pytest.mark.skip(reason='This test is garbage and I hate it')
def test_resolver_unique_markers(PipenvInstance, pypi):
"""vcrpy has a dependency on `yarl` which comes with a marker
of 'python version in "3.4, 3.5, 3.6" - this marker duplicates itself:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_sync_error_without_lockfile(PipenvInstance, pypi):
@pytest.mark.lock
def test_mirror_lock_sync(PipenvInstance, pypi):
with temp_environ(), PipenvInstance(chdir=True) as p:
mirror_url = os.environ.pop('PIPENV_TEST_INDEX', "https://pypi.kennethreitz..org/simple")
mirror_url = os.environ.pop('PIPENV_TEST_INDEX', "https://pypi.kennethreitz.org/simple")
assert 'pypi.org' not in mirror_url
with open(p.pipfile_path, 'w') as f:
f.write("""
Expand Down

0 comments on commit b74c658

Please sign in to comment.