From 951d7397b30013863dfb23818c8ea7849c1dddcd Mon Sep 17 00:00:00 2001 From: pangpang20 <676814828@qq.com> Date: Mon, 17 Nov 2025 19:20:21 +0800 Subject: [PATCH 1/5] chore(license): add explicit BSD-3-Clause attribution for Django-derived code and update project metadata - Append full Django BSD-3-Clause license text and attribution notice to LICENSE - Add license information section to README.md clarifying derivative work status - Add comprehensive copyright and license headers to all Python modules in gaussdb_django/ - Update pyproject.toml to declare BSD-3-Clause license and include LICENSE file in distribution --- LICENSE | 38 +++++++++++++++++++++++++++++++++ README.md | 6 ++++++ gaussdb_django/__init__.py | 15 +++++++++++++ gaussdb_django/base.py | 16 ++++++++++++-- gaussdb_django/client.py | 15 +++++++++++++ gaussdb_django/compiler.py | 15 +++++++++++++ gaussdb_django/creation.py | 15 +++++++++++++ gaussdb_django/features.py | 15 +++++++++++++ gaussdb_django/gaussdb_any.py | 15 +++++++++++++ gaussdb_django/introspection.py | 15 +++++++++++++ gaussdb_django/operations.py | 15 +++++++++++++ gaussdb_django/schema.py | 15 +++++++++++++ pyproject.toml | 2 ++ 13 files changed, 195 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index d81188a..68428fd 100755 --- a/LICENSE +++ b/LICENSE @@ -26,3 +26,41 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +============================================================================= + +ADDITIONAL ATTRIBUTION NOTICE: + +Parts of this software are based on the Django project, which is licensed +under the three-clause BSD license. The original Django project is +copyright (c) Django Software Foundation and individual contributors. + +Original Django License: + +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of Django nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md index ca14f5f..984a016 100755 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ This adds compatibility for [GaussDB](https://github.com/HuaweiCloudDeveloper/gaussdb-django) to Django. +## License Information + +This project is derived from the Django project and incorporates modifications for GaussDB compatibility. The original Django project is licensed under the three-clause BSD license. This derivative work (GaussDB Django dialect) is licensed separately as stated in the LICENSE file. + +Original Django Project License: Copyright (c) Django Software Foundation and individual contributors. All rights reserved. + ## Installation Guide ### Prerequisites diff --git a/gaussdb_django/__init__.py b/gaussdb_django/__init__.py index 20bb87a..bb4cb13 100755 --- a/gaussdb_django/__init__.py +++ b/gaussdb_django/__init__.py @@ -1,3 +1,18 @@ +""" +GaussDB Django dialect - initialization module. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. + +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + from .base import DatabaseWrapper __all__ = ["DatabaseWrapper"] diff --git a/gaussdb_django/base.py b/gaussdb_django/base.py index 78885cb..d326d96 100755 --- a/gaussdb_django/base.py +++ b/gaussdb_django/base.py @@ -1,8 +1,20 @@ """ -Gaussdb database backend for Django. +GaussDB database backend for Django. +Based on Django's PostgreSQL backend with modifications for GaussDB compatibility. -Requires gaussdb >= 1.0.3 +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. + +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. """ + import asyncio import threading import warnings diff --git a/gaussdb_django/client.py b/gaussdb_django/client.py index 76fc311..66ed806 100755 --- a/gaussdb_django/client.py +++ b/gaussdb_django/client.py @@ -1,3 +1,18 @@ +""" +GaussDB client module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. + +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + import signal from django.db.backends.base.client import BaseDatabaseClient diff --git a/gaussdb_django/compiler.py b/gaussdb_django/compiler.py index 9c4fa72..c8a44b5 100755 --- a/gaussdb_django/compiler.py +++ b/gaussdb_django/compiler.py @@ -1,3 +1,18 @@ +""" +GaussDB compiler module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. + +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + from django.db.models.sql.compiler import ( SQLAggregateCompiler, SQLCompiler, diff --git a/gaussdb_django/creation.py b/gaussdb_django/creation.py index 412e7ed..6a70fe9 100755 --- a/gaussdb_django/creation.py +++ b/gaussdb_django/creation.py @@ -1,3 +1,18 @@ +""" +GaussDB creation module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. + +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + import sys from django.core.exceptions import ImproperlyConfigured diff --git a/gaussdb_django/features.py b/gaussdb_django/features.py index 7741083..a702066 100755 --- a/gaussdb_django/features.py +++ b/gaussdb_django/features.py @@ -1,3 +1,18 @@ +""" +GaussDB features module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. + +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + from django.db import DataError, InterfaceError from django.db.backends.base.features import BaseDatabaseFeatures from django.utils.functional import cached_property diff --git a/gaussdb_django/gaussdb_any.py b/gaussdb_django/gaussdb_any.py index ecdeb17..b54b63c 100755 --- a/gaussdb_django/gaussdb_any.py +++ b/gaussdb_django/gaussdb_any.py @@ -1,3 +1,18 @@ +""" +GaussDB compatibility helpers module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. + +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + import ipaddress from functools import lru_cache diff --git a/gaussdb_django/introspection.py b/gaussdb_django/introspection.py index a0c02a0..07cbfba 100755 --- a/gaussdb_django/introspection.py +++ b/gaussdb_django/introspection.py @@ -1,3 +1,18 @@ +""" +GaussDB introspection module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. + +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + import re from collections import namedtuple diff --git a/gaussdb_django/operations.py b/gaussdb_django/operations.py index f92af80..c346467 100755 --- a/gaussdb_django/operations.py +++ b/gaussdb_django/operations.py @@ -1,3 +1,18 @@ +""" +GaussDB operations module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. + +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + import json from functools import lru_cache, partial from django.conf import settings diff --git a/gaussdb_django/schema.py b/gaussdb_django/schema.py index 197e1e5..2791af3 100755 --- a/gaussdb_django/schema.py +++ b/gaussdb_django/schema.py @@ -1,3 +1,18 @@ +""" +GaussDB schema module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. + +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.backends.ddl_references import IndexColumns from .gaussdb_any import sql diff --git a/pyproject.toml b/pyproject.toml index fd8da4a..783fd5f 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,7 @@ version = "4.2.0" description = "Django backend for GaussDB" readme = "README.md" requires-python = ">=3.10" +license = "BSD-3-Clause" classifiers = [ "Development Status :: 5 - Production/Stable", "Framework :: Django", @@ -29,3 +30,4 @@ vector = ["numpy~=1.0"] [tool.setuptools] packages = ["gaussdb_django"] +license-files = ["LICENSE"] From 8b93530efe148d59afd36e202447e4d06e0fa3e3 Mon Sep 17 00:00:00 2001 From: pangpang20 <676814828@qq.com> Date: Mon, 17 Nov 2025 19:28:22 +0800 Subject: [PATCH 2/5] chore(project): add PyPI status badges to README and modernize pyproject.toml metadata - Add PyPI version and Python versions badges to README.md header - Update pyproject.toml license declaration to PEP 621 format: license = { text = "BSD-3-Clause" } - Remove deprecated license-files from [tool.setuptools] section (now handled at top level) - Remove redundant "License :: OSI Approved :: BSD License" classifier --- README.md | 3 +++ pyproject.toml | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 984a016..74c8675 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # GaussDB dialect for Django +![PyPI](https://img.shields.io/pypi/v/gaussdb-django) +![PyPI - Python Version](https://img.shields.io/pypi/pyversions/gaussdb-django) + This adds compatibility for [GaussDB](https://github.com/HuaweiCloudDeveloper/gaussdb-django) to Django. diff --git a/pyproject.toml b/pyproject.toml index 783fd5f..8004906 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,12 +8,12 @@ version = "4.2.0" description = "Django backend for GaussDB" readme = "README.md" requires-python = ">=3.10" -license = "BSD-3-Clause" +license = { text = "BSD-3-Clause" } +license-files = ["LICENSE"] classifiers = [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Framework :: Django :: 4.2", - "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", @@ -30,4 +30,3 @@ vector = ["numpy~=1.0"] [tool.setuptools] packages = ["gaussdb_django"] -license-files = ["LICENSE"] From 3b86ab36a74f92ee392b0007a8a71064eb392f69 Mon Sep 17 00:00:00 2001 From: pangpang20 <676814828@qq.com> Date: Mon, 17 Nov 2025 19:36:08 +0800 Subject: [PATCH 3/5] fix(pyproject): revert license field to string format for broader tooling compatibility --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8004906..773b5d4 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ version = "4.2.0" description = "Django backend for GaussDB" readme = "README.md" requires-python = ">=3.10" -license = { text = "BSD-3-Clause" } +license = "BSD-3-Clause" license-files = ["LICENSE"] classifiers = [ "Development Status :: 5 - Production/Stable", From d794df4a4e0eccc4146f52f38622001ed684fb4a Mon Sep 17 00:00:00 2001 From: pangpang20 <676814828@qq.com> Date: Mon, 17 Nov 2025 20:40:52 +0800 Subject: [PATCH 4/5] Update README: fix GaussDB official link and simplify license section title --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 74c8675..7ad451c 100755 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/gaussdb-django) -This adds compatibility for [GaussDB](https://github.com/HuaweiCloudDeveloper/gaussdb-django) to Django. +This adds compatibility for [GaussDB](https://www.huaweicloud.com/product/gaussdb.html) to Django. -## License Information +## License This project is derived from the Django project and incorporates modifications for GaussDB compatibility. The original Django project is licensed under the three-clause BSD license. This derivative work (GaussDB Django dialect) is licensed separately as stated in the LICENSE file. From 2741011caf69a8085f3ad757ba36fc18fa21e368 Mon Sep 17 00:00:00 2001 From: pangpang20 <676814828@qq.com> Date: Mon, 17 Nov 2025 20:48:08 +0800 Subject: [PATCH 5/5] Bump version to 4.2.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 773b5d4..a89ac3f 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "gaussdb-django" -version = "4.2.0" +version = "4.2.1" description = "Django backend for GaussDB" readme = "README.md" requires-python = ">=3.10"