Skip to content

Commit aa06206

Browse files
committed
main: treat unhandled install operation warnings as errors by default
Signed-off-by: Filipe Laíns <lains@archlinux.org>
1 parent 16587f7 commit aa06206

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A simple, correct PEP427 wheel installer.
44

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

99
positional arguments:
1010
wheel wheel file to install
@@ -17,6 +17,8 @@ optional arguments:
1717
--destdir /, -d / destination directory
1818
--cache, -c generate the installation cache
1919
--skip-build, -s skip the cache building step, requires cache to be present already
20+
--ignore-incomplete-installation-warnings, -w
21+
stop treating incomplete installation warnings as errors
2022
```
2123
2224
Missing components:

install/__main__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,18 @@ def _error(msg, code=1): # type: (str, int) -> None
7272
parser.add_argument('--skip-build', '-s',
7373
action='store_true',
7474
help='skip the cache building step, requires cache to be present already')
75+
# warnings
76+
parser.add_argument('--ignore-incomplete-installation-warnings', '-w',
77+
action='store_true',
78+
help='stop treating incomplete installation warnings as errors')
7579
args = parser.parse_args()
7680

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

84+
if not args.ignore_incomplete_installation_warning:
85+
warnings.simplefilter('error', IncompleteInstallationWarning)
86+
8087
cache_dir = '.install-cache'
8188
pkg_cache_dir = os.path.join(cache_dir, 'pkg')
8289
entrypoints_cache_dir = os.path.join(cache_dir, 'entrypoints')

0 commit comments

Comments
 (0)