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

Pass lock options to outdated #3880

Merged
merged 8 commits into from
Aug 5, 2019
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
3 changes: 0 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
python.architecture: x64
maxParallel: 4
steps:
- template: .azure-pipelines/steps/reinstall-pythons.yml
- template: .azure-pipelines/steps/run-tests.yml
parameters:
vmImage: 'Ubuntu-16.04'
Expand All @@ -52,7 +51,6 @@ jobs:
python.version: '3.7'
python.architecture: x64
steps:
- template: .azure-pipelines/steps/reinstall-pythons.yml
- template: .azure-pipelines/steps/run-vendor-scripts.yml
parameters:
vmImage: 'Ubuntu-16.04'
Expand All @@ -64,7 +62,6 @@ jobs:
python.version: '3.7'
python.architecture: x64
steps:
- template: .azure-pipelines/steps/reinstall-pythons.yml
- template: .azure-pipelines/steps/build-package.yml
parameters:
vmImage: 'Ubuntu-16.04'
Expand Down
1 change: 1 addition & 0 deletions news/3879.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pass ``--pre`` and ``--clear`` options to ``pipenv update --outdated``.
2 changes: 1 addition & 1 deletion pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def update(
if not outdated:
outdated = bool(dry_run)
if outdated:
do_outdated(pypi_mirror=state.pypi_mirror)
do_outdated(clear=state.clear, pre=state.installstate.pre, pypi_mirror=state.pypi_mirror)
packages = [p for p in state.installstate.packages if p]
editable = [p for p in state.installstate.editables if p]
if not packages:
Expand Down
4 changes: 2 additions & 2 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,7 @@ def do_py(system=False):
click.echo(crayons.red("No project found!"))


def do_outdated(pypi_mirror=None):
def do_outdated(pypi_mirror=None, pre=False, clear=False):
# TODO: Allow --skip-lock here?
from .vendor.requirementslib.models.requirements import Requirement
from .vendor.requirementslib.models.utils import get_version
Expand All @@ -1789,7 +1789,7 @@ def do_outdated(pypi_mirror=None):
dep = Requirement.from_line(str(result.as_requirement()))
packages.update(dep.as_pipfile())
updated_packages = {}
lockfile = do_lock(write=False, pypi_mirror=pypi_mirror)
lockfile = do_lock(clear=clear, pre=pre, write=False, pypi_mirror=pypi_mirror)
for section in ("develop", "default"):
for package in lockfile[section]:
try:
Expand Down
13 changes: 13 additions & 0 deletions tests/integration/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,16 @@ def test_pipenv_three(PipenvInstance):
c = p.pipenv('--three')
assert c.return_code == 0
assert 'Successfully created virtual environment' in c.err


@pytest.mark.outdated
def test_pipenv_outdated_prerelease(PipenvInstance):
with PipenvInstance(chdir=True) as p:
with open(p.pipfile_path, "w") as f:
contents = """
[packages]
sqlalchemy = "<=1.2.3"
""".strip()
f.write(contents)
c = p.pipenv('update --pre --outdated')
assert c.return_code == 0
1 change: 0 additions & 1 deletion tests/integration/test_install_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from flaky import flaky

from pipenv._compat import Path, TemporaryDirectory
from pipenv.project import Project
from pipenv.utils import temp_environ
from pipenv.vendor import delegator

Expand Down