Skip to content

Commit

Permalink
main: treat unhandled install operation warnings as errors by default
Browse files Browse the repository at this point in the history
Signed-off-by: Filipe Laíns <[email protected]>
  • Loading branch information
FFY00 committed May 30, 2020
1 parent 16587f7 commit aa06206
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A simple, correct PEP427 wheel installer.

```sh
$ python -m install -h
usage: python -m install [-h] [--verbose] [--optimize [level [level ...]]] [--destdir /] [--cache] [--skip-build] [wheel]
usage: python -m install [-h] [--verbose] [--optimize [level [level ...]]] [--destdir /] [--cache] [--skip-build] [--ignore-incomplete-installation-warnings] [wheel]

positional arguments:
wheel wheel file to install
Expand All @@ -17,6 +17,8 @@ optional arguments:
--destdir /, -d / destination directory
--cache, -c generate the installation cache
--skip-build, -s skip the cache building step, requires cache to be present already
--ignore-incomplete-installation-warnings, -w
stop treating incomplete installation warnings as errors
```
Missing components:
Expand Down
7 changes: 7 additions & 0 deletions install/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,18 @@ def _error(msg, code=1): # type: (str, int) -> None
parser.add_argument('--skip-build', '-s',
action='store_true',
help='skip the cache building step, requires cache to be present already')
# warnings
parser.add_argument('--ignore-incomplete-installation-warnings', '-w',
action='store_true',
help='stop treating incomplete installation warnings as errors')
args = parser.parse_args()

if args.verbose:
logging.basicConfig(level=logging.DEBUG)

if not args.ignore_incomplete_installation_warning:
warnings.simplefilter('error', IncompleteInstallationWarning)

cache_dir = '.install-cache'
pkg_cache_dir = os.path.join(cache_dir, 'pkg')
entrypoints_cache_dir = os.path.join(cache_dir, 'entrypoints')
Expand Down

0 comments on commit aa06206

Please sign in to comment.