Example #1
0
File: apt.py Project: veltzer/pydmt
 def build(self) -> None:
     unlink_files(self.target)
     os.environ['DEBIAN_FRONTEND'] = 'noninteractive'
     args = []
     if ConfigSudo.sudo:
         args.append("sudo")
     args.extend([
         'apt-get',
     ])
     if ConfigApt.apt_quiet:
         args.append("-q=2")
     args.extend([
         '--yes',
         'update',
     ])
     check_call(args)
     args = []
     if ConfigSudo.sudo:
         args.append("sudo")
     args.extend([
         'apt-get',
     ])
     if ConfigApt.apt_quiet:
         args.append("-q=2")
     args.extend([
         '--yes',
         'install',
     ])
     args.extend(self.packages)
     check_call(args)
     mkdir_touch(self.target)
Example #2
0
 def build(self) -> None:
     unlink_files(self._get_source_folder_targets(), only_if_exist=True)
     if os.path.isdir(self.target_folder):
         shutil.rmtree(self.target_folder, ignore_errors=False)
     args = [
         "sphinx-apidoc",
         "-q",  # quiet
         "-o",
         # self.target_folder,
         self.source_folder,
     ]
     # single file module vs package
     if os.path.isfile(self.package_name + '.py'):
         args.append(self.package_name + '.py')
     else:
         args.append(self.package_name)
     check_call(args)
     os.environ["PYTHONPATH"] = "."
     check_call([
         "sphinx-build",
         # don't use a saved environment, always read all files
         # "-E",
         # Do not emit colored output(default: auto - detect)
         "--no-color",
         # turn warnings into errors
         "-W",
         # no output on stdout, just warnings on stderr
         "-q",
         self.source_folder,
         self.target_folder,
     ])
     for filename in files_under_folder(
             os.path.join(self.source_folder, "copy")):
         basename = os.path.basename(filename)
         copy_mkdir(filename, os.path.join(self.target_folder, basename))
Example #3
0
File: npm.py Project: veltzer/pydmt
 def build(self) -> None:
     unlink_files(self.target)
     args = [
         'npm',
         'install',
         '--quiet',
         '--silent',
     ]
     check_call(args)
     mkdir_touch(self.target)
Example #4
0
 def build(self) -> None:
     args = [
         "venv-run",
         "--venv",
         ".venv/default",
         "--",
         "make",
     ]
     check_call(args)
     mkdir_touch(self.target)
Example #5
0
 def build(self) -> None:
     args = get_install_args()
     packs = collect_bootstrap_reqs()
     if packs:
         args.extend(packs)
         check_call(args)
     args = get_install_args()
     packs = collect_reqs()
     if packs:
         args.extend(packs)
         check_call(args)
     mkdir_touch(self.target)
Example #6
0
 def build(self) -> None:
     if os.path.isdir(TARGET_FOLDER):
         shutil.rmtree(TARGET_FOLDER)
     args = [
         "virtualenv",
         TARGET_FOLDER,
     ]
     check_call(args)
     args = [
         "venv-run",
         "--venv",
         ".venv/default",
         "--",
     ]
     args.extend(get_install_args())
     packs = collect_reqs()
     if packs:
         args.extend(packs)
         check_call(args)
Example #7
0
 def build(self) -> None:
     # remove previous virtual env
     if os.path.isdir(TARGET_FOLDER):
         shutil.rmtree(TARGET_FOLDER)
     # create new virtual env
     args = [
         "virtualenv",
         TARGET_FOLDER,
     ]
     check_call(args)
     # now create bootstrap packages so that we could read config/*.py
     args = [
         "venv-run",
         "--venv",
         ".venv/default",
         "--",
     ]
     args.extend(get_install_args())
     packs = collect_bootstrap_reqs()
     if packs:
         args.extend(packs)
         check_call(args)
     # now install regular packages (we only run the install if there are packages to install)
     args = [
         "venv-run",
         "--venv",
         ".venv/default",
         "--",
     ]
     args.extend(get_install_args())
     packs = collect_reqs()
     if packs:
         args.extend(packs)
         check_call(args)
     mkdir_touch(self.target)
Example #8
0
def clean_hard() -> None:
    logger = logging.getLogger(LOGGER_NAME)
    logger.setLevel(ConfigLogging.loglevel)

    shutil.rmtree(".pydmt")
    check_call(["git", "clean", "-qffxd"])