-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved compatibility with future versions of
setuptools
(#638)
- Loading branch information
1 parent
9254a4f
commit 28c1ba1
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,26 @@ | ||
from typing import TYPE_CHECKING | ||
from warnings import warn | ||
|
||
from ._bdist_wheel import bdist_wheel as bdist_wheel | ||
|
||
warn( | ||
"The 'wheel' package is no longer the canonical location of the 'bdist_wheel' " | ||
"command, and will be removed in a future release. Please update to setuptools " | ||
"v70.1 or later which contains an integrated version of this command.", | ||
DeprecationWarning, | ||
stacklevel=1, | ||
) | ||
|
||
if TYPE_CHECKING: | ||
from ._bdist_wheel import bdist_wheel as bdist_wheel | ||
else: | ||
try: | ||
# Better integration/compatibility with setuptools: | ||
# in the case new fixes or PEPs are implemented in setuptools | ||
# there is no need to backport them to the deprecated code base. | ||
# This is useful in the case of old packages in the ecosystem | ||
# that are still used but have low maintenance. | ||
from setuptools.command.bdist_wheel import bdist_wheel | ||
except ImportError: | ||
# Only used in the case of old setuptools versions. | ||
# If the user wants to get the latest fixes/PEPs, | ||
# they are encouraged to address the deprecation warning. | ||
from ._bdist_wheel import bdist_wheel as bdist_wheel |