Skip to content

chore(deps): update dependency django-environ to v0.12.0 #13401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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 appengine/flexible/django_cloudsql/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Django==5.2.1
gunicorn==23.0.0
psycopg2-binary==2.9.10
django-environ==0.11.2
django-environ==0.12.0
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The update to django-environ==0.12.0 is likely to cause this sample to fail. According to the django-environ v0.12.0 release notes, this version removes support for Python 3.7 and 3.8.

The app.yaml configuration for this sample (appengine/flexible/django_cloudsql/app.yaml) explicitly sets python_version: 3.7:

runtime_config:
  python_version: 3.7

This mismatch will likely lead to installation or runtime errors.

Could you clarify how this incompatibility should be handled? Possible solutions include:

  1. Updating this sample's Python runtime in app.yaml to Python 3.9 or newer.
  2. Pinning django-environ to a version compatible with Python 3.7 (e.g., django-environ<0.12.0).

Copy link
Contributor

Choose a reason for hiding this comment

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

high

A notable change in django-environ==0.12.0 is that inline comments in .env files are no longer handled by default. The release notes state: "Disabled inline comments handling by default due to potential side effects."

If any .env files or secrets loaded via env.read_env() (as seen in mysite/settings.py for these samples) rely on inline comments (e.g., MY_VAR=value # this is a comment), these comments might now be incorrectly parsed as part of the environment variable's value, or potentially cause other parsing issues.

Has this potential impact been assessed across the samples? Projects relying on this feature might need to:

  • Remove inline comments from their .env files/secret payloads.
  • Explicitly configure django-environ to re-enable inline comment parsing if the new default behavior is problematic.

google-cloud-secret-manager==2.21.1
django-storages[google]==1.14.5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Django==5.2.1
gunicorn==23.0.0
psycopg2-binary==2.9.10
django-environ==0.11.2
django-environ==0.12.0
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This update to django-environ==0.12.0 presents a critical compatibility issue for this sample. As noted in the v0.12.0 release notes, support for Python 3.7 and 3.8 has been removed.

The app.yaml for this sample (appengine/flexible_python37_and_earlier/django_cloudsql/app.yaml) specifies python_version: 3.7. Furthermore, the directory name flexible_python37_and_earlier strongly implies that this sample is intended for use with Python 3.7 or older versions.

Given this, django-environ==0.12.0 is incompatible. What is the recommended approach here?

  • Should this sample pin django-environ to a version <0.12.0 to maintain Python 3.7 compatibility?
  • Or is there a plan to update or archive this specific sample, as it targets an older Python runtime?

google-cloud-secret-manager==2.21.1
django-storages[google]==1.14.5
2 changes: 1 addition & 1 deletion run/django/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Django==5.2.1; python_version >= "3.10"
Django==4.2.21; python_version >= "3.8" and python_version < "3.10"
django-storages[google]==1.14.5
django-environ==0.11.2
django-environ==0.12.0
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The update to django-environ==0.12.0 may break compatibility for environments using Python 3.8 with this sample. The v0.12.0 release notes indicate that support for Python 3.8 (along with 3.6 and 3.7) has been dropped.

This requirements.txt file includes a conditional Django dependency that explicitly supports Python 3.8:

Django==4.2.21; python_version >= "3.8" and python_version < "3.10"

If this sample is deployed or run in a Python 3.8 environment, django-environ==0.12.0 would be installed but is not designed to work with Python 3.8, likely leading to failures.

How should this incompatibility be addressed? Some options could be:

  1. Pin django-environ to a version <0.12.0 if Python 3.8 support remains a requirement for this sample.
  2. Modify the Python version specifiers in this requirements.txt to require Python 3.9+ when using django-environ==0.12.0.
  3. Implement more granular dependency management if different django-environ versions are needed for different Python runtimes.

psycopg2-binary==2.9.10
gunicorn==23.0.0
google-cloud-secret-manager==2.21.1