Skip to content

Commit

Permalink
Suppress a UserWarning about unknown dist option
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Apr 12, 2018
1 parent 8912b43 commit 14cdf3b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions setup.py
Expand Up @@ -6,6 +6,8 @@
import os.path
import re
import sys
import warnings

from collections import defaultdict
from distutils.command.build_scripts import build_scripts as BuildScripts
from distutils.command.sdist import sdist as SDist
Expand Down Expand Up @@ -291,7 +293,17 @@ def get_dynamic_setup_params():
def main():
"""Invoke installation process using setuptools."""
setup_params = dict(static_setup_params, **get_dynamic_setup_params())
ignore_warning_regex = (
r"Unknown distribution option: '(project_urls|python_requires)'"
)
warnings.filterwarnings(
'ignore',
message=ignore_warning_regex,
category=UserWarning,
module='distutils.dist',
)
setup(**setup_params)
warnings.resetwarnings()


if __name__ == '__main__':
Expand Down

0 comments on commit 14cdf3b

Please sign in to comment.