Check if the current version of the library is outdated.
5257
def _check_update_(self):
        """"""
        try:
            data = requests.get("https://pypi.python.org/pypi/jira/json", timeout=2.001).json()

            released_version = data['info']['version']
            if parse_version(released_version) > parse_version(__version__):
                warnings.warn(
                    "You are running an outdated version of JIRA Python %s. Current version is %s. Do not file any bugs against older versions." % (
                        __version__, released_version))
        except requests.RequestException:
            pass
        except Exception as e:
            logging.warning(e)
424394
def version_is_valid(version_str):
    
    try:
        packaging.version.Version(version_str)
    except packaging.version.InvalidVersion:
        return False
    return True
199128
def dependencies_are_newer(self, files, dependencies):
        
        dependency_mtimes = [
            os.path.getmtime(filename) for filename in dependencies]
        file_mtimes = [os.path.getmtime(filename) for filename in files]
        result = False
        for file_mtime in file_mtimes:
            for dependency_mtime in dependency_mtimes:
                if dependency_mtime > file_mtime:
                    result = True
        return result
585466
def es_version_check(f):
    """"""
    @wraps(f)
    def inner(*args, **kwargs):
        cluster_ver = current_search.cluster_version[0]
        client_ver = ES_VERSION[0]
        if cluster_ver != client_ver:
            raise click.ClickException(
                'Elasticsearch version mismatch. Invenio was installed with '
                'Elasticsearch v{client_ver}.x support, but the cluster runs '
                'Elasticsearch v{cluster_ver}.x.'.format(
                    client_ver=client_ver,
                    cluster_ver=cluster_ver,
                ))
        return f(*args, **kwargs)
    return inner
133005
def updatable(self):
        """"""
        if self.latest_version > self.current_version:
            updatable_version = self.latest_version
        else:
            updatable_version = False
        return updatable_version
1281589
def is_current(self, paths=None):
        """'"""
        version = self.get_version(paths)
        if version is None:
            return False
        return self.version_ok(version)
712842
def validate_python_version():
    """"""
    python_version = LooseVersion(platform.python_version())
    minimal_version = LooseVersion('3.3.0')
    if python_version < minimal_version:
        print("Sorry, Python 3.3+ is required")
        sys.exit(1)
615575
def validate_current_versions(self):  # type: () -> bool
        
        versions = self.all_current_versions()
        for _, version in versions.items():
            if "Invalid Semantic Version" in version:
                logger.error(
                    "Invalid versions, can't compare them, can't determine if in sync"
                )
                return False

        if not versions:
            logger.warning("Found no versions, will use default 0.1.0")
            return True

        if not self.all_versions_equal(versions):
            if self.almost_the_same_version([x for x in versions.values()]):
                # TODO: disable with strict option
                logger.warning("Version very by a patch level, will use greater.")
                return True
            logger.error("Found various versions, how can we rationally pick?")
            logger.error(unicode(versions))
            return False

        for _ in versions:
            return True
        return False
547393
def version(self):
        """"""
        # requests.get destroys the ?
        import urllib
        with urllib.request.urlopen(URL_VERSION.format(self._url)) as response:
            return response.read().decode('utf-8')
        return False
1096699
public static void checkVersions(){
        boolean doCheck = Boolean.parseBoolean(System.getProperty(ND4JSystemProperties.VERSION_CHECK_PROPERTY, "true"));

        if(!doCheck){
            return;
        }

        if(classExists(ND4J_JBLAS_CLASS)) {
            //nd4j-jblas is ancient and incompatible
            log.error("Found incompatible/obsolete backend and version (nd4j-jblas) on classpath. ND4J is unlikely to"
                    + " function correctly with nd4j-jblas on the classpath. JVM will now exit.");
            System.exit(1);
        }

        if(classExists(CANOVA_CLASS)) {
            //Canova is ancient and likely to pull in incompatible dependencies
            log.error("Found incompatible/obsolete library Canova on classpath. ND4J is unlikely to"
                    + " function correctly with this library on the classpath. JVM will now exit.");
            System.exit(1);
        }

        List<VersionInfo> dependencies = getVersionInfos();
        if(dependencies.size() <= 2){
            //No -properties.git files were found on the classpath. This may be due to a misconfigured uber-jar
            // or maybe running in IntelliJ with "dynamic.classpath" set to true (in workspace.xml). Either way,
            // we can't check versions and don't want to log an error, which will more often than not be wrong
            if(dependencies.size() == 0){
                return;
            }

            //Another edge case: no -properties.git files were found, but DL4J and/or DataVec were inferred
            // by class names. If these "inferred by opName" versions were the only things found, we should also
            // not log a warning, as we can't check versions in this case

            boolean dl4jViaClass = false;
            boolean datavecViaClass = false;
            for(VersionInfo vi : dependencies ){
                if(DL4J_GROUPID.equals(vi.getGroupId()) && DL4J_ARTIFACT.equals(vi.getArtifactId())
                        && (UNKNOWN_VERSION.equals(vi.getBuildVersion()))){
                    dl4jViaClass = true;
                } else if(DATAVEC_GROUPID.equals(vi.getGroupId()) && DATAVEC_ARTIFACT.equals(vi.getArtifactId())
                        && (UNKNOWN_VERSION.equals(vi.getBuildVersion()))){
                    datavecViaClass = true;
                }
            }

            if(dependencies.size() == 1 && (dl4jViaClass || datavecViaClass)){
                return;
            } else if(dependencies.size() == 2 && dl4jViaClass && datavecViaClass){
                return;
            }
        }

        Set<String> foundVersions = new HashSet<>();
        for(VersionInfo vi : dependencies){
            String g = vi.getGroupId();
            if(g != null && GROUPIDS_TO_CHECK.contains(g)){
                String version = vi.getBuildVersion();

                if(version.contains("_spark_")){
                    //Normalize spark versions:
                    // "0.9.1_spark_1" to "0.9.1" and "0.9.1_spark_1-SNAPSHOT" to "0.9.1-SNAPSHOT"
                    version = version.replaceAll("_spark_1","");
                    version = version.replaceAll("_spark_2","");
                }

                foundVersions.add(version);
            }
        }

        boolean logVersions = false;

        if(foundVersions.size() > 1){
            log.warn("*** ND4J VERSION CHECK FAILED - INCOMPATIBLE VERSIONS FOUND ***");
            log.warn("Incompatible versions (different version number) of DL4J, ND4J, RL4J, DataVec, Arbiter are unlikely to function correctly");
            logVersions = true;
        }

        //Also: check for mixed scala versions - but only for our dependencies... These are in the artifact ID,
        // scored like dl4j-spack_2.10 and deeplearning4j-ui_2.11
        //And check for mixed spark versions (again, just DL4J/DataVec etc dependencies for now)
        boolean scala210 = false;
        boolean scala211 = false;
        boolean spark1 = false;
        boolean spark2 = false;
        for(VersionInfo vi : dependencies){
            String artifact = vi.getArtifactId();
            if(!scala210 && artifact.contains(SCALA_210_SUFFIX)){
                scala210 = true;
            }
            if(!scala211 && artifact.contains(SCALA_211_SUFFIX)){
                scala211 = true;
            }

            String version = vi.getBuildVersion();
            if(!spark1 && version.contains(SPARK_1_VER_STRING)){
                spark1 = true;
            }
            if(!spark2 && version.contains(SPARK_2_VER_STRING)){
                spark2 = true;
            }
        }

        if(scala210 && scala211){
            log.warn("*** ND4J VERSION CHECK FAILED - FOUND BOTH SCALA VERSION 2.10 AND 2.11 ARTIFACTS ***");
            log.warn("Projects with mixed Scala versions (2.10/2.11) are unlikely to function correctly");
            logVersions = true;
        }

        if(spark1 && spark2){
            log.warn("*** ND4J VERSION CHECK FAILED - FOUND BOTH SPARK VERSION 1 AND 2 ARTIFACTS ***");
            log.warn("Projects with mixed Spark versions (1 and 2) are unlikely to function correctly");
            logVersions = true;
        }

        if(logVersions){
            log.info("Versions of artifacts found on classpath:");
            logVersionInfo();
        }
    }
355209
def check_python_version():
    """"""
    python_major, python_minor = sys.version_info[:2]

    if python_major != 2 or python_minor != 7:
        sys.stderr.write("pyGenClean requires python 2.7")
        sys.exit(1)
173346
def is_up_to_date(self):
        """"""
        if self.builder is not MkdirBuilder and not self.exists():
            return 0
        up_to_date = SCons.Node.up_to_date
        for kid in self.children():
            if kid.get_state() > up_to_date:
                return 0
        return 1
772005
def do_version():
    """"""
    v = ApiPool.ping.model.Version(
        name=ApiPool().current_server_name,
        version=ApiPool().current_server_api.get_version(),
        container=get_container_version(),
    )
    log.info("/version: " + pprint.pformat(v))
    return v
654169
def check_python_version():
    """"""
    # Required due to multiple with statements on one line
    req_version = (2, 7)
    cur_version = sys.version_info
    if cur_version >= req_version:
        print("Python version... %sOK%s (found %s, requires %s)" %
              (Bcolors.OKGREEN, Bcolors.ENDC, str(platform.python_version()),
               str(req_version[0]) + "." + str(req_version[1])))
    else:
        print("Python version... %sFAIL%s (found %s, requires %s)" %
              (Bcolors.FAIL, Bcolors.ENDC, str(cur_version),
               str(req_version)))
374334
def outdated
      outdateds = []

      latest_specs.each do |local|
        dependency = Gem::Dependency.new local.name, ">= #{local.version}"

        begin
          fetcher = Gem::SpecFetcher.fetcher
          remotes = fetcher.find_matching dependency
          remotes = remotes.map { |(name, version,_),_| version }
        rescue Gem::RemoteFetcher::FetchError => e
          raise unless fetcher.warn_legacy e do
            require 'rubygems/source_info_cache'

            specs = Gem::SourceInfoCache.search_with_source dependency, true

            remotes = specs.map { |spec,| spec.version }
          end
        end

        latest = remotes.sort.last

        outdateds << local.name if latest and local.version < latest
      end

      outdateds
    end
1233813
def check_version(mod, required):
    """"""
    vers = tuple(int(v) for v in mod.__version__.split('.')[:3])
    if vers < required:
        req = '.'.join(str(v) for v in required)
        raise ImproperlyConfigured(
            "Module \"%s\" version (%s) must be >= %s." %
            (mod.__name__, mod.__version__, req))
1360628
def _version_checker(module, minver):
    
    # We could use LooseVersion, but distutils imports imp which is deprecated
    version_regexp = r'[a-z]?((?:\d|\.)+\d+)(?:\.dev[0-9]+)?'
    version_tags = re.match(version_regexp, module.__version__)
    if not version_tags:
        return False
    version_tags = version_tags.group(1).split(".")
    version_tags = tuple(int(x) for x in version_tags)
    return version_tags >= minver