Skip to content

Commit 01b7d6f

Browse files
committed
feat: complete migration to async_gaussdb with GaussDB compatibility
- Renamed package from asyncpg to async_gaussdb - Updated all PostgreSQL/Postgre variable names to GaussDB - Changed connection protocol from postgresql:// to gaussdb:// - Applied Flake8 code formatting standards - All tests pass successfully
1 parent 0547c2f commit 01b7d6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1022
-1021
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ select = C90,E,F,W,Y0
33
ignore = E402,E731,W503,W504,E252
44
exclude = .git,__pycache__,build,dist,.eggs,.github,.local,.venv*,.tox
55
per-file-ignores = *.pyi: F401,F403,F405,F811,E127,E128,E203,E266,E301,E302,E305,E501,E701,E704,E741,B303,W503,W504
6+
max-line-length = 89

.github/ISSUE_TEMPLATE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ the problem is provided, with clear instructions on how to run it.
1010
Thank you!
1111
-->
1212

13-
* **asyncpg version**:
13+
* **async_gaussdb version**:
1414
* **PostgreSQL version**:
1515
* **Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
1616
the issue with a local PostgreSQL install?**:
1717
* **Python version**:
1818
* **Platform**:
1919
* **Do you use pgbouncer?**:
20-
* **Did you install asyncpg with pip?**:
21-
* **If you built asyncpg locally, which version of Cython did you use?**:
20+
* **Did you install async_gaussdb with pip?**:
21+
* **If you built async_gaussdb locally, which version of Cython did you use?**:
2222
* **Can the issue be reproduced under both asyncio and
2323
[uvloop](https://github.com/magicstack/uvloop)?**:
2424

.github/RELEASING.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
Releasing asyncpg
1+
Releasing async_gaussdb
22
=================
33

4-
When making an asyncpg release follow the below checklist.
4+
When making an async_gaussdb release follow the below checklist.
55

6-
1. Remove the ``.dev0`` suffix from ``__version__`` in ``asyncpg/__init__.py``.
6+
1. Remove the ``.dev0`` suffix from ``__version__`` in ``async_gaussdb/__init__.py``.
77

88
2. Make a release commit:
99

1010
.. code-block:: shell
1111
12-
$ git commit -a -m "asyncpg vX.Y.0"
12+
$ git commit -a -m "async_gaussdb vX.Y.0"
1313
14-
Here, X.Y.0 is the ``__version__`` in ``asyncpg/__init__.py``.
14+
Here, X.Y.0 is the ``__version__`` in ``async_gaussdb/__init__.py``.
1515

1616
3. Force push into the "releases" branch on Github:
1717

@@ -51,5 +51,5 @@ When making an asyncpg release follow the below checklist.
5151
rather than Markdown.)
5252

5353
10. Open master for development by bumping the minor component of
54-
``__version__`` in ``asyncpg/__init__.py`` and appending the ``.dev0``
54+
``__version__`` in ``async_gaussdb/__init__.py`` and appending the ``.dev0``
5555
suffix.

.github/release_log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import sys
1414

1515

16-
BASE_URL = 'https://api.github.com/repos/magicstack/asyncpg/compare'
16+
BASE_URL = 'https://api.github.com/repos/magicstack/async_gaussdb/compare'
1717

1818

1919
def main():

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- "ci"
88
- "[0-9]+.[0-9x]+*"
99
paths:
10-
- "asyncpg/_version.py"
10+
- "async_gaussdb/_version.py"
1111

1212
jobs:
1313
validate-release-request:
@@ -20,7 +20,7 @@ jobs:
2020
require_team: Release Managers
2121
require_approval: no
2222
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
23-
version_file: asyncpg/_version.py
23+
version_file: async_gaussdb/_version.py
2424
version_line_pattern: |
2525
__version__(?:\s*:\s*typing\.Final)?\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
2626
@@ -192,7 +192,7 @@ jobs:
192192

