From 77e188fa3d2273312302654e40d31f6492ba9ffa Mon Sep 17 00:00:00 2001 From: Leon Feng Date: Wed, 5 Sep 2018 14:57:46 -0400 Subject: [PATCH 1/3] quick fix for pip 10 --- setup.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c4b07ba..16fd185 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,14 @@ """This module contains the packaging routine for the pybook package""" from setuptools import setup, find_packages -from pip.download import PipSession -from pip.req import parse_requirements +try: + from pip.download import PipSession + from pip.req import parse_requirements +except ImportError: + # It is quick hack to support pip 10 that has changed its internal + # structure of the modules. + from pip._internal.download import PipSession + from pip._internal.req.req_file import parse_requirements def get_requirements(source): From d483b645e5a345b689f7704c66d670600f02baa7 Mon Sep 17 00:00:00 2001 From: Leon Feng Date: Wed, 5 Sep 2018 16:13:45 -0400 Subject: [PATCH 2/3] support python 2 --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1bdc193..874fc38 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,12 @@ You will also need one of the Selenium [compatible browsers](http://www.selenium ## Configuration 1. Add the browser to use, the path to the executable, and the arguments to pass to the executable to the scrapy settings: ```python - from shutil import which + try: + # python 3 + from shutil import which + except ImportError: + # python 2 + from distutils.spawn import find_executable as which SELENIUM_DRIVER_NAME='firefox' SELENIUM_DRIVER_EXECUTABLE_PATH=which('geckodriver') From e746e1725c2c216da061b0dd39805b3bea4d3fd0 Mon Sep 17 00:00:00 2001 From: Leon Feng <523684+leon0707@users.noreply.github.com> Date: Sat, 8 Sep 2018 12:24:47 -0400 Subject: [PATCH 3/3] Update README.md --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 874fc38..1bdc193 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,7 @@ You will also need one of the Selenium [compatible browsers](http://www.selenium ## Configuration 1. Add the browser to use, the path to the executable, and the arguments to pass to the executable to the scrapy settings: ```python - try: - # python 3 - from shutil import which - except ImportError: - # python 2 - from distutils.spawn import find_executable as which + from shutil import which SELENIUM_DRIVER_NAME='firefox' SELENIUM_DRIVER_EXECUTABLE_PATH=which('geckodriver')