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: 3 additions & 2 deletions google/cloud/ndb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
.. autodata:: __all__
"""

from pkg_resources import get_distribution
from google.cloud.ndb import version

__version__ = get_distribution("google-cloud-ndb").version
__version__ = version.__version__

from google.cloud.ndb.client import Client
from google.cloud.ndb.context import AutoBatcher
Expand Down Expand Up @@ -131,6 +131,7 @@
from google.cloud.ndb._transaction import non_transactional

__all__ = [
"__version__",
"AutoBatcher",
"Client",
"Context",
Expand Down
15 changes: 15 additions & 0 deletions google/cloud/ndb/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2023 Google LLC
#
# 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.
#
__version__ = "2.2.2"
12 changes: 11 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,20 @@

import io
import os
import re

import setuptools


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

version = None

with open(os.path.join(PACKAGE_ROOT, "google/cloud/ndb/version.py")) as fp:
version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read())
assert len(version_candidates) == 1
version = version_candidates[0]

def main():
package_root = os.path.abspath(os.path.dirname(__file__))
readme_filename = os.path.join(package_root, "README.md")
Expand All @@ -36,7 +46,7 @@ def main():

setuptools.setup(
name="google-cloud-ndb",
version = "2.2.2",
version = version,
description="NDB library for Google Cloud Datastore",
long_description=readme,
long_description_content_type="text/markdown",
Expand Down