Unverified Commit 2b8e9aef authored by Sébastien Eustace's avatar Sébastien Eustace
Browse files

Fix update not properly adding new packages to the lock file

parent f32cf660
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
### Fixed

- Fixed handling of markers with the `in` operator.
- Fixed `update` not properly adding new packages to the lock file.


## [0.6.5] - 2018-03-22
+11 −4
Changes for poetry/installation/installer.py: 11 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -202,10 +202,11 @@ class Installer:
        self._io.new_line()

        # Execute operations
        if not ops and (self._execute_operations or self._dry_run):
        actual_ops = [op for op in ops if not op.skipped]
        if not actual_ops and (self._execute_operations or self._dry_run):
            self._io.writeln('Nothing to install or update')

        if ops and (self._execute_operations or self._dry_run):
        if actual_ops and (self._execute_operations or self._dry_run):
            installs = []
            updates = []
            uninstalls = []
@@ -247,7 +248,6 @@ class Installer:
                    ) if skipped and self.is_verbose() else ''
                )
            )
            self._io.new_line()

        # Writing lock before installing
        if self._update and self._write_lock:
@@ -257,9 +257,10 @@ class Installer:
            )

            if updated_lock:
                self._io.writeln('<info>Writing lock file</>')
                self._io.writeln('')
                self._io.writeln('<info>Writing lock file</>')

        self._io.writeln('')
        for op in ops:
            self._execute(op)

@@ -366,6 +367,12 @@ class Installer:
                        local_repo.add_package(op.target_package)
                    elif op.job_type == 'uninstall':
                        local_repo.remove_package(op.package)
                    else:
                        # Even though the package already exists
                        # in the lock file we will prefer the new one
                        # to force updates
                        local_repo.remove_package(pkg)
                        local_repo.add_package(package)

                    acted_on = True

+2 −0
Changes for poetry/packages/locker.py: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -206,6 +206,8 @@ class Locker:
            }

        if package.requirements:
            print(package)
            print(package.requirements)
            data['requirements'] = package.requirements

        return data
+3 −1
Changes for poetry/puzzle/operations/operation.py: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ class Operation:
    def format_version(self, package) -> str:
        return package.full_pretty_version

    def skip(self, reason: str) -> None:
    def skip(self, reason: str) -> 'Operation':
        self._skipped = True
        self._skip_reason = reason

        return self
+4 −0
Changes for poetry/puzzle/solver.py: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -86,6 +86,10 @@ class Solver:
                    # Checking version
                    if package.version != pkg.version:
                        operations.append(Update(pkg, package))
                    else:
                        operations.append(
                            Install(package).skip('Already installed')
                        )

                    break

Loading