Esempio n. 1
0
 def unittest(self):
     """ Run unittests for this repository. """
     terminal("-m",
              "unittest",
              "discover",
              str(self.get_test_path()),
              python=True)
Esempio n. 2
0
    def upload(self):
        """ Upload local repo to PyPI.
            Todo: Make sure twine is installed when trying to upload to pypi. """
        if self.private:
            raise AttributeError("Cannot upload private repo.")

        self.create_sdist()
        with self.path.as_working_dir():
            terminal("-m", "twine", "upload", "dist/*", python=True)
Esempio n. 3
0
    def generate_exe(self, file_path=None, suppress=False):
        """ Generate an exe file for target file_path python file. """
        if file_path is None:
            file_path = self.get_exetarget_path()
        assert file_path.exists()

        with self.path.as_working_dir():
            terminal("-m",
                     "PyInstaller",
                     file_path,
                     "--onefile",
                     "--windowed",
                     python=True,
                     suppress=suppress)
Esempio n. 4
0
 def create_sdist(self):
     """ Create source distribution. """
     with self.path.as_working_dir():
         terminal("setup.py", "sdist", "bdist_wheel", python=True)
Esempio n. 5
0
 def pip_uninstall(self):
     """ Uninstall this repository with pip."""
     terminal("-m", "pip", "uninstall", "-y", self.name, python=True)
Esempio n. 6
0
 def pip_install(self):
     """ Install this repository with pip, WITHOUT -e flag.
         Subprocess messed up -e flag compared to doing it in terminal, so use the normal one."""
     with self.path.as_working_dir():
         terminal("pip", "install", "-e", ".")