Skip to content

Commit a38377d

Browse files
committed
socks module is bundled with httplib2 v0.7.
As unfortunate as bundling may be, we may as well take advantage of it.
1 parent 83fee10 commit a38377d

File tree

5 files changed

+2
-18
lines changed

5 files changed

+2
-18
lines changed

doc/api/client.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ API calls are limited by github.com to 1 per second by default. To have the
4242
>>> github = Github(username="ask", api_token=".......",
4343
... requests_per_second=1)
4444

45-
If you wish to use the library with a HTTP proxy, you will require a Python
46-
SOCKS module installed. :pypi:`SocksiPy-branch` is the module we test with, but
47-
various forks are available. Pass in the ``proxy_host`` and optionally
45+
If you wish to use a HTTP proxy you can pass in the ``proxy_host`` and
4846
``proxy_port`` settings to enable it. The default for ``proxy_port``, if not
4947
given, is 8080::
5048

doc/install.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ for handling HTTP sessions. :pypi:`python-dateutil` is used for its date
2525
handling [#]_. :pypi:`simplejson` is also required when using :mod:`github2`
2626
with Python 2.4 or 2.5. If you install via :pypi:`pip` or :pypi:`easy_install
2727
<setuptools>` the dependencies should be installed automatically for you.
28-
:pypi:`SocksiPy-branch` is an optional dependency if proxy support is needed.
2928

3029
.. [#] You must use :pypi:`python-dateutil` 1.x when working with Python 2.x,
3130
the latest 2.x releases are for Python 3.x installations only.

github2/request.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
import json as simplejson # For Python 2.6
88
except ImportError:
99
import simplejson
10-
try:
11-
import socks # SOCKS support may not be installed
12-
except ImportError:
13-
socks = None
1410
from os import path
1511
from urlparse import (urlsplit, urlunsplit)
1612
try:
@@ -78,11 +74,8 @@ def __init__(self, username=None, api_token=None, url_prefix=None,
7874
"DigiCert_High_Assurance_EV_Root_CA.crt")
7975
if proxy_host is None:
8076
self._http = httplib2.Http(cache=cache, ca_certs=digicert_ha_cert)
81-
elif proxy_host and socks is None:
82-
raise GithubError('Proxy support missing. '
83-
'Install a Python SOCKS library.')
8477
else:
85-
proxy_info = httplib2.ProxyInfo(socks.PROXY_TYPE_HTTP,
78+
proxy_info = httplib2.ProxyInfo(httplib2.socks.PROXY_TYPE_HTTP,
8679
proxy_host, proxy_port)
8780
self._http = httplib2.Http(proxy_info=proxy_info, cache=cache,
8881
ca_certs=digicert_ha_cert)

setup.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@
4747
zip_safe=True,
4848
test_suite="nose.collector",
4949
tests_require=['nose'],
50-
extras_require={
51-
'SOCKS': ['SocksiPy-branch==1.01'],
52-
},
5350
classifiers=[
5451
"Development Status :: 5 - Production/Stable",
5552
"Intended Audience :: Developers",

tox.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ envlist = py24, py25, py26, py27, py31, py32, rst, sphinx
66
deps =
77
nose
88
coverage
9-
10-
# Optional dep, but required for tests
11-
SocksiPy-branch
129
commands =
1310
rm -rf build
1411
{envpython} setup.py build

0 commit comments

Comments
 (0)