diff --git a/README.md b/README.md index dda4ffc..39426df 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,12 @@ pip install no-more-imports Do not use this package +### Configuration + +env vars: + +- `NMI_QUIET=true` - don't print anything to stdout like when installing packages we forgot to ask for + ## How it Works Well buster, i gotta say that's a little nosy, but if you must know, diff --git a/pyproject.toml b/pyproject.toml index 8813cd3..fd1afa0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "no-more-imports" -version = "0.1.0" +version = "0.1.1" description = "python with no imports" authors = [ {name = "sneakers-the-rat", email = "sneakers-the-rat@protonmail.com"}, diff --git a/src/no_more_imports/importer.py b/src/no_more_imports/importer.py index 74c9083..a86cf10 100644 --- a/src/no_more_imports/importer.py +++ b/src/no_more_imports/importer.py @@ -142,10 +142,12 @@ def _do_install(packages: list[str], quiet: bool = False): res = subprocess.run(['python', '-m', 'pip', 'install', package], capture_output=True) if res.returncode != 0: errors.append({'package': package, 'stdout': res.stdout, 'stderr': res.stderr}) - if len(errors) == 0: - print("sweet jesus we did it") - else: - print(f"some problems here pal:\n{pformat(errors, indent=2, compact=True)}") + + if not quiet: + if len(errors) == 0: + print("sweet jesus we did it") + else: + print(f"some problems here pal:\n{pformat(errors, indent=2, compact=True)}") def install():