def smartupgrade(self, restart=True, dependencies=False, prerelease=False):
        """
        Upgrade the package if there is a later version available.
        Args:
            restart: restart app if True
            dependencies: update package dependencies if True (see pip --no-deps)
            prerelease: update to pre-release and development versions
        """
        if not self.check():
            if self.verbose:
                print("Package {} already up-to-date!".format(self.pkg))
            return
        if self.verbose:
            print("Upgrading {} ...".format(self.pkg))
        self.upgrade(dependencies, prerelease, force=False)
        if restart:
            self.restart()
Upgrade the package if there is a later version available.
        Args:
            restart: restart app if True
            dependencies: update package dependencies if True (see pip --no-deps)
            prerelease: update to pre-release and development versions