Skip to content

Commit 9bb1bb3

Browse files
committed
update for Django 5.0
1 parent 16bd3b1 commit 9bb1bb3

File tree

10 files changed

+20
-18
lines changed

10 files changed

+20
-18
lines changed

.github/workflows/linters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python
1818
uses: actions/setup-python@v4
1919
with:
20-
python-version: '3.8'
20+
python-version: '3.10'
2121
- run: python -m pip install flake8
2222
- name: flake8
2323
uses: liskin/gh-problem-matcher-wrap@v2
@@ -33,7 +33,7 @@ jobs:
3333
- name: Set up Python
3434
uses: actions/setup-python@v4
3535
with:
36-
python-version: '3.8'
36+
python-version: '3.10'
3737
- run: python -m pip install isort
3838
- name: isort
3939
uses: liskin/gh-problem-matcher-wrap@v2

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
- uses: actions/checkout@v4
5050
- uses: actions/setup-python@v4
5151
with:
52-
python-version: '3.8'
52+
python-version: '3.10'
5353
- name: Install system packages for Django's Python test dependencies
5454
run: |
5555
sudo apt-get update

CHANGELOG.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Changelog
22

3-
## 4.2.1 - TBD
3+
## 5.0 - TBD
44

5-
- Confirmed support for CockroachDB 23.1.x (no changes were required).
6-
7-
## 4.2 - 2023-04-06
8-
9-
Initial release for Django 4.2.x and CockroachDB 22.1.x and 22.2.x.
5+
Initial release for Django 5.0.x and CockroachDB 22.2.x and 23.1.x.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ production it is advised to use the package built from sources.
2121
## Install and usage
2222

2323
Use the version of django-cockroachdb that corresponds to your version of
24-
Django. For example, to get the latest compatible release for Django 4.2.x:
24+
Django. For example, to get the latest compatible release for Django 5.0.x:
2525

26-
`pip install django-cockroachdb==4.2.*`
26+
`pip install django-cockroachdb==5.0.*`
2727

2828
The minor release number of Django doesn't correspond to the minor release
2929
number of django-cockroachdb. Use the latest minor release of each.

django-test-suite/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ VERSION=$1
77

88
# clone django into the repo.
99
rm -rf _django_repo
10-
git clone --depth 1 --single-branch --branch cockroach-4.2.x https://github.com/timgraham/django _django_repo
10+
git clone --depth 1 --single-branch --branch cockroach-5.0.x https://github.com/timgraham/django _django_repo
1111

1212
# install the django requirements.
1313
cd _django_repo/tests/

django_cockroachdb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '4.2'
1+
__version__ = '5.0a0'
22

33
# Check Django compatibility before other imports which may fail if the
44
# wrong version of Django is installed.

django_cockroachdb/features.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ def introspected_field_types(self):
7171
# https://github.com/cockroachdb/cockroach/issues/54817
7272
'non_default': 'sv',
7373
'swedish_ci': 'sv-x-icu',
74+
# Not supported: https://github.com/cockroachdb/cockroach/issues/111091
75+
'virtual': None,
7476
}
7577

7678
@cached_property
@@ -148,6 +150,8 @@ def django_test_expected_failures(self):
148150
'bulk_create.tests.BulkCreateTests.test_bulk_insert_nullable_fields',
149151
'many_to_one.tests.ManyToOneTests.test_add_remove_set_by_pk_raises',
150152
'many_to_one.tests.ManyToOneTests.test_fk_to_smallautofield',
153+
'many_to_one.tests.ManyToOneTests.test_get_prefetch_queryset_reverse_warning',
154+
'many_to_one.tests.ManyToOneTests.test_get_prefetch_querysets_reverse_invalid_querysets_length',
151155
'migrations.test_operations.OperationTests.test_smallfield_autofield_foreignfield_growth',
152156
'migrations.test_operations.OperationTests.test_smallfield_bigautofield_foreignfield_growth',
153157
# unsupported comparison operator: <jsonb> > <string>:
@@ -182,6 +186,8 @@ def django_test_expected_failures(self):
182186
# of type decimal, found type float
183187
# https://github.com/cockroachdb/cockroach/issues/73587#issuecomment-988408190
184188
'aggregation.tests.AggregateTestCase.test_aggregation_default_using_decimal_from_database',
189+
# ProgrammingError: VALUES types int and float cannot be matched
190+
'field_defaults.tests.DefaultTests.test_bulk_create_mixed_db_defaults_function',
185191
})
186192
if self.uses_server_side_binding:
187193
expected_failures.update({
@@ -223,6 +229,7 @@ def django_test_expected_failures(self):
223229
'queries.test_bulk_update.BulkUpdateTests.test_large_batch',
224230
'queries.test_bulk_update.BulkUpdateTests.test_updated_rows_when_passing_duplicates',
225231
'queries.test_q.QCheckTests.test_expression',
232+
'queries.test_qs_combinators.QuerySetSetOperationTests.test_union_multiple_models_with_values_list_and_annotations', # noqa
226233
# unsupported binary operator: <interval> / <decimal>
227234
'expressions.tests.FTimeDeltaTests.test_durationfield_multiply_divide',
228235
# InvalidParameterValue: unsupported binary operator: <int4> / <float>

django_cockroachdb/operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import time
2+
from zoneinfo import ZoneInfo
23

3-
from django.db.backends.base.base import timezone_constructor
44
from django.db.backends.postgresql.operations import (
55
DatabaseOperations as PostgresDatabaseOperations,
66
)
@@ -47,7 +47,7 @@ def adapt_datetimefield_value(self, value):
4747
"""
4848
# getattr() guards against F() objects which don't have tzinfo.
4949
if value and getattr(value, 'tzinfo', '') is None and self.connection.timezone_name is not None:
50-
connection_timezone = timezone_constructor(self.connection.timezone_name)
50+
connection_timezone = ZoneInfo(self.connection.timezone_name)
5151
value = value.replace(tzinfo=connection_timezone)
5252
return value
5353

django_cockroachdb_gis/features.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def django_test_expected_failures(self):
5454
# unknown function: st_3dextent()
5555
# https://github.com/cockroachdb/cockroach/issues/60864
5656
'gis_tests.geo3d.tests.Geo3DTest.test_extent',
57+
'gis_tests.geo3d.tests.Geo3DTest.test_extent3d_filter',
5758
# unknown signature: st_scale(geometry, decimal, decimal, decimal)
5859
# https://github.com/cockroachdb/cockroach/issues/49027
5960
'gis_tests.geo3d.tests.Geo3DFunctionsTests.test_scale',

setup.cfg

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ long_description_content_type = text/markdown
1111
classifiers =
1212
Development Status :: 5 - Production/Stable
1313
Framework :: Django
14-
Framework :: Django :: 4.2
14+
Framework :: Django :: 5.0
1515
License :: OSI Approved :: Apache Software License
1616
Operating System :: OS Independent
1717
Programming Language :: Python
1818
Programming Language :: Python :: 3
19-
Programming Language :: Python :: 3.8
20-
Programming Language :: Python :: 3.9
2119
Programming Language :: Python :: 3.10
2220
Programming Language :: Python :: 3.11
2321
Programming Language :: Python :: 3.12

0 commit comments

Comments
 (0)