From fb4979f728611d006ff69eead382d5aa8ea10322 Mon Sep 17 00:00:00 2001 From: Will Price Date: Thu, 22 Mar 2018 12:51:30 +0000 Subject: [PATCH 1/4] Make mysqlclient an optional dependency --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6b1a8866..978971a7 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", "requests" ], + extra_requires = { + 'mysql': ["mysqlclient"], + }, zip_safe = False ) From e83ac04ab56f8113a1a0678136fe71bb6c0b14a4 Mon Sep 17 00:00:00 2001 From: Will Price Date: Sat, 17 Nov 2018 22:51:21 +0000 Subject: [PATCH 2/4] Add pattern mysql install to .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c6a4d3f7..4e055fbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ before_install: - conda update --yes conda - conda install --yes numpy scipy - pip install --quiet pytest pytest-cov pytest-xdist chardet + - pip install ".[mysql]" install: - python setup.py install --quiet From 00078c52a8ad2f57fe222b401a19017e32208820 Mon Sep 17 00:00:00 2001 From: Will Price Date: Sat, 17 Nov 2018 22:52:30 +0000 Subject: [PATCH 3/4] Add instructions on how to install pattern with mysql support --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) 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: From 3b77852c51d1e80b17d9abba0be5efad6a2fd7a5 Mon Sep 17 00:00:00 2001 From: Will Price Date: Sat, 17 Nov 2018 23:07:53 +0000 Subject: [PATCH 4/4] Fix extra_requires -> extras_require typo --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 978971a7..92bf5ca5 100644 --- a/setup.py +++ b/setup.py @@ -148,7 +148,7 @@ "cherrypy", "requests" ], - extra_requires = { + extras_require = { 'mysql': ["mysqlclient"], }, zip_safe = False