diff --git a/django_spanner/base.py b/django_spanner/base.py index a376273514..04948860c8 100644 --- a/django_spanner/base.py +++ b/django_spanner/base.py @@ -5,7 +5,7 @@ # https://developers.google.com/open-source/licenses/bsd from django.db.backends.base.base import BaseDatabaseWrapper -from google.cloud import spanner_v1 as spanner, spanner_dbapi as Database +from google.cloud import spanner_dbapi as Database, spanner_v1 as spanner from .client import DatabaseClient from .creation import DatabaseCreation @@ -116,7 +116,7 @@ def get_connection_params(self): "project": self.settings_dict["PROJECT"], "instance_id": self.settings_dict["INSTANCE"], "database_id": self.settings_dict["NAME"], - "user_agent": "django_spanner/0.0.1", + "user_agent": "django_spanner/2.2a1", **self.settings_dict["OPTIONS"], } diff --git a/docs/conf.py b/docs/conf.py index 301495e535..ff253c4068 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,6 +19,8 @@ import sys import os +from version import __version__ + # If extensions (or modules to document with autodoc) are in another directory, # add this directory to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -28,8 +30,6 @@ # See also: https://github.com/docascode/sphinx-docfx-yaml/issues/85 sys.path.insert(0, os.path.abspath(".")) -__version__ = "alpha" - # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. diff --git a/google/cloud/spanner_dbapi/version.py b/google/cloud/spanner_dbapi/version.py index bf67a4fca8..1b32e8cee5 100644 --- a/google/cloud/spanner_dbapi/version.py +++ b/google/cloud/spanner_dbapi/version.py @@ -8,7 +8,7 @@ from google.api_core.gapic_v1.client_info import ClientInfo -VERSION = "0.0.1" +VERSION = "2.2a1" DEFAULT_USER_AGENT = "django_spanner/" + VERSION vers = sys.version_info diff --git a/setup.py b/setup.py index b8578f2c32..7a5272b5fc 100644 --- a/setup.py +++ b/setup.py @@ -10,10 +10,8 @@ from setuptools import find_packages, setup # Package metadata. - name = "django-google-spanner" description = "Bridge to enable using Django with Spanner." -version = "2.2a0" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' @@ -22,23 +20,28 @@ dependencies = ["sqlparse >= 0.3.0", "google-cloud-spanner >= 1.8.0"] extras = {} +BASE_DIR = os.path.dirname(__file__) +VERSION_FILENAME = os.path.join(BASE_DIR, "version.py") +PACKAGE_INFO = {} +with open(VERSION_FILENAME) as f: + exec(f.read(), PACKAGE_INFO) +version = PACKAGE_INFO["__version__"] # Setup boilerplate below this line. -package_root = os.path.abspath(os.path.dirname(__file__)) +package_root = os.path.abspath(BASE_DIR) readme_filename = os.path.join(package_root, "README.rst") with io.open(readme_filename, encoding="utf-8") as readme_file: readme = readme_file.read() - setup( name=name, version=version, description=description, long_description=readme, author="Google LLC", - author_email="cloud-spanner-developers@googlegroups.com", + author_email="googleapis-packages@google.com", license="BSD", packages=find_packages(exclude=["tests"]), install_requires=dependencies, diff --git a/version.py b/version.py new file mode 100644 index 0000000000..18488f8bf0 --- /dev/null +++ b/version.py @@ -0,0 +1,7 @@ +# Copyright 2020 Google LLC +# +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file or at +# https://developers.google.com/open-source/licenses/bsd + +__version__ = "2.2a1"