mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-11-09 19:13:14 -06:00
build: add clean recipe
This commit is contained in:
parent
3453004077
commit
0d583584dc
2 changed files with 3 additions and 7 deletions
3
Makefile
3
Makefile
|
@ -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); \
|
||||||
|
|
|
@ -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)]
|
||||||
|
|
Loading…
Reference in a new issue