Skip to content

Commit

Permalink
Fix handling of markers in old files (#2482)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdispater authored Jun 12, 2020
1 parent d4be652 commit b398062
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions poetry/installation/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@ def _filter_operations(
if op.job_type == "uninstall":
continue

if not self._env.is_valid_for_marker(package.marker):
op.skip("Not needed for the current environment")
continue

if self._update:
extras = {}
for extra, deps in self._package.extras.items():
Expand Down
3 changes: 2 additions & 1 deletion tests/installation/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,8 @@ def test_installer_can_handle_old_lock_files(

package.add_dependency("pytest", "^3.5", category="dev")

locker.mock_lock_data(fixture("with-pypi-repository"))
locker.locked()
locker.mock_lock_data(fixture("old-lock"))

installer = Installer(
NullIO(), MockEnv(), package, locker, pool, installed=installed
Expand Down

0 comments on commit b398062

Please sign in to comment.