mirror of
https://github.com/huggingface/trl.git
synced 2025-10-20 18:43:52 +08:00
Raise deprecation warning for Python 3.9 (#4226)
This commit is contained in:
committed by
GitHub
parent
1684ef279a
commit
d6eeb290d9
@ -12,12 +12,26 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import sys
|
||||
import warnings
|
||||
from importlib.metadata import PackageNotFoundError, version
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .import_utils import _LazyModule
|
||||
|
||||
|
||||
if sys.version_info[:2] == (3, 9):
|
||||
warnings.warn(
|
||||
(
|
||||
"Support for Python 3.9 will be dropped in the next release "
|
||||
"(after its end-of-life on October 31, 2025). "
|
||||
"Please upgrade to Python 3.10 or newer."
|
||||
),
|
||||
category=FutureWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
|
||||
try:
|
||||
__version__ = version("trl")
|
||||
except PackageNotFoundError:
|
||||
|
Reference in New Issue
Block a user