diff --git a/.travis.yml b/.travis.yml index 206afe24..e95df4e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ before_install: # Define TZ as some tests rely on timezone - export TZ=Europe/Brussels - pip install --quiet pytest==4.4 pytest-cov pytest-xdist chardet + - pip install ".[mysql]" install: - python setup.py install --quiet diff --git a/README.md b/README.md index 98a117d5..0efec9a2 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,12 @@ If you have pip, you can automatically download and install from the [PyPI repos pip install pattern ``` +If you wish to use MySQL support, install specifying the optional extra +requirement: +``` +pip install pattern[mysql] +``` + If none of the above works, you can make Python aware of the module in three ways: - Put the pattern folder in the same folder as your script. - Put the pattern folder in the standard location for modules so it is available to all scripts: diff --git a/setup.py b/setup.py index 6b7a0d88..c6520c78 100644 --- a/setup.py +++ b/setup.py @@ -137,7 +137,6 @@ install_requires = [ "future", "backports.csv", - "mysqlclient", "beautifulsoup4", "lxml", "feedparser", @@ -149,5 +148,8 @@ "cherrypy" if sys.version >= "3" else "cherrypy==17.4.1", "requests" ], + extras_require = { + 'mysql': ["mysqlclient"], + }, zip_safe = False )