From f069eafb11a38985f723e837e83d14320d48ef1a Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Fri, 2 Jun 2023 13:14:04 -0500 Subject: [PATCH] fix: don't use none type --- examples/black | 8 ++++++-- src/viv/viv.py | 11 +++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/examples/black b/examples/black index 31997c8..72dda09 100755 --- a/examples/black +++ b/examples/black @@ -1,4 +1,8 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python +# AUTOGENERATED by viv (v23.5a4-37-gf8ebd9d-dev) +# see `python3 <(curl -fsSL viv.dayl.in/viv.py) --help` + + def _viv_use(*pkgs, track_exe=False, name=""): import hashlib, json, os, site, shutil, sys, venv # noqa from pathlib import Path # noqa @@ -18,7 +22,7 @@ def _viv_use(*pkgs, track_exe=False, name=""): _id = sha256.hexdigest() if (env := cache / (name if name else _id)) not in cache.glob("*/") or force: sys.stderr.write(f"generating new vivenv -> {env.name}\n") - venv.create(env, symlinks=True, with_pip=True, clear=True).create(env) + venv.create(env, symlinks=True, with_pip=True, clear=True) (env / "pip.conf").write_text("[global]\ndisable-pip-version-check=true") run_kw = dict(zip(("stdout", "stderr"), ((None,) * 2 if verbose else (-1, 2)))) p = run([env / "bin" / "pip", "install", "--force-reinstall", *spec], **run_kw) diff --git a/src/viv/viv.py b/src/viv/viv.py index 674a580..79c8a0b 100755 --- a/src/viv/viv.py +++ b/src/viv/viv.py @@ -51,7 +51,7 @@ from typing import ( from urllib.error import HTTPError from urllib.request import urlopen -__version__ = "23.5a4-37-gf8ebd9d-dev" +__version__ = "23.5a4-40-gccccbbb-dev" class Spinner: @@ -222,7 +222,7 @@ to create/activate a vivenv: _id = sha256.hexdigest() if (env := cache / (name if name else _id)) not in cache.glob("*/") or force: sys.stderr.write(f"generating new vivenv -> {env.name}\n") - venv.create(env, symlinks=True, with_pip=True, clear=True).create(env) + venv.create(env, symlinks=True, with_pip=True, clear=True) (env / "pip.conf").write_text("[global]\ndisable-pip-version-check=true") run_kw = dict(zip(("stdout", "stderr"), ((None,) * 2 if verbose else (-1, 2)))) p = run([env / "bin" / "pip", "install", "--force-reinstall", *spec], **run_kw) @@ -258,8 +258,8 @@ to create/activate a vivenv: (self._standalone_func, self.noqa(self._use_str(spec, standalone=True))) ) return f""" -# see `python3 <(curl -fsSL viv.dayl.in/viv.py) --help` # AUTOGENERATED by viv (v{__version__}) +# see `python3 <(curl -fsSL viv.dayl.in/viv.py) --help` {func_use} """ @@ -313,7 +313,10 @@ to create/activate a vivenv: else: imports = "" return f"""\ -#!/usr/bin/env python3 +#!/usr/bin/env python +# AUTOGENERATED by viv (v{__version__}) +# see `python3 <(curl -fsSL viv.dayl.in/viv.py) --help` + {imports} import subprocess import sys