Skip to content

Commit

Permalink
Trac #30975: Silence packaging 20.5 deprecation warnings
Browse files Browse the repository at this point in the history
packaging 20.5 throws lots of deprecation warnings
{{{
/usr/lib/python3.9/site-packages/packaging/version.py:127:
DeprecationWarning: Creating a LegacyVersion has been deprecated and
will be removed in the next major release
}}}
when called from setuptools when building the module index (which
happens indirectly eg. when calling sage_getdoc). We silence these
warnings, since this is really out of sage's control (even if all of
sage's python packages were fixed, this could still be triggered by
packages installed with sage-pip, or by any other python package in the
case of distro packages)

URL: https://trac.sagemath.org/30975
Reported by: arojas
Ticket author(s): Antonio Rojas
Reviewer(s): Matthias Koeppe
  • Loading branch information
Release Manager committed Dec 5, 2020
2 parents 5fadc42 + dca89b2 commit 14e3c69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/pkgs/packaging/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
packaging >=18.0
# Trac #30975: packaging 20.5 is known to work but we have to silence "DeprecationWarning: Creating a LegacyVersion"
4 changes: 4 additions & 0 deletions src/sage/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
warnings.filterwarnings('ignore', category=DeprecationWarning,
module='.*ast')

# Ignore packaging 20.5 deprecation warnings
warnings.filterwarnings('ignore', category=DeprecationWarning,
module='.*packaging')

################ end setup warnings ###############################


Expand Down

0 comments on commit 14e3c69

Please sign in to comment.