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
2 changes: 1 addition & 1 deletion .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:5581906b957284864632cde4e9c51d1cc66b0094990b27e689132fe5cd036046
digest: sha256:fbbc8db67afd8b7d71bf694c5081a32da0c528eba166fbcffb3b6e56ddf907d5
61 changes: 61 additions & 0 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
on:
pull_request:
branches:
- main
name: unittest
jobs:
unit:
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed.
# Use ubuntu-22.04 until Python 3.7 is removed from the test matrix
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
runs-on: ubuntu-22.04
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install nox
run: |
python -m pip install --upgrade setuptools pip wheel
python -m pip install nox
- name: Run unit tests
env:
COVERAGE_FILE: .coverage-${{ matrix.python }}
run: |
nox -s unit-${{ matrix.python }}
- name: Upload coverage results
uses: actions/upload-artifact@v4
with:
name: coverage-artifact-${{ matrix.python }}
path: .coverage-${{ matrix.python }}
include-hidden-files: true

cover:
runs-on: ubuntu-latest
needs:
- unit
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Install coverage
run: |
python -m pip install --upgrade setuptools pip wheel
python -m pip install coverage
- name: Download coverage results
uses: actions/download-artifact@v4
with:
path: .coverage-results/
- name: Report coverage results
run: |
find .coverage-results -type f -name '*.zip' -exec unzip {} \;
coverage combine .coverage-results/**/.coverage*
coverage report --show-missing --fail-under=100
2 changes: 1 addition & 1 deletion .kokoro/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

# DO NOT EDIT - automatically generated.
# All versions used to test samples.
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
Expand Down
40 changes: 40 additions & 0 deletions .kokoro/samples/python3.14/common.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Build logs will be here
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py-3.14"
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "python-docs-samples-tests-314"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-ndb/.kokoro/test-samples.sh"
}

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
}

# Download secrets for samples
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-ndb/.kokoro/trampoline_v2.sh"
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.14/continuous.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
11 changes: 11 additions & 0 deletions .kokoro/samples/python3.14/periodic-head.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-ndb/.kokoro/test-samples-against-head.sh"
}
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.14/periodic.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "False"
}
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.14/presubmit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
6 changes: 4 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ In order to add a feature to ``python-ndb``:
documentation (in ``docs/``).

- The feature must work fully on the following CPython versions:
3.7, 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13 on both UNIX and Windows.
3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows.

- The feature must not add unnecessary dependencies (where
"unnecessary" is of course subjective, but new dependencies should
Expand Down Expand Up @@ -151,7 +151,7 @@ Running System Tests

.. note::

System tests are only configured to run under Python 3.8. For
System tests are only configured to run under Python 3.14. For
expediency, we do not run them in older versions of Python 3.

This alone will not run the tests. You'll need to change some local
Expand Down Expand Up @@ -267,6 +267,7 @@ We support:
- `Python 3.11`_
- `Python 3.12`_
- `Python 3.13`_
- `Python 3.14`_

.. _Python 3.7: https://docs.python.org/3.7/
.. _Python 3.8: https://docs.python.org/3.8/
Expand All @@ -275,6 +276,7 @@ We support:
.. _Python 3.11: https://docs.python.org/3.11/
.. _Python 3.12: https://docs.python.org/3.12/
.. _Python 3.13: https://docs.python.org/3.13/
.. _Python 3.14: https://docs.python.org/3.14/


Supported versions can be found in our ``noxfile.py`` `config`_.
Expand Down
1 change: 0 additions & 1 deletion google/cloud/ndb/_datastore_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ def __init__(self, options):
self.todo = {}

def full(self):

"""Indicates whether more work can be added to this batch.

Returns:
Expand Down
1 change: 0 additions & 1 deletion google/cloud/ndb/_datastore_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,6 @@ def _compare(self, other):
return NotImplemented

for order in self.order_by:

if order.name == "__key__":
this_value = helpers.key_from_protobuf(
self.result_pb.entity.key
Expand Down
11 changes: 1 addition & 10 deletions google/cloud/ndb/_gql.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def __init__(self, query_string, _app=None, _auth_domain=None, namespace=None):
raise error

def _InitializeParseState(self):

self._kind = None
self._keys_only = False
self._projection = None
Expand Down Expand Up @@ -330,9 +329,7 @@ def _FilterList(self):
self._CheckFilterSyntax(identifier, condition)

if not self._AddSimpleFilter(identifier, condition, self._Reference()):

if not self._AddSimpleFilter(identifier, condition, self._Literal()):

type_cast = self._TypeCast()
if not type_cast or not self._AddProcessedParameterFilter(
identifier, condition, *type_cast
Expand Down Expand Up @@ -378,7 +375,6 @@ def _CheckFilterSyntax(self, identifier, raw_condition):
condition = raw_condition.lower()
if identifier.lower() == "ancestor":
if condition == "is":

if self._has_ancestor:
self._Error('Only one ANCESTOR IS" clause allowed')
else:
Expand Down Expand Up @@ -508,13 +504,11 @@ def _Literal(self):
self._next_symbol += 1

if literal is None:

literal = self._AcceptRegex(self._quoted_string_regex)
if literal:
literal = literal[1:-1].replace("''", "'")

if literal is None:

if self._Accept("TRUE"):
literal = True
elif self._Accept("FALSE"):
Expand Down Expand Up @@ -548,7 +542,6 @@ def _TypeCast(self, can_cast_list=True):
cast_op = self._AcceptRegex(self._cast_regex)
if not cast_op:
if can_cast_list and self._Accept("("):

cast_op = "list"
else:
return None
Expand Down Expand Up @@ -588,11 +581,9 @@ def _OrderList(self):
def _Limit(self):
"""Consume the LIMIT clause."""
if self._Accept("LIMIT"):

maybe_limit = self._AcceptRegex(self._number_regex)

if maybe_limit:

if self._Accept(","):
self._offset = int(maybe_limit)
maybe_limit = self._AcceptRegex(self._number_regex)
Expand Down Expand Up @@ -674,7 +665,7 @@ def query_filters(self, model_class, filters):
name, op = name_op
values = gql_filters[name_op]
op = op.lower()
for (func, args) in values:
for func, args in values:
prop = model_class._properties.get(name)
val = self._args_to_val(func, args)
if isinstance(val, query_module.ParameterizedThing):
Expand Down
2 changes: 0 additions & 2 deletions google/cloud/ndb/_legacy_entity_pb.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ def TryMerge(self, d):


class Property(ProtocolBuffer.ProtocolMessage):

NO_MEANING = 0
BLOB = 14
TEXT = 15
Expand Down Expand Up @@ -691,7 +690,6 @@ def TryMerge(self, d):


class EntityProto(ProtocolBuffer.ProtocolMessage):

has_key_ = 0
has_owner_ = 0
owner_ = None
Expand Down
1 change: 0 additions & 1 deletion google/cloud/ndb/_legacy_protocol_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ def get64(self):
)

def getVarInt32(self):

b = self.get8()
if not (b & 128):
return b
Expand Down
Loading