Skip to content

Commit 14cdf3b

Browse files
committed
Suppress a UserWarning about unknown dist option
1 parent 8912b43 commit 14cdf3b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

setup.py

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import os.path
77
import re
88
import sys
9+
import warnings
10+
911
from collections import defaultdict
1012
from distutils.command.build_scripts import build_scripts as BuildScripts
1113
from distutils.command.sdist import sdist as SDist
@@ -291,7 +293,17 @@ def get_dynamic_setup_params():
291293
def main():
292294
"""Invoke installation process using setuptools."""
293295
setup_params = dict(static_setup_params, **get_dynamic_setup_params())
296+
ignore_warning_regex = (
297+
r"Unknown distribution option: '(project_urls|python_requires)'"
298+
)
299+
warnings.filterwarnings(
300+
'ignore',
301+
message=ignore_warning_regex,
302+
category=UserWarning,
303+
module='distutils.dist',
304+
)
294305
setup(**setup_params)
306+
warnings.resetwarnings()
295307

296308

297309
if __name__ == '__main__':

0 commit comments

Comments
 (0)