193193
environment:
194194
name: pypi
195-
url: https://pypi.org/p/asyncpg
195+
url: https://pypi.org/p/async_gaussdb
196196
permissions:
197197
id-token: write
198198
attestations: write

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
with:
4747
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
4848
missing_version_ok: yes
49-
version_file: asyncpg/_version.py
49+
version_file: async_gaussdb/_version.py
5050
version_line_pattern: |
5151
__version__(?:\s*:\s*typing\.Final)?\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
5252
@@ -101,7 +101,7 @@ jobs:
101101
with:
102102
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
103103
missing_version_ok: yes
104-
version_file: asyncpg/_version.py
104+
version_file: async_gaussdb/_version.py
105105
version_line_pattern: |
106106
__version__(?:\s*:\s*typing\.Final)?\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
107107

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "asyncpg/pgproto"]
2-
path = asyncpg/pgproto
1+
[submodule "async_gaussdb/pgproto"]
2+
path = async_gaussdb/pgproto
33
url = https://github.com/MagicStack/py-pgproto.git

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
recursive-include docs *.py *.rst Makefile *.css
22
recursive-include examples *.py
33
recursive-include tests *.py *.pem
4-
recursive-include asyncpg *.pyx *.pxd *.pxi *.py *.pyi *.c *.h
4+
recursive-include async_gaussdb *.pyx *.pxd *.pxi *.py *.pyi *.c *.h
55
include LICENSE README.rst Makefile performance.png .flake8

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ all: compile
1010

