Skip to content

Commit c341469

Browse files
authored
fix(django-spanner): declare django dependency in setup.py (#18044)
## Description Declares `"django >= 5.2, < 5.3"` in `install_requires` (`dependencies`) for `django-google-spanner`. ## Motivation `django_spanner` imports and requires `django` directly at top-level import time and explicitly checks for Django 5.2 compatibility in `django_spanner/__init__.py`. Without `django` listed in `setup.py`, installing `django-google-spanner` in a clean environment (such as during the `import-profiler` presubmit check) caused imports to fail with: ModuleNotFoundError: No module named 'django' Tracking issue for Django 6.0 support: #18053
1 parent 495839e commit c341469

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/django-google-spanner/setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818
# 'Development Status :: 4 - Beta'
1919
# 'Development Status :: 5 - Production/Stable'
2020
release_status = "Development Status :: 5 - Production/Stable"
21-
dependencies = ["sqlparse >= 0.3.0", "google-cloud-spanner >= 3.13.0"]
21+
# TODO(https://github.com/googleapis/google-cloud-python/issues/18053): Update upper bound when adding support for Django 6.0+
22+
# (django_spanner/__init__.py currently enforces SUPPORTED_DJANGO_VERSIONS = [(5, 2)])
23+
dependencies = [
24+
"sqlparse >= 0.3.0",
25+
"google-cloud-spanner >= 3.13.0",
26+
"django >= 5.2, < 6.0",
27+
]
2228
extras = {
2329
"tracing": [
2430
"opentelemetry-api >= 1.1.0",

0 commit comments

Comments
 (0)