Skip to content

chore: add missing nox sessions and polish dependencies in django-google-spanner#17284

Merged
chalmerlowe merged 1 commit into
mainfrom
chore/add-nox-session-django-google-spanner
May 28, 2026
Merged

chore: add missing nox sessions and polish dependencies in django-google-spanner#17284
chalmerlowe merged 1 commit into
mainfrom
chore/add-nox-session-django-google-spanner

Conversation

@chalmerlowe
Copy link
Copy Markdown
Contributor

@chalmerlowe chalmerlowe commented May 28, 2026

Description

This PR implements missing nox sessions and refactors dependency management inside packages/django-google-spanner/noxfile.py to align with google-cloud standard practices.


Key Changes

1. Constants Architecture

All dependencies and version definitions have been concentrated at the top of noxfile.py in nestled, unpinned constants:

  • UNIT_TEST_STANDARD_DEPENDENCIES: Standard testing frameworks/runners (mock, pytest, pytest-cov, coverage).
  • UNIT_TEST_EXTERNAL_DEPENDENCIES: Telemetry and setuptools helpers (unpinned to delegate versioning strictly to setup.py and lower-bounds in constraints.txt).
  • UNIT_TEST_DEPENDENCIES: Connector library requirements (django~=5.2 and sqlparse==0.3.1 pinned to protect SQL compiler string assertions).
  • UNIT_TEST_MOCKSERVER_DEPENDENCIES: Specialized mockserver overrides (django~=5.2, google-cloud-spanner>=3.55.0, sqlparse>=0.4.4).

NOTES:

  • core_deps_from_source & prerelease_deps: Standard dependencies are first installed normally from PyPI, and then target core packages are cleanly overwritten with local source paths/pre-releases using pip's native --ignore-installed --no-deps flags.
  • mypy: Implemented and configured to skip gracefully with a standard TODO issue link (issue/17047) indicating that typehints will be added on a separate task.
  • format: Integrated standard Ruff formatting and import sorting.

Fixes: #17047

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors noxfile.py to modularize unit test dependencies into reusable lists and implements the previously skipped core_deps_from_source and prerelease_deps test sessions, parametrizing them over protobuf implementations. The feedback highlights three key improvements: first, core_deps_from_source should check for the existence of local dependency directories before installation to prevent directory-not-found errors; second, the dynamic Django version replacement should be made more robust by checking if a dependency starts with "django" rather than relying on a hardcoded string replacement; and third, Python version comparisons should use integer tuples instead of string comparisons to avoid fragile evaluations.

Comment thread packages/django-google-spanner/noxfile.py
Comment thread packages/django-google-spanner/noxfile.py Outdated
Comment thread packages/django-google-spanner/noxfile.py
@chalmerlowe chalmerlowe force-pushed the chore/add-nox-session-django-google-spanner branch from 7e60ed3 to a200c7b Compare May 28, 2026 12:10
@chalmerlowe chalmerlowe marked this pull request as ready for review May 28, 2026 12:16
@chalmerlowe chalmerlowe requested a review from a team as a code owner May 28, 2026 12:16
@chalmerlowe chalmerlowe merged commit 7da3940 into main May 28, 2026
51 checks passed
@chalmerlowe chalmerlowe deleted the chore/add-nox-session-django-google-spanner branch May 28, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[monorepo] Add or update nox sessions for packages/django-google-spanner/

2 participants