From 7785d04a3f8b946a5494395c8a40f97c5644cae6 Mon Sep 17 00:00:00 2001 From: reynoldsnlp Date: Mon, 20 Nov 2023 07:22:05 -0700 Subject: [PATCH] importlib_resources for Python<3.9 --- setup.cfg | 10 +++++++--- src/udar/misc.py | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index 3d45e1e..c438cd4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,8 +23,11 @@ classifiers = Operating System :: POSIX :: Linux Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Topic :: Education Topic :: Education :: Computer Aided Instruction (CAI) Topic :: Scientific/Engineering :: Artificial Intelligence @@ -39,13 +42,14 @@ install_requires = bs4 fastapi # hfst # python3.8 + install using `apt-get install python3-hfst` + importlib_resources nltk pandas pexpect sphinx_autodoc_typehints stanza>=1.1.1 uvicorn -python_requires = >2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* +python_requires = >2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.* include_package_data = True package_dir = =src diff --git a/src/udar/misc.py b/src/udar/misc.py index cfb72ab..7a3f311 100644 --- a/src/udar/misc.py +++ b/src/udar/misc.py @@ -2,7 +2,10 @@ from collections import namedtuple from enum import Enum -from importlib.resources import files +try: + from importlib.resources import files +except ImportError: + from importlib_resources import files # < Python 3.9 import os from pathlib import Path import re