Esempio n. 1
0
    def check_update_available(self, version, releases):
        """Checks if there is an update available.

        It takes as parameters the current version of Spyder and a list of
        valid cleaned releases in chronological order (what github api returns
        by default). Example: ['2.3.4', '2.3.3' ...]
        """
        if is_stable_version(version):
            # Remove non stable versions from the list
            releases = [r for r in releases if is_stable_version(r)]

        latest_release = releases[0]

        if version.endswith('dev'):
            return (False, latest_release)

        return (check_version(version, latest_release, '<'), latest_release)
Esempio n. 2
0
    def check_update_available(self, version, releases):
        """Checks if there is an update available.

        It takes as parameters the current version of Spyder and a list of
        valid cleaned releases in chronological order (what github api returns
        by default). Example: ['2.3.4', '2.3.3' ...]
        """
        if is_stable_version(version):
            # Remove non stable versions from the list
            releases = [r for r in releases if is_stable_version(r)]

        latest_release = releases[0]

        if version.endswith('dev'):
            return (False, latest_release)

        return (check_version(version, latest_release, '<'), latest_release)
Esempio n. 3
0
    def check_update_available(self):
        """Checks if there is an update available.

        It takes as parameters the current version of Spyder and a list of
        valid cleaned releases in chronological order.
        Example: ['2.3.2', '2.3.3' ...] or with github ['2.3.4', '2.3.3' ...]
        """
        # Don't perform any check for development versions
        if 'dev' in self.version:
            return (False, latest_release)

        # Filter releases
        if is_stable_version(self.version):
            releases = [r for r in self.releases if is_stable_version(r)]
        else:
            releases = [r for r in self.releases
                        if not is_stable_version(r) or r in self.version]

        latest_release = releases[-1]

        return (check_version(self.version, latest_release, '<'),
                latest_release)
Esempio n. 4
0
    def check_update_available(self):
        """Checks if there is an update available.

        It takes as parameters the current version of Spyder and a list of
        valid cleaned releases in chronological order.
        Example: ['2.3.2', '2.3.3' ...] or with github ['2.3.4', '2.3.3' ...]
        """
        # Don't perform any check for development versions
        if 'dev' in self.version:
            return (False, latest_release)

        # Filter releases
        if is_stable_version(self.version):
            releases = [r for r in self.releases if is_stable_version(r)]
        else:
            releases = [
                r for r in self.releases
                if not is_stable_version(r) or r in self.version
            ]

        latest_release = releases[-1]

        return (check_version(self.version, latest_release,
                              '<'), latest_release)
Esempio n. 5
0
def test_is_stable_version():
    """Test for is_stable_version."""
    assert is_stable_version('3.3.0')
    assert not is_stable_version('4.0.0b1')
    assert not is_stable_version('3.3.2.dev0')
Esempio n. 6
0
def test_is_stable_version():
    """Test for is_stable_version."""
    assert is_stable_version('3.3.0')
    assert not is_stable_version('4.0.0b1')
    assert not is_stable_version('3.3.2.dev0')