chore: add missing nox sessions and polish dependencies in django-google-spanner#17284
Conversation
There was a problem hiding this comment.
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.
7e60ed3 to
a200c7b
Compare
Description
This PR implements missing nox sessions and refactors dependency management inside
packages/django-google-spanner/noxfile.pyto align with google-cloud standard practices.Key Changes
1. Constants Architecture
All dependencies and version definitions have been concentrated at the top of
noxfile.pyin 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 tosetup.pyand lower-bounds inconstraints.txt).UNIT_TEST_DEPENDENCIES: Connector library requirements (django~=5.2andsqlparse==0.3.1pinned 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-depsflags.mypy: Implemented and configured to skip gracefully with a standardTODOissue link (issue/17047) indicating that typehints will be added on a separate task.format: Integrated standard Ruff formatting and import sorting.Fixes: #17047