Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ dist/

# python testing things etc
.coverage
.tox
.nox
env
nosetests.xml
googlemaps.egg-info
*.egg

.vscode/
22 changes: 14 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
language: python
dist: xenial

matrix:
include:
- { python: '2.7', env: TOXENV=py27 }
- { python: '3.4', env: TOXENV=py34 }
- { python: '3.5', env: TOXENV=py35 }
- { python: '3.6', env: TOXENV=py36 }
- { python: '3.6', env: TOXENV=docs }
- python: '2.7'
env: NOXSESSION="tests-2.7"
- python: '3.5'
env: NOXSESSION="tests-3.5"
- python: '3.6'
env: NOXSESSION="tests-3.6"
- python: '3.7'
env: NOXSESSION="tests-3.7"
sudo: required # required for Python 3.7 (github.com/travis-ci/travis-ci#9069)
- python: '2.7'
env: NOXSESSION="docs"

install:
- pip install requests
- pip install tox
- ./.travis/install.sh

script:
- tox
- python3 -m nox --session "$NOXSESSION"
11 changes: 11 additions & 0 deletions .travis/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -exo pipefail

if ! python3 -m pip --version; then
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python3 get-pip.py
sudo python3 -m pip install nox
else
python3 -m pip install nox
fi
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Python Client for Google Maps Services
====================================

[![Build Status](https://travis-ci.org/googlemaps/google-maps-services-python.svg?branch=master)](https://travis-ci.org/googlemaps/google-maps-services-python)
[![codecov](https://codecov.io/gh/googlemaps/google-maps-services-python/branch/master/graph/badge.svg)](https://codecov.io/gh/googlemaps/google-maps-services-python)
[![PyPI version](https://badge.fury.io/py/googlemaps.svg)](https://badge.fury.io/py/googlemaps)
![PyPI - Downloads](https://img.shields.io/pypi/dd/googlemaps)
![GitHub contributors](https://img.shields.io/github/contributors/googlemaps/google-maps-services-python)
Expand Down Expand Up @@ -165,28 +166,28 @@ instead of an API key.
## Building the Project


# Installing tox
$ pip install tox
# Installing nox
$ pip install nox

# Running tests
$ tox
$ nox

# Generating documentation
$ tox -e docs
$ nox -e docs

# Uploading a new release
$ easy_install wheel twine
$ python setup.py sdist bdist_wheel
$ twine upload dist/*

# Copy docs to gh-pages
$ tox -e docs && mv docs/_build/html generated_docs && git clean -Xdi && git checkout gh-pages
$ nox -e docs && mv docs/_build/html generated_docs && git clean -Xdi && git checkout gh-pages


[apikey]: https://developers.google.com/maps/faq#keysystem
[clientid]: https://developers.google.com/maps/documentation/business/webservices/auth

[Google Maps API Web Services]: https://developers.google.com/maps/apis-by-platform#web_service_apis
[Google Maps Platform web services]: https://developers.google.com/maps/apis-by-platform#web_service_apis
[Directions API]: https://developers.google.com/maps/documentation/directions/
[directions-key]: https://developers.google.com/maps/documentation/directions/get-api-key#key
[directions-client-id]: https://developers.google.com/maps/documentation/directions/get-api-key#client-id
Expand Down
57 changes: 57 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import nox


def _install_dev_packages(session):
session.install("-e", ".")


def _install_test_dependencies(session):
session.install("-r", "test_requirements.txt")


def _install_doc_dependencies(session):
session.install("sphinx")


@nox.session(python=["2.7", "3.5", "3.6", "3.7"])
def tests(session):
_install_dev_packages(session)
_install_test_dependencies(session)

session.install("pytest")
session.run("pytest")

session.notify("cover")


@nox.session
def cover(session):
"""Coverage analysis."""
session.install("coverage")
session.install("codecov")
session.run("coverage", "report", "--show-missing")
session.run("codecov")
session.run("coverage", "erase")


@nox.session(python="2.7")
def docs(session):
_install_dev_packages(session)
_install_doc_dependencies(session)

session.run("rm", "-rf", "docs/_build", external=True)

sphinx_args = [
"-a",
"-E",
"-b",
"html",
"-d",
"docs/_build/doctrees",
"docs",
"docs/_build/html",
]

sphinx_cmd = "sphinx-build"

session.run(sphinx_cmd, *sphinx_args)
12 changes: 12 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[tool:pytest]
addopts = -rsxX --cov=googlemaps --cov-report=

[coverage:run]
omit =
googlemaps/test/*

[coverage:report]
exclude_lines =
pragma: no cover
def __repr__
raise NotImplementedError
6 changes: 4 additions & 2 deletions test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
nose
responses==0.3
pytest
pytest-cov
responses
mock
16 changes: 0 additions & 16 deletions tox.ini

This file was deleted.