Make mysql optdep

master
pictuga 2021-09-11 12:12:51 +02:00
parent 97d9dda547
commit 75bb69f0fd
2 changed files with 10 additions and 3 deletions

View File

@ -630,7 +630,10 @@ class BaseCache:
return True
import sqlite3 # isort:skip
try:
import sqlite3 # isort:skip
except ImportError:
pass
class SQLiteCache(BaseCache):
@ -667,7 +670,10 @@ class SQLiteCache(BaseCache):
self.con.execute('INSERT INTO data VALUES (?,?,?,?,?,?) ON CONFLICT(url) DO UPDATE SET code=?, msg=?, headers=?, data=?, timestamp=?', (url,) + value + value)
import pymysql.cursors # isort:skip
try:
import pymysql.cursors # isort:skip
except ImportError:
pass
class MySQLCacheHandler(BaseCache):

View File

@ -13,7 +13,8 @@ setup(
download_url = 'https://git.pictuga.com/pictuga/morss',
license = 'AGPL v3',
packages = [package_name],
install_requires = ['lxml', 'bs4', 'python-dateutil', 'chardet', 'pymysql'],
install_requires = ['lxml', 'bs4', 'python-dateutil', 'chardet'],
extras_require = {'full': ['pymysql']},
package_data = {package_name: ['feedify.ini']},
data_files = [
('share/' + package_name, ['README.md', 'LICENSE']),