Skip to content

Commit

Permalink
Merge pull request #355 from pquentin/remove-appengine-support
Browse files Browse the repository at this point in the history
Remove Google AppEngine support
  • Loading branch information
sigmavirus24 committed Apr 28, 2023
2 parents 9d47ccf + 1a5a2b1 commit 6c7fe9d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 376 deletions.
11 changes: 11 additions & 0 deletions HISTORY.rst
@@ -1,6 +1,17 @@
History
=======

1.0.0 -- 2023-XX-XX
-------------------

Breaking Changes
~~~~~~~~~~~~~~~~

- Removed Google App Engine support

Fixed Bugs
~~~~~~~~~~

0.10.1 -- 2022-10-25
--------------------

Expand Down
57 changes: 0 additions & 57 deletions docs/adapters.rst
Expand Up @@ -7,8 +7,6 @@ The toolbelt comes with several different transport adapters for you to use
with requests. The transport adapters are all kept in
:mod:`requests_toolbelt.adapters` and include

- :class:`requests_toolbelt.adapters.appengine.AppEngineAdapter`

- :class:`requests_toolbelt.adapters.fingerprint.FingerprintAdapter`

- :class:`requests_toolbelt.adapters.socket_options.SocketOptionsAdapter`
Expand All @@ -23,61 +21,6 @@ with requests. The transport adapters are all kept in

- :class:`requests_toolbelt.adapters.x509.X509Adapter`

AppEngineAdapter
----------------

.. versionadded:: 0.6.0

As of version 2.10.0, Requests will be capable of supporting Google's App
Engine platform. In order to use Requests on GAE, however, you will need a
custom adapter found here as
:class:`~requests_toolbelt.adapters.appengine.AppEngineAdapter`. There are two
ways to take advantage of this support at the moment:

#. Using the :class:`~requests_toolbelt.adapters.appengine.AppEngineAdapter`
like every other adapter, e.g.,

.. code-block:: python
import requests
from requests_toolbelt.adapters import appengine
s = requests.Session()
s.mount('http://', appengine.AppEngineAdapter())
s.mount('https://', appengine.AppEngineAdapter())
#. By monkey-patching requests to always use the provided adapter:

.. code-block:: python
import requests
from requests_toolbelt.adapters import appengine
appengine.monkeypatch()
.. _insecure_appengine:

If you should need to disable certificate validation when monkeypatching (to
force third-party libraries that use Requests to not validate certificates, if
they do not provide API surface to do so, for example), you can disable it:

.. code-block:: python
from requests_toolbelt.adapters import appengine
appengine.monkeypatch(validate_certificate=False)
.. warning::

If ``validate_certificate`` is ``False``, the monkeypatched adapter
will *not* validate certificates. This effectively sets the
``validate_certificate`` argument to urlfetch.Fetch() to ``False``. You
should avoid using this wherever possible. Details can be found in the
`documentation for urlfetch.Fetch()`_.

.. _documentation for urlfetch.Fetch(): https://cloud.google.com/appengine/docs/python/refdocs/google.appengine.api.urlfetch

.. autoclass:: requests_toolbelt.adapters.appengine.AppEngineAdapter

FingerprintAdapter
------------------

Expand Down
9 changes: 0 additions & 9 deletions requests_toolbelt/_compat.py
Expand Up @@ -41,14 +41,6 @@
except ImportError:
from urllib3.util import timeout

if requests.__build__ < 0x021000:
gaecontrib = None
else:
try:
from requests.packages.urllib3.contrib import appengine as gaecontrib
except ImportError:
from urllib3.contrib import appengine as gaecontrib

PY3 = sys.version_info > (3, 0)

if PY3:
Expand Down Expand Up @@ -306,6 +298,5 @@ def from_httplib(cls, message): # Python 2
'HTTPHeaderDict',
'queue',
'urlencode',
'gaecontrib',
'urljoin',
)
206 changes: 0 additions & 206 deletions requests_toolbelt/adapters/appengine.py

This file was deleted.

12 changes: 0 additions & 12 deletions requests_toolbelt/exceptions.py
Expand Up @@ -23,15 +23,3 @@ class RequestsVersionTooOld(Warning):
this warning to the user.
"""
pass


class IgnoringGAECertificateValidation(Warning):
"""Used to indicate that given GAE validation behavior will be ignored.
If the user has tried to specify certificate validation when using the
insecure AppEngine adapter, it will be ignored (certificate validation will
remain off), so we will issue this warning to the user.
In :class:`requests_toolbelt.adapters.appengine.InsecureAppEngineAdapter`.
"""
pass

0 comments on commit 6c7fe9d

Please sign in to comment.