コード例 #1
0
 def test_install_pip_deps(self):
     fLOG(
         __file__,
         self._testMethodName,
         OutputPrint=__name__ == "__main__")
     fold = get_temp_folder(__file__, "temp_download_pip_deps")
     m = ModuleInstall("pyquickhelper", "pip", fLOG=fLOG)
     out = m.download(temp_folder=fold, deps=True)
     assert os.path.exists(out)
     assert "pyquickhelper" in out
     out = m.download(temp_folder=fold)
     assert os.path.exists(out)
     assert "pyquickhelper" in out
コード例 #2
0
 def test_install_pip_deps(self):
     fLOG(__file__, self._testMethodName, OutputPrint=__name__ == "__main__")
     if sys.version_info[0] == 2:
         # disabled on python 2.7
         return
     fold = get_temp_folder(__file__, "temp_download_pip_deps")
     # This test can fail if the latest version of pyquickhelper is not
     # available for Python 2.7
     m = ModuleInstall("pyquickhelper", "pip", fLOG=fLOG)
     out = m.download(temp_folder=fold, deps=True)
     assert os.path.exists(out)
     assert "pyquickhelper" in out
     out = m.download(temp_folder=fold, source="2")
     assert os.path.exists(out)
     assert "pyquickhelper" in out
コード例 #3
0
ファイル: test_download.py プロジェクト: sdpython/pymyinstall
    def test_install(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download")
        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 os.path.exists(os.path.join(temp, "jsdifflib-master")):
            for _ in os.listdir(os.path.join(temp, "jsdifflib-master")):
                os.remove(
                    os.path.join(
                        os.path.join(
                            temp,
                            "jsdifflib-master"),
                        _))

        m = ModuleInstall("jsdifflib", "github", gitrepo="cemerick", fLOG=fLOG)
        files = m.download(temp_folder=temp, unzipFile=True, source="2")
        assert len(files) > 0
        for _ in files:
            assert os.path.exists(_)
コード例 #4
0
    def test_install_numpy(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_numpy")
        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 = ModuleInstall(
                "numpy",
                "wheel",
                fLOG=fLOG)
            name = m.get_exewheel_url_link(wheel=True)
            fLOG(m.existing_version)
            r = compare_version(m.existing_version, "1.10.1")
            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
コード例 #5
0
 def test_install_pip_deps(self):
     fLOG(__file__,
          self._testMethodName,
          OutputPrint=__name__ == "__main__")
     if sys.version_info[0] == 2:
         # disabled on python 2.7
         return
     fold = get_temp_folder(__file__, "temp_download_pip_deps")
     # This test can fail if the latest version of pyquickhelper is not
     # available for Python 2.7
     m = ModuleInstall("pyquickhelper", "pip", fLOG=fLOG)
     out = m.download(temp_folder=fold, deps=True)
     assert os.path.exists(out)
     assert "pyquickhelper" in out
     out = m.download(temp_folder=fold, source="2")
     assert os.path.exists(out)
     assert "pyquickhelper" in out
コード例 #6
0
    def test_install_tables(self):
        fLOG(__file__, self._testMethodName, OutputPrint=__name__ == "__main__")
        temp = get_temp_folder(__file__, "temp_download_tables")

        if sys.platform.startswith("win"):
            m = ModuleInstall("tables", "wheel", fLOG=fLOG)
            whl = m.download(temp_folder=temp, source="2")
            assert os.path.exists(whl)
コード例 #7
0
    def test_install_tables(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")
        temp = get_temp_folder(__file__, "temp_download_tables")

        if sys.platform.startswith("win"):
            m = ModuleInstall("tables", "wheel", fLOG=fLOG)
            whl = m.download(temp_folder=temp, source="2")
            assert os.path.exists(whl)
コード例 #8
0
    def test_install_mlpy(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_mlpy")
        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"):
            m = ModuleInstall("mlpy", "wheel", fLOG=fLOG)
            whl = m.download(temp_folder=temp, source="2")
            assert os.path.exists(whl)
コード例 #9
0
ファイル: test_download.py プロジェクト: sdpython/pymyinstall
    def test_install_mlpy(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_mlpy")
        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"):
            m = ModuleInstall("mlpy", "wheel", fLOG=fLOG)
            whl = m.download(temp_folder=temp, source="2")
            assert os.path.exists(whl)
コード例 #10
0
    def test_install_pycuda(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_pycuda")
        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", "h5py")
            m = ModuleInstall("pycuda", "wheel", fLOG=fLOG)
            exe = m.download(temp_folder=temp,
                             file_save=os.path.join(temp, "out_page.html"),
                             source="2")
            assert os.path.exists(exe)
コード例 #11
0
    def test_install_scikit(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_scikit")
        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"):
            m = ModuleInstall("scikit-learn",
                              "wheel",
                              mname="sklearn",
                              fLOG=fLOG)
            whl = m.download(temp_folder=temp, source="2")
            assert os.path.exists(whl)
            if os.stat(whl).st_size < 1000:
                raise Exception("small file: " + whl)
コード例 #12
0
    def test_install(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download")
        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 os.path.exists(os.path.join(temp, "jsdifflib-master")):
            for _ in os.listdir(os.path.join(temp, "jsdifflib-master")):
                os.remove(
                    os.path.join(os.path.join(temp, "jsdifflib-master"), _))

        m = ModuleInstall("jsdifflib", "github", gitrepo="cemerick", fLOG=fLOG)
        files = m.download(temp_folder=temp, unzipFile=True, source="2")
        assert len(files) > 0
        for _ in files:
            assert os.path.exists(_)
コード例 #13
0
    def test_install_pyqt(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_pyqt")
        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", "pyqt")
            m = ModuleInstall("PyQt", "wheel", mname="pyqt", fLOG=fLOG)
            exe = m.download(
                temp_folder=temp,
                file_save=os.path.join(
                    temp,
                    "out_page.html"), source="2")
            assert os.path.exists(exe)
コード例 #14
0
ファイル: test_download.py プロジェクト: sdpython/pymyinstall
    def test_install_scikit(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_scikit")
        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"):
            m = ModuleInstall(
                "scikit-learn",
                "wheel",
                mname="sklearn",
                fLOG=fLOG)
            whl = m.download(temp_folder=temp, source="2")
            assert os.path.exists(whl)
            if os.stat(whl).st_size < 1000:
                raise Exception("small file: " + whl)
コード例 #15
0
    def test_install_numpy(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_download_numpy")
        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 = ModuleInstall("numpy", "wheel", fLOG=fLOG)
            name = m.get_exewheel_url_link(wheel=True)
            fLOG(m.existing_version)
            r = compare_version(m.existing_version, "1.10.1")
            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