build: add clean recipe

This commit is contained in:
Daylin Morgan 2023-03-07 13:00:48 -06:00
parent 3453004077
commit 0d583584dc
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F
2 changed files with 3 additions and 7 deletions

View file

@ -28,6 +28,9 @@ docs/%.gif: docs/%.tape
viv rm $$(viv l -q) viv rm $$(viv l -q)
vhs < $< vhs < $<
clean: ## remove build artifacts
rm -rf {build,dist}
EXAMPLES = cli.py sys_path.py exe_specific.py frozen_import.py named_env.py scrape.py EXAMPLES = cli.py sys_path.py exe_specific.py frozen_import.py named_env.py scrape.py
generate-example-vivens: ## generate-example-vivens: ##
for f in $(EXAMPLES); \ for f in $(EXAMPLES); \

View file

@ -196,7 +196,6 @@ class Ansi:
return sizes return sizes
def _make_row(self, row) -> str: def _make_row(self, row) -> str:
return f" {BOX['v']} " + f" {BOX['sep']} ".join(row) + f" {BOX['v']}" return f" {BOX['v']} " + f" {BOX['sep']} ".join(row) + f" {BOX['v']}"
def _sanitize_row(self, sizes: List[int], row: Tuple[str]) -> Tuple[Tuple[str]]: def _sanitize_row(self, sizes: List[int], row: Tuple[str]) -> Tuple[Tuple[str]]:
@ -380,7 +379,6 @@ class ViVenv:
return vivenv return vivenv
def create(self) -> None: def create(self) -> None:
echo(f"new unique vivenv -> {self.name}") echo(f"new unique vivenv -> {self.name}")
with Spinner("creating vivenv"): with Spinner("creating vivenv"):
builder = venv.EnvBuilder(with_pip=True, clear=True) builder = venv.EnvBuilder(with_pip=True, clear=True)
@ -391,7 +389,6 @@ class ViVenv:
f.write("[global]\ndisable-pip-version-check = true") f.write("[global]\ndisable-pip-version-check = true")
def install_pkgs(self): def install_pkgs(self):
cmd: List[str | Path] = [ cmd: List[str | Path] = [
self.path / "bin" / "pip", self.path / "bin" / "pip",
"install", "install",
@ -406,7 +403,6 @@ class ViVenv:
) )
def dump_info(self, write=False): def dump_info(self, write=False):
# TODO: include associated files in 'info' # TODO: include associated files in 'info'
# means it needs to be loaded first # means it needs to be loaded first
info = { info = {
@ -458,7 +454,6 @@ def validate_spec(spec):
def modify_sys_path(new_path: Path): def modify_sys_path(new_path: Path):
# remove user-site # remove user-site
for i, path in enumerate(sys.path): for i, path in enumerate(sys.path):
if path == site.USER_SITE: if path == site.USER_SITE:
@ -602,7 +597,6 @@ class CustomHelpFormatter(RawDescriptionHelpFormatter, HelpFormatter):
return (", ").join(parts) return (", ").join(parts)
def _format_usage(self, *args, **kwargs): def _format_usage(self, *args, **kwargs):
formatted_usage = super()._format_usage(*args, **kwargs) formatted_usage = super()._format_usage(*args, **kwargs)
# patch usage with color formatting # patch usage with color formatting
formatted_usage = ( formatted_usage = (
@ -667,7 +661,6 @@ class CustomHelpFormatter(RawDescriptionHelpFormatter, HelpFormatter):
def add_argument(self, action): def add_argument(self, action):
if action.help is not SUPPRESS: if action.help is not SUPPRESS:
# find all invocations # find all invocations
get_invocation = self._format_action_invocation get_invocation = self._format_action_invocation
invocations = [get_invocation(action)] invocations = [get_invocation(action)]