1111
clean:
1212
rm -fr dist/ doc/_build/
13-
rm -fr asyncpg/pgproto/*.c asyncpg/pgproto/*.html
14-
rm -fr asyncpg/pgproto/codecs/*.html
15-
rm -fr asyncpg/pgproto/*.so
16-
rm -fr asyncpg/protocol/*.c asyncpg/protocol/*.html
17-
rm -fr asyncpg/protocol/*.so build *.egg-info
18-
rm -fr asyncpg/protocol/codecs/*.html
13+
rm -fr async_gaussdb/pgproto/*.c async_gaussdb/pgproto/*.html
14+
rm -fr async_gaussdb/pgproto/codecs/*.html
15+
rm -fr async_gaussdb/pgproto/*.so
16+
rm -fr async_gaussdb/protocol/*.c async_gaussdb/protocol/*.html
17+
rm -fr async_gaussdb/protocol/*.so build *.egg-info
18+
rm -fr async_gaussdb/protocol/codecs/*.html
1919
find . -name '__pycache__' | xargs rm -rf
2020

2121

2222
compile:
23-
env ASYNCPG_BUILD_CYTHON_ALWAYS=1 $(PYTHON) -m pip install -e .
23+
env ASYNCGAUSSDB_BUILD_CYTHON_ALWAYS=1 $(PYTHON) -m pip install -e .
2424

2525

2626
debug:
27-
env ASYNCPG_DEBUG=1 $(PYTHON) -m pip install -e .
27+
env ASYNCGAUSSDB_DEBUG=1 $(PYTHON) -m pip install -e .
2828

2929
test:
3030
PYTHONASYNCIODEBUG=1 $(PYTHON) -m unittest -v tests.suite

README.rst

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
asyncpg-gaussdb -- A fast GaussDB/openGauss Database Client Library for Python/asyncio
1+
async_gaussdb-gaussdb -- A fast GaussDB/openGauss Database Client Library for Python/asyncio
22
=====================================================================================
33

4-
.. image:: https://github.com/MagicStack/asyncpg/workflows/Tests/badge.svg
5-
:target: https://github.com/MagicStack/asyncpg/actions?query=workflow%3ATests+branch%3Amaster
4+
.. image:: https://github.com/MagicStack/async_gaussdb/workflows/Tests/badge.svg
5+
:target: https://github.com/MagicStack/async_gaussdb/actions?query=workflow%3ATests+branch%3Amaster
66
:alt: GitHub Actions status
7-
.. image:: https://img.shields.io/pypi/v/asyncpg.svg
8-
:target: https://pypi.python.org/pypi/asyncpg
7+
.. image:: https://img.shields.io/pypi/v/async_gaussdb.svg
8+
:target: https://pypi.python.org/pypi/async_gaussdb
99

10-
**asyncpg-gaussdb** is a database interface library designed specifically for
11-
GaussDB and openGauss databases with Python/asyncio. This fork of asyncpg is
10+
**async_gaussdb-gaussdb** is a database interface library designed specifically for
11+
GaussDB and openGauss databases with Python/asyncio. This fork of async_gaussdb is
1212
optimized for GaussDB/openGauss compatibility, including native SHA256
1313
authentication support and enhanced features for enterprise database environments.
1414

15-
asyncpg-gaussdb requires Python 3.8 or later and is specifically designed for
15+
async_gaussdb-gaussdb requires Python 3.8 or later and is specifically designed for
1616
GaussDB and openGauss databases. It includes compatibility fixes and
1717
optimizations for openGauss-specific features and enterprise database requirements.
1818

@@ -28,16 +28,16 @@ Documentation
2828
-------------
2929

3030
The project documentation can be found
31-
`here <https://magicstack.github.io/asyncpg/current/>`_.
31+
`here <https://magicstack.github.io/async_gaussdb/current/>`_.
3232

3333

3434
Performance
3535
-----------
3636

37-
asyncpg-gaussdb maintains the high performance characteristics of the original
38-
asyncpg library while being optimized for GaussDB/openGauss environments.
37+
async_gaussdb-gaussdb maintains the high performance characteristics of the original
38+
async_gaussdb library while being optimized for GaussDB/openGauss environments.
3939

40-
.. image:: https://raw.githubusercontent.com/MagicStack/asyncpg/master/performance.png?fddca40ab0
40+
.. image:: https://raw.githubusercontent.com/MagicStack/async_gaussdb/master/performance.png?fddca40ab0
4141
:target: https://gistpreview.github.io/?0ed296e93523831ea0918d42dd1258c2
4242

4343
The above results are a geometric mean of benchmarks obtained with PostgreSQL
@@ -48,7 +48,7 @@ in June 2023 (click on the chart to see full details).
4848
Features
4949
--------
5050

51-
asyncpg-gaussdb implements the GaussDB/openGauss server protocol natively and
51+
async_gaussdb-gaussdb implements the GaussDB/openGauss server protocol natively and
5252
exposes its features directly, optimized for enterprise database environments:
5353

5454
* **SHA256 authentication** - Native support for GaussDB/openGauss authentication
@@ -65,7 +65,7 @@ exposes its features directly, optimized for enterprise database environments:
6565
Installation
6666
------------
6767

68-
asyncpg-gaussdb is available on PyPI. When not using GSSAPI/SSPI authentication it
68+
async_gaussdb-gaussdb is available on PyPI. When not using GSSAPI/SSPI authentication it
6969
has no dependencies. Use pip to install::
7070

7171
$ pip install async-gaussdb
@@ -75,7 +75,7 @@ If you need GSSAPI/SSPI authentication, use::
7575
$ pip install 'async-gaussdb[gssauth]'
7676

7777
For more details, please `see the documentation
78-
<https://magicstack.github.io/asyncpg/current/installation.html>`_.
78+
<https://magicstack.github.io/async_gaussdb/current/installation.html>`_.
7979

8080

8181
Basic Usage
@@ -84,11 +84,11 @@ Basic Usage
8484
.. code-block:: python
8585
8686
import asyncio
87-
import asyncpg
87+
import async_gaussdb
8888
8989
async def run():
9090
# Connect to GaussDB/openGauss
91-
conn = await asyncpg.connect(
91+
conn = await async_gaussdb.connect(
9292
user='omm',
9393
password='your_password',
9494
database='postgres',
@@ -114,11 +114,11 @@ This library includes enhanced support for GaussDB and openGauss databases:
114114
.. code-block:: python
115115
116116
import asyncio
117-
import asyncpg
117+
import async_gaussdb
118118
119119
async def run():
120120
# Connect with SHA256 authentication (GaussDB/openGauss specific)
121-
conn = await asyncpg.connect(
121+
conn = await async_gaussdb.connect(
122122
user='omm',
123123
password='your_password',
124124
database='postgres',
@@ -145,13 +145,13 @@ A Dockerfile is provided for development with openGauss:
145145
.. code-block:: bash
146146
147147
# Build the development image
148-
docker build -t asyncpg-gaussdb-dev .
148+
docker build -t async_gaussdb-gaussdb-dev .
149149
150150
# Run the container
151-
docker run -it asyncpg-gaussdb-dev
151+
docker run -it async_gaussdb-gaussdb-dev
152152
153153
154154
License
155155
-------
156156

157-
asyncpg-gaussdb is developed and distributed under the Apache 2.0 license.
157+
async_gaussdb-gaussdb is developed and distributed under the Apache 2.0 license.

0 commit comments

Comments
 (0)