Skip to content

Commit

Permalink
fix: Update version to 2.2.0a1 (#506)
Browse files Browse the repository at this point in the history
Add version file, replace some hardcoded version strings. Still more to
go. Also update setup.py.

Supersedes #502.
  • Loading branch information
c24t committed Sep 15, 2020
1 parent 803ad0a commit a3a6344
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions django_spanner/base.py
Expand Up @@ -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
Expand Down Expand Up @@ -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.2.0a1",
**self.settings_dict["OPTIONS"],
}

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/spanner_dbapi/version.py
Expand Up @@ -8,7 +8,7 @@

from google.api_core.gapic_v1.client_info import ClientInfo

VERSION = "0.0.1"
VERSION = "2.2.0a1"
DEFAULT_USER_AGENT = "django_spanner/" + VERSION

vers = sys.version_info
Expand Down
13 changes: 8 additions & 5 deletions setup.py
Expand Up @@ -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'
Expand All @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions 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.2.0a1"

0 comments on commit a3a6344

Please sign in to comment.