Skip to content

Commit

Permalink
Merge mobolic#471 (update Python and Graph API versions).
Browse files Browse the repository at this point in the history
  • Loading branch information
martey committed Feb 12, 2020
2 parents 09b281b + c4bdaa4 commit d7b54d6
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 49 deletions.
34 changes: 9 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,30 @@ workflows:
version: 2
build:
jobs:
- test-python-2.7
- test-python-3.4
- test-python-3.5
- test-python-3.6
- test-python-3.7
- test-python-3.8
jobs:
test-python-2.7: &test-python-template
test-python-3.5: &test-python-template
docker:
- image: circleci/python:2.7-browsers
- image: circleci/python:3.5-browsers
working_directory: ~/facebook-sdk
steps:
- checkout
- run:
name: install virtualenv and dependencies
command: |
mkdir -p ~/venv
if [ $(python -c "import platform; print(platform.python_version_tuple()[0])") == "2" ]; then
virtualenv ~/venv;
else
python -m venv ~/venv;
fi;
python -m venv ~/venv;
. ~/venv/bin/activate
pip install coverage pygments
pip install -e .
- run:
name: install mock if running Python 2
command: |
. ~/venv/bin/activate
if [ $(python -c "import platform; print(platform.python_version_tuple()[0])") == "2" ]; then
pip install mock
fi;
- run:
name: run linting
command: |
. ~/venv/bin/activate
if [ $(python -c "import platform; print(platform.python_version()[:3])") == "3.7" ]; then
if [ $(python -c "import platform; print(platform.python_version()[:3])") == "3.8" ]; then
pip install black doc8;
black -l 79 --check examples;
black -l 79 --check facebook;
Expand All @@ -65,14 +53,6 @@ jobs:
name: upload test coverage reports to CodeClimate
command: |
./cc-test-reporter sum-coverage -o - -p $CIRCLE_NODE_TOTAL coverage/codeclimate.*.json | ./cc-test-reporter upload-coverage --debug -i -
test-python-3.4:
<<: *test-python-template
docker:
- image: circleci/python:3.4-browsers
test-python-3.5:
<<: *test-python-template
docker:
- image: circleci/python:3.5-browsers
test-python-3.6:
<<: *test-python-template
docker:
Expand All @@ -81,3 +61,7 @@ jobs:
<<: *test-python-template
docker:
- image: circleci/python:3.7-browsers
test-python-3.8:
<<: *test-python-template
docker:
- image: circleci/python:3.8-browsers
8 changes: 5 additions & 3 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
Changelog
=========

Version 3.2.0 (unreleased)
Version 4.0.0 (unreleased)
==========================
- Add support for Graph API versions 3.2, 3.3, 4.0, and 5.0.
- Remove support for Graph API versions 2.8, 2.9, and 2.10.
- Add support for Python 3.8.
- Remove support for Python 2.7 and 3.4.
- Add support for Graph API versions 3.2, 3.3, 4.0, 5.0, and 6.0.
- Remove support for Graph API versions 2.8, 2.9, 2.10, and 2.11.
- Change default Graph API version to 2.10.
- Add support for securing Graph API Calls with a proof based on the
application secret (#454).
Expand Down
3 changes: 1 addition & 2 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
Installation
============

The SDK currently supports Python 2.7 and Python 3.4-3.7. The `requests`_
package is required.
The SDK currently supports Python 3.5+. The `requests`_ package is required.

We recommend using `pip`_ and `virtualenv`_ to install the SDK. Please note
that the SDK's Python package is called **facebook-sdk**.
Expand Down
9 changes: 2 additions & 7 deletions facebook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@
import requests
import json
import re

try:
from urllib.parse import parse_qs, urlencode, urlparse
except ImportError:
from urlparse import parse_qs, urlparse
from urllib import urlencode
from urllib.parse import parse_qs, urlencode, urlparse

from . import version

Expand All @@ -46,7 +41,7 @@
FACEBOOK_GRAPH_URL = "https://graph.facebook.com/"
FACEBOOK_WWW_URL = "https://www.facebook.com/"
FACEBOOK_OAUTH_DIALOG_PATH = "dialog/oauth?"
VALID_API_VERSIONS = ["2.11", "2.12", "3.0", "3.1", "3.2", "3.3", "4.0", "5.0"]
VALID_API_VERSIONS = ["2.12", "3.0", "3.1", "3.2", "3.3", "4.0", "5.0", "6.0"]
VALID_SEARCH_TYPES = ["place", "placetopic"]


Expand Down
2 changes: 1 addition & 1 deletion facebook/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# License for the specific language governing permissions and limitations
# under the License.

__version__ = "3.2.0-pre"
__version__ = "4.0.0-pre"
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
classifiers=[
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
install_requires=['requests'],
tests_require=["coverage"],
Expand Down
5 changes: 1 addition & 4 deletions test/test_application_secret_proof.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock

import facebook
from . import FacebookTestCase
Expand Down
6 changes: 1 addition & 5 deletions test/test_oauth_dialog_url.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
try:
from urllib.parse import parse_qs, urlencode, urlparse
except ImportError:
from urlparse import parse_qs, urlparse
from urllib import urlencode
from urllib.parse import parse_qs, urlencode, urlparse

import facebook
from . import FacebookTestCase
Expand Down

0 comments on commit d7b54d6

Please sign in to comment.