Remove the 'confit' backport

The commit to deprecate 'confit' was made on June 1, 2019.  It's been 5
years!  It is now removed entirely.

See Also: e2d7780f97
This commit is contained in:
Arav K. 2024-06-26 02:04:14 +02:00
parent 240c5fca51
commit 95dc07a404
2 changed files with 0 additions and 50 deletions

View file

@ -1,35 +0,0 @@
# This file is part of beets.
# Copyright 2016-2019, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
import warnings
import confuse
warnings.warn(
"beets.util.confit is deprecated; use confuse instead",
# Show the location of the `import confit` statement as the warning's
# source, rather than this file, such that the offending module can be
# identified easily.
stacklevel=2,
)
# Import everything from the confuse module into this module.
for key, value in confuse.__dict__.items():
if key not in ["__name__"]:
globals()[key] = value
# Cleanup namespace.
del key, value, warnings, confuse

View file

@ -217,21 +217,6 @@ class PathTruncationTest(_common.TestCase):
self.assertEqual(p, "abcde/f.ext")
class ConfitDeprecationTest(_common.TestCase):
def test_confit_deprecattion_warning_origin(self):
"""Test that importing `confit` raises a warning.
In addition, ensure that the warning originates from the actual
import statement, not the `confit` module.
"""
# See https://github.com/beetbox/beets/discussions/4024
with self.assertWarns(UserWarning) as w:
import beets.util.confit # noqa: F401
self.assertIn(__file__, w.filename)
self.assertNotIn("confit.py", w.filename)
def suite():
return unittest.TestLoader().loadTestsFromName(__name__)