Skip to content

Commit

Permalink
Merge pull request googleapis#99 from jgeewax/koss-firestore-config
Browse files Browse the repository at this point in the history
Configure new service for Cloud Firestore
  • Loading branch information
dhermes authored Nov 9, 2016
2 parents 7696b03 + bf4044f commit f6850a2
Show file tree
Hide file tree
Showing 15 changed files with 250 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/firestore.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Firestore
=========

.. automodule:: google.cloud.firestore
:members:
:show-inheritance:

Firestore Client
~~~~~~~~~~~~~~~~
.. automodule:: google.cloud.firestore.client
:members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
datastore-batches
datastore-helpers

.. toctree::
:maxdepth: 0
:hidden:
:caption: Firestore

firestore

.. toctree::
:maxdepth: 0
:hidden:
Expand Down
11 changes: 11 additions & 0 deletions firestore/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[run]
branch = True

[report]
fail_under = 100
show_missing = True
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
# Ignore debug-only repr
def __repr__
4 changes: 4 additions & 0 deletions firestore/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include README.rst
graft google
graft unit_tests
global-exclude *.pyc
2 changes: 2 additions & 0 deletions firestore/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Google Cloud Firestore SDK
==========================
20 changes: 20 additions & 0 deletions firestore/google/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
20 changes: 20 additions & 0 deletions firestore/google/cloud/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
17 changes: 17 additions & 0 deletions firestore/google/cloud/firestore/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Firestore database API public classes."""

from google.cloud.firestore.client import Client
26 changes: 26 additions & 0 deletions firestore/google/cloud/firestore/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Firestore database SDK Client."""


class Client(object):
"""Firestore Client.
:type project: str
:param project: (optional) Project containing the Firestore database.
"""

def __init__(self, project=None):
raise NotImplementedError()
2 changes: 2 additions & 0 deletions firestore/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
universal = 1
68 changes: 68 additions & 0 deletions firestore/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from setuptools import find_packages
from setuptools import setup


PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))

with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj:
README = file_obj.read()


# NOTE: This is duplicated throughout and we should try to
# consolidate.
SETUP_BASE = {
'author': 'Google Cloud Platform',
'author_email': 'jjg+google-cloud-python@google.com',
'scripts': [],
'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python',
'license': 'Apache 2.0',
'platforms': 'Posix; MacOS X; Windows',
'include_package_data': True,
'zip_safe': False,
'classifiers': [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Internet',
],
}

REQUIREMENTS = [
'google-cloud-core >= 0.20',
]

setup(
name='google-cloud-firestore',
version='0.20.0',
description='Python Client for Google Cloud Firestore',
long_description=README,
namespace_packages=[
'google',
'google.cloud',
],
packages=find_packages(),
install_requires=REQUIREMENTS,
**SETUP_BASE
)
30 changes: 30 additions & 0 deletions firestore/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[tox]
envlist =
py27,py34,py35,cover

[testing]
deps =
{toxinidir}/../core
pytest
covercmd =
py.test --quiet \
--cov=google.cloud.firestore \
--cov=unit_tests \
--cov-config {toxinidir}/.coveragerc \
unit_tests

[testenv]
commands =
py.test --quiet {posargs} unit_tests
deps =
{[testing]deps}

[testenv:cover]
basepython =
python2.7
commands =
{[testing]covercmd}
deps =
{[testenv]deps}
coverage
pytest-cov
23 changes: 23 additions & 0 deletions firestore/unit_tests/test_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest

from google.cloud.firestore import Client


class TestFirestore(unittest.TestCase):
def test_constructor(self):
with self.assertRaises(NotImplementedError):
Client('my-project-id')
1 change: 1 addition & 0 deletions scripts/verify_included_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
'datastore',
'dns',
'error_reporting',
'firestore',
'language',
'logging',
'monitoring',
Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ deps =
{toxinidir}/bigtable
{toxinidir}/storage
{toxinidir}/datastore
{toxinidir}/firestore
{toxinidir}/bigquery
{toxinidir}/pubsub
{toxinidir}/logging
Expand Down Expand Up @@ -45,6 +46,12 @@ covercmd =
--cov-append \
--cov-config {toxinidir}/.coveragerc \
datastore/unit_tests
py.test --quiet \
--cov=google.cloud \
--cov=unit_tests \
--cov-append \
--cov-config {toxinidir}/.coveragerc \
firestore/unit_tests
py.test --quiet \
--cov=google.cloud \
--cov=unit_tests \
Expand Down

0 comments on commit f6850a2

Please sign in to comment.