Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.

Commit a3a6344

Browse files
authored
fix: Update version to 2.2.0a1 (#506)
Add version file, replace some hardcoded version strings. Still more to go. Also update setup.py. Supersedes #502.
1 parent 803ad0a commit a3a6344

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

django_spanner/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# https://developers.google.com/open-source/licenses/bsd
66

77
from django.db.backends.base.base import BaseDatabaseWrapper
8-
from google.cloud import spanner_v1 as spanner, spanner_dbapi as Database
8+
from google.cloud import spanner_dbapi as Database, spanner_v1 as spanner
99

1010
from .client import DatabaseClient
1111
from .creation import DatabaseCreation
@@ -116,7 +116,7 @@ def get_connection_params(self):
116116
"project": self.settings_dict["PROJECT"],
117117
"instance_id": self.settings_dict["INSTANCE"],
118118
"database_id": self.settings_dict["NAME"],
119-
"user_agent": "django_spanner/0.0.1",
119+
"user_agent": "django_spanner/2.2.0a1",
120120
**self.settings_dict["OPTIONS"],
121121
}
122122

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import sys
2020
import os
2121

22+
from version import __version__
23+
2224
# If extensions (or modules to document with autodoc) are in another directory,
2325
# add this directory to sys.path here. If the directory is relative to the
2426
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -28,8 +30,6 @@
2830
# See also: https://github.com/docascode/sphinx-docfx-yaml/issues/85
2931
sys.path.insert(0, os.path.abspath("."))
3032

31-
__version__ = "alpha"
32-
3333
# -- General configuration ------------------------------------------------
3434

3535
# If your documentation needs a minimal Sphinx version, state it here.

google/cloud/spanner_dbapi/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from google.api_core.gapic_v1.client_info import ClientInfo
1010

11-
VERSION = "0.0.1"
11+
VERSION = "2.2.0a1"
1212
DEFAULT_USER_AGENT = "django_spanner/" + VERSION
1313

1414
vers = sys.version_info

setup.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
from setuptools import find_packages, setup
1111

1212
# Package metadata.
13-
1413
name = "django-google-spanner"
1514
description = "Bridge to enable using Django with Spanner."
16-
version = "2.2a0"
1715
# Should be one of:
1816
# 'Development Status :: 3 - Alpha'
1917
# 'Development Status :: 4 - Beta'
@@ -22,23 +20,28 @@
2220
dependencies = ["sqlparse >= 0.3.0", "google-cloud-spanner >= 1.8.0"]
2321
extras = {}
2422

23+
BASE_DIR = os.path.dirname(__file__)
24+
VERSION_FILENAME = os.path.join(BASE_DIR, "version.py")
25+
PACKAGE_INFO = {}
26+
with open(VERSION_FILENAME) as f:
27+
exec(f.read(), PACKAGE_INFO)
28+
version = PACKAGE_INFO["__version__"]
2529

2630
# Setup boilerplate below this line.
2731

28-
package_root = os.path.abspath(os.path.dirname(__file__))
32+
package_root = os.path.abspath(BASE_DIR)
2933

3034
readme_filename = os.path.join(package_root, "README.rst")
3135
with io.open(readme_filename, encoding="utf-8") as readme_file:
3236
readme = readme_file.read()
3337

34-
3538
setup(
3639
name=name,
3740
version=version,
3841
description=description,
3942
long_description=readme,
4043
author="Google LLC",
41-
author_email="cloud-spanner-developers@googlegroups.com",
44+
author_email="googleapis-packages@google.com",
4245
license="BSD",
4346
packages=find_packages(exclude=["tests"]),
4447
install_requires=dependencies,

version.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Use of this source code is governed by a BSD-style
4+
# license that can be found in the LICENSE file or at
5+
# https://developers.google.com/open-source/licenses/bsd
6+
7+
__version__ = "2.2.0a1"

0 commit comments

Comments
 (0)