コード例 #1
0
    def test_install_azure(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_azure")
        if not os.path.exists(temp):
            os.mkdir(temp)
        for _ in os.listdir(temp):
            if os.path.isfile(os.path.join(temp, _)):
                os.remove(os.path.join(temp, _))

        r1 = compare_version("2.0.0rc5", "1.0.3")
        r2 = compare_version("1.0.3", "2.0.0rc5")
        assert r1 * r2 < 0
        assert r1 > 0
        if sys.platform.startswith("win") and sys.version_info[0] >= 3:
            m = find_module_install("azure")
            if m.pip_options is None:
                raise Exception("no pip_options, issue '{0}'".format(m))
            m.fLOG = fLOG
            name = m.download(temp_folder=temp)
            v = get_wheel_version(name)
            r = compare_version(v, "1.9.9")
            if r <= 0:
                raise Exception(
                    "unexception version for '{0}',\nshould be >= 1.9.9 not '{1}'"
                    .format(name, v))
            fLOG(m.version, v, name)
            assert os.path.exists(name)
            assert "azure" in name
コード例 #2
0
    def test_install_azure(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_azure")
        if not os.path.exists(temp):
            os.mkdir(temp)
        for _ in os.listdir(temp):
            if os.path.isfile(os.path.join(temp, _)):
                os.remove(os.path.join(temp, _))

        r1 = compare_version("2.0.0rc5", "1.0.3")
        r2 = compare_version("1.0.3", "2.0.0rc5")
        assert r1 * r2 < 0
        assert r1 > 0
        if sys.platform.startswith("win") and sys.version_info[0] >= 3:
            m = find_module_install("azure")
            if m.pip_options is None:
                raise Exception("no pip_options, issue '{0}'".format(m))
            m.fLOG = fLOG
            name = m.download(temp_folder=temp)
            v = get_wheel_version(name)
            r = compare_version(v, "1.9.9")
            if r <= 0:
                raise Exception(
                    "unexception version for '{0}',\nshould be >= 1.9.9 not '{1}'".format(name, v))
            fLOG(m.version, v, name)
            assert os.path.exists(name)
            assert "azure" in name
コード例 #3
0
    def test_install_pycrypto(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        if sys.platform.startswith("win") and sys.version_info[0] == 2:
            # no pycrypto on Python 2.7 for Windows
            return

        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_pycrypto")
        if not os.path.exists(temp):
            os.mkdir(temp)
        for _ in os.listdir(temp):
            if os.path.isfile(os.path.join(temp, _)):
                os.remove(os.path.join(temp, _))

        if sys.platform.startswith("win"):
            fLOG("install", "pycrypto")
            m = find_module_install("pycrypto")
            m.fLOG = fLOG
            exe = m.download(temp_folder=temp,
                             file_save=os.path.join(temp, "out_page.html"),
                             source="2")
            assert os.path.exists(exe)
            assert os.stat(exe).st_size > 100000
            if "cp{0}{1}-cp{0}{1}m-win_amd64".format(*sys.version_info[:2]) not in exe and \
               "cp{0}{1}-none-win_amd64".format(*sys.version_info[:2]) not in exe:
                raise Exception(exe)
コード例 #4
0
    def test_install_pycrypto(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        if sys.platform.startswith("win") and sys.version_info[0] == 2:
            # no pycrypto on Python 2.7 for Windows
            return

        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_pycrypto")
        if not os.path.exists(temp):
            os.mkdir(temp)
        for _ in os.listdir(temp):
            if os.path.isfile(os.path.join(temp, _)):
                os.remove(os.path.join(temp, _))

        if sys.platform.startswith("win"):
            fLOG("install", "pycrypto")
            m = find_module_install("pycrypto")
            m.fLOG = fLOG
            exe = m.download(
                temp_folder=temp,
                file_save=os.path.join(
                    temp,
                    "out_page.html"), source="2")
            assert os.path.exists(exe)
            assert os.stat(exe).st_size > 100000
            if "cp{0}{1}-cp{0}{1}m-win_amd64".format(*sys.version_info[:2]) not in exe and \
               "cp{0}{1}-none-win_amd64".format(*sys.version_info[:2]) not in exe:
                raise Exception(exe)
コード例 #5
0
    def test_find_module_install(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        mod = find_module_install("docutils==0.8")
        fLOG(mod)
        assert mod.version == "0.8"
コード例 #6
0
 def walk_text(self, set_mod):
     nb = 0
     for mod in set_mod:
         assert mod
         nb += 1
         find = find_module_install(mod.name, must_exist=True)
         assert find
     assert nb > 0
     return nb
コード例 #7
0
    def test_install_tables(self):
        fLOG(__file__, self._testMethodName, OutputPrint=__name__ == "__main__")
        temp = get_temp_folder(__file__, "temp_download_psycopg2")

        if sys.platform.startswith("win"):
            m = find_module_install("psycopg2")
            m.fLOG = fLOG
            whl = m.download(temp_folder=temp, source="2")
            assert os.path.exists(whl)
コード例 #8
0
    def test_find_module_install(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        mod = find_module_install("docutils==0.8")
        fLOG(mod)
        assert mod.version == "0.8"
コード例 #9
0
    def test_install_tornado(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")
        temp = get_temp_folder(__file__, "temp_download_tornado")

        if sys.platform.startswith("win"):
            m = find_module_install("tornado")
            m.fLOG = fLOG
            whl = m.download(temp_folder=temp, source="2")
            assert os.path.exists(whl)
コード例 #10
0
    def test_is_installed(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        if is_travis_or_appveyor() or sys.version_info[0] == 2:
            return
        mod = find_module_install("imbalanced-learn")
        assert mod.is_installed_local()
        r = is_package_installed(sys.real_prefix if hasattr(
            sys, "real_prefix") else sys.prefix, "imbalanced-learn")
        assert r
コード例 #11
0
    def test_is_installed(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        if is_travis_or_appveyor() or sys.version_info[0] == 2:
            return
        mod = find_module_install("imbalanced-learn")
        assert mod.is_installed_local()
        r = is_package_installed(
            sys.real_prefix if hasattr(sys, "real_prefix") else sys.prefix,
            "imbalanced-learn")
        assert r
コード例 #12
0
    def test_install_seqlearn(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_seqlearn")
        if not os.path.exists(temp):
            os.mkdir(temp)
        for _ in os.listdir(temp):
            if os.path.isfile(os.path.join(temp, _)):
                os.remove(os.path.join(temp, _))

        if sys.platform.startswith("win") and sys.version_info[0] >= 3:
            m = find_module_install("seqlearn")
            name = m.get_exewheel_url_link(wheel=True)
            fLOG(m.existing_version)
            r = compare_version(m.existing_version, "0.2")
            assert r >= 0
            assert "unoptimized" not in name[0]
            whl = m.download(temp_folder=temp, source="2")
            fLOG(m.version)
            assert os.path.exists(whl)
            assert "unoptimized" not in whl
コード例 #13
0
    def test_install_cntk(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_cntk")
        if not os.path.exists(temp):
            os.mkdir(temp)
        for _ in os.listdir(temp):
            if os.path.isfile(os.path.join(temp, _)):
                os.remove(os.path.join(temp, _))

        if sys.platform.startswith("win"):
            if sys.version_info[:2] != (3, 6):
                fLOG("install", "cntk")
                m = find_module_install("cntk")
                m.fLOG = fLOG
                exe = m.download(temp_folder=temp)
                assert os.path.exists(exe)
                assert os.stat(exe).st_size > 100000
            else:
                fLOG("CNTK not available for 3.6")
                warnings.warn("CNTK not available for 3.6")