Skip to content

Commit 9d80490

Browse files
authored
Merge pull request HuaweiCloudDeveloper#12 from pangpang20/master
Rebrand psycopg to gaussdb
2 parents 92aaa40 + 02b4fff commit 9d80490

File tree

330 files changed

+2575
-10178
lines changed

Some content is hidden

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

330 files changed

+2575
-10178
lines changed

.flake8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ ignore = W503, E203, E704
99
extend-exclude = .venv build
1010
per-file-ignores =
1111
# Autogenerated section
12-
psycopg/psycopg/errors.py: E125, E128, E302
12+
gaussdb/gaussdb/errors.py: E125, E128, E302
1313

1414
# Allow concatenated string literals from async_to_sync
15-
psycopg_pool/psycopg_pool/pool.py: E501
15+
gaussdb_pool/gaussdb_pool/pool.py: E501
1616

1717
# Pytest's importorskip() getting in the way
1818
tests/types/test_numpy.py: E402

.github/workflows/3rd-party-tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242
pip_sqlalchemy: sqlalchemy>=2
4343

4444
env:
45-
PSYCOPG_IMPL: ${{ matrix.impl }}
46-
DEPS: ./psycopg pytest pytest-xdist greenlet
45+
GAUSSDB_IMPL: ${{ matrix.impl }}
46+
DEPS: ./gaussdb pytest pytest-xdist greenlet
4747

4848
services:
4949
postgresql:
@@ -78,10 +78,10 @@ jobs:
7878
CREATE EXTENSION hstore;
7979
HERE
8080
81-
- name: Include psycopg-c to the packages to install
81+
- name: Include gaussdb-c to the packages to install
8282
if: ${{ matrix.impl == 'c' }}
8383
run: |
84-
echo "DEPS=$DEPS ./psycopg_c" >> $GITHUB_ENV
84+
echo "DEPS=$DEPS ./gaussdb_c" >> $GITHUB_ENV
8585
8686
- name: Install pycopg packages
8787
run: pip install $DEPS
@@ -108,7 +108,7 @@ jobs:
108108
109109
- name: Run sqlalchemy tests
110110
env:
111-
URL: postgresql+psycopg://postgres:password@127.0.0.1/test
111+
URL: postgresql+gaussdb://postgres:password@127.0.0.1/test
112112
working-directory: sa_home/sa
113113
run: pytest -n 2 -q --dburi $URL --backend-only --dropfirst --color=yes --dbdriver psycopg_async
114114

@@ -150,7 +150,7 @@ jobs:
150150
python-version: "3.12"
151151

152152
env:
153-
DEPS: ./psycopg ./psycopg_pool
153+
DEPS: ./gaussdb ./gaussdb_pool
154154

155155
services:
156156
postgresql:
@@ -182,10 +182,10 @@ jobs:
182182
SELECT version();
183183
HERE
184184
185-
- name: Include psycopg-c to the packages to install
185+
- name: Include gaussdb-c to the packages to install
186186
if: ${{ matrix.impl == 'c' }}
187187
run: |
188-
echo "DEPS=$DEPS ./psycopg_c" >> $GITHUB_ENV
188+
echo "DEPS=$DEPS ./gaussdb_c" >> $GITHUB_ENV
189189
190190
- name: Install pycopg packages
191191
run: pip install $DEPS

.github/workflows/ci.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
- 5432:5432
2323
env:
2424
GS_USERNAME: root
25-
GS_USER_PASSWORD: ${{ secrets.OPENGAUSS_PASSWORD }}
26-
GS_PASSWORD: ${{ secrets.OPENGAUSS_PASSWORD }}
25+
GS_USER_PASSWORD: Passwd@123
26+
GS_PASSWORD: Passwd@123
2727
options: >-
2828
--privileged=true
2929
--name opengauss-custom
@@ -51,7 +51,7 @@ jobs:
5151
wget -O /tmp/GaussDB_driver.zip https://dbs-download.obs.cn-north-1.myhuaweicloud.com/GaussDB/1730887196055/GaussDB_driver.zip
5252
unzip /tmp/GaussDB_driver.zip -d /tmp/ && rm -rf /tmp/GaussDB_driver.zip
5353
\cp /tmp/GaussDB_driver/Centralized/Hce2_X86_64/GaussDB-Kernel*64bit_Python.tar.gz /tmp/
54-
tar -zxvf /tmp/GaussDB-Kernel*64bit_Python.tar.gz -C /tmp/ && rm -rf /tmp/GaussDB-Kernel*64bit_Python.tar.gz && rm -rf /tmp/psycopg2 && rm -rf /tmp/GaussDB_driver
54+
tar -zxvf /tmp/GaussDB-Kernel*64bit_Python.tar.gz -C /tmp/ && rm -rf /tmp/GaussDB-Kernel*64bit_Python.tar.gz && rm -rf /tmp/_GaussDB && rm -rf /tmp/GaussDB_driver
5555
echo /tmp/lib | sudo tee /etc/ld.so.conf.d/gauss-libpq.conf
5656
sudo sed -i '1s|^|/tmp/lib\n|' /etc/ld.so.conf
5757
sudo ldconfig
@@ -62,18 +62,19 @@ jobs:
6262
source venv/bin/activate
6363
python -m pip install --upgrade pip
6464
pip install -r requirements.txt
65-
pip install -e "./psycopg[dev,test]"
66-
pip install -e ./psycopg_pool
65+
pip install ./tools/isort-gaussdb/
66+
pip install "./gaussdb[dev,test]"
67+
pip install ./gaussdb_pool
6768
6869
6970
- name: Wait for openGauss to be ready
7071
env:
71-
GSQL_PASSWORD: ${{ secrets.OPENGAUSS_PASSWORD }}
72+
GSQL_PASSWORD: Passwd@123
7273
run: |
7374
source venv/bin/activate
74-
for i in {1..15}; do
75+
for i in {1..30}; do
7576
pg_isready -h localhost -p 5432 -U root && break
76-
sleep 5
77+
sleep 10
7778
done
7879
if ! pg_isready -h localhost -p 5432 -U root; then
7980
echo "openGauss is not ready"
@@ -90,9 +91,9 @@ jobs:
9091
9192
- name: Run tests
9293
env:
93-
PYTHONPATH: ./psycopg:./psycopg_pool
94-
PSYCOPG_IMPL: python
95-
PSYCOPG_TEST_DSN: "host=127.0.0.1 port=5432 dbname=test user=root password=${{ secrets.OPENGAUSS_PASSWORD }} "
94+
PYTHONPATH: ./gaussdb:./gaussdb_pool
95+
GAUSSDB_IMPL: python
96+
GAUSSDB_TEST_DSN: "host=127.0.0.1 port=5432 dbname=test user=root password=Passwd@123 "
9697
run: |
9798
source venv/bin/activate
9899
pytest -s -v

.github/workflows/docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ name: Build documentation
33
on:
44
# push:
55
# branches:
6-
# # This should match the DOC3_BRANCH value in the psycopg-website Makefile
6+
# # This should match the DOC3_BRANCH value in the gaussdb-website Makefile
77
# - master
8-
pull_request:
8+
# pull_request:
9+
workflow_dispatch:
10+
911

1012
concurrency:
1113
group: ${{ github.workflow }}-${{ github.ref_name }}

.github/workflows/lint.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
branches:
88
- "*"
99
pull_request:
10+
workflow_dispatch:
1011

1112
concurrency:
1213
group: ${{ github.workflow }}-${{ github.ref_name }}
@@ -27,7 +28,9 @@ jobs:
2728

2829
- name: install packages to tests
2930
run: |
30-
pip install ./psycopg[dev,test]
31+
pip install ./tools/isort-gaussdb/
32+
pip install ./gaussdb[dev,test]
33+
pip install ./gaussdb_pool
3134
pip install types-polib
3235
pip install pre-commit
3336
@@ -41,17 +44,24 @@ jobs:
4144

4245
- name: Install packages for async_to_sync
4346
run: |
44-
pip install ./psycopg[dev,test]
45-
pip install types-polib
47+
pip install ./tools/isort-gaussdb/
48+
pip install ./gaussdb[dev,test]
49+
pip install types-polib
50+
pip install ./gaussdb_pool
4651
4752
- name: Check for sync/async inconsistencies
48-
run: ./tools/async_to_sync.py --check $(find tests -name "*_async.py" -type f ! -path "tests/pq/test_async.py")
53+
run: ./tools/async_to_sync.py --check $(find tests -name "*_async.py" -type f ! -path "tests/pq/test_async.py" ! -path "tests/test_concurrency_async.py")
4954

5055
- name: Install requirements to generate docs
5156
run: sudo apt-get install -y libgeos-dev
5257

5358
- name: Install Python packages to generate docs
54-
run: pip install ./psycopg[docs] ./psycopg_pool
59+
run: |
60+
pip install furo
61+
pip install ./tools/isort-gaussdb/
62+
pip install ./gaussdb[dev,test]
63+
pip install ./gaussdb_pool
64+
pip install types-polib
5565
5666
- name: Check documentation
5767
run: sphinx-build -W -T -b html docs docs/_build/html

.github/workflows/packages-bin.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ name: Build binary packages
33
# Note: Libpq is currently built from source on most platforms and the build
44
# artifacts are cached across pipeline runs.
55
#
6-
# You can see the caches at https://github.com/psycopg/psycopg/actions/caches
6+
# You can see the caches at https://github.com/gaussdb/gaussdb/actions/caches
77
#
88
# You can delete a cache using:
99
#
1010
# curl -L -X DELETE
1111
# -H "Accept: application/vnd.github+json"
1212
# -H "Authorization: Bearer $GITHUB_TOKEN"
1313
# -H "X-GitHub-Api-Version: 2022-11-28"
14-
# "https://api.github.com/repos/psycopg/psycopg/actions/caches?key=libpq-manylinux-ppc64le-17.2-3.4.0"
14+
# "https://api.github.com/repos/gaussdb/gaussdb/actions/caches?key=libpq-manylinux-ppc64le-17.2-3.4.0"
1515
#
1616
# ref: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-github-actions-caches-for-a-repository-using-a-cache-key
1717

1818
on:
1919
workflow_dispatch:
20-
pull_request:
21-
paths:
22-
- '.github/workflows/packages-bin.yml'
23-
schedule:
24-
- cron: '28 7 * * sun'
20+
# pull_request:
21+
# paths:
22+
# - '.github/workflows/packages-bin.yml'
23+
# schedule:
24+
# - cron: '28 7 * * sun'
2525

2626
env:
2727
# Latest release: https://www.postgresql.org/ftp/source/
@@ -70,7 +70,7 @@ jobs:
7070
- name: Build wheels
7171
uses: pypa/cibuildwheel@v2.23.2
7272
with:
73-
package-dir: psycopg_binary
73+
package-dir: gaussdb_binary
7474
env:
7575
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
7676
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
@@ -82,19 +82,19 @@ jobs:
8282
CIBW_REPAIR_WHEEL_COMMAND: >-
8383
./tools/ci/strip_wheel.sh {wheel}
8484
&& auditwheel repair -w {dest_dir} {wheel}
85-
CIBW_TEST_REQUIRES: ./psycopg[test] ./psycopg_pool
85+
CIBW_TEST_REQUIRES: ./gaussdb[test] ./gaussdb_pool
8686
CIBW_TEST_COMMAND: >-
8787
pytest {project}/tests -m 'not slow and not flakey' --color yes
8888
CIBW_ENVIRONMENT_PASS_LINUX: LIBPQ_VERSION OPENSSL_VERSION
8989
CIBW_ENVIRONMENT: >-
90-
PSYCOPG_IMPL=binary
91-
PSYCOPG_TEST_DSN='host=172.17.0.1 user=postgres'
90+
GAUSSDB_IMPL=binary
91+
GAUSSDB_TEST_DSN='host=172.17.0.1 user=postgres'
9292
PGPASSWORD=password
9393
LIBPQ_BUILD_PREFIX=/host/tmp/libpq.build
9494
PATH="$LIBPQ_BUILD_PREFIX/bin:$PATH"
9595
LD_LIBRARY_PATH="$LIBPQ_BUILD_PREFIX/lib:$LIBPQ_BUILD_PREFIX/lib64"
96-
PSYCOPG_TEST_WANT_LIBPQ_BUILD=${{ env.LIBPQ_VERSION }}
97-
PSYCOPG_TEST_WANT_LIBPQ_IMPORT=${{ env.LIBPQ_VERSION }}
96+
GAUSSDB_TEST_WANT_LIBPQ_BUILD=${{ env.LIBPQ_VERSION }}
97+
GAUSSDB_TEST_WANT_LIBPQ_IMPORT=${{ env.LIBPQ_VERSION }}
9898
9999
- uses: actions/upload-artifact@v4
100100
with:
@@ -144,23 +144,23 @@ jobs:
144144
- name: Build wheels
145145
uses: pypa/cibuildwheel@v2.23.2
146146
with:
147-
package-dir: psycopg_binary
147+
package-dir: gaussdb_binary
148148
env:
149149
CIBW_BUILD: ${{matrix.pyver}}-macosx_${{matrix.arch}}
150150
CIBW_ARCHS_MACOS: ${{matrix.arch}}
151151
MACOSX_ARCHITECTURE: ${{matrix.arch}}
152152
CIBW_BEFORE_ALL_MACOS: ./tools/ci/wheel_macos_before_all.sh
153-
CIBW_TEST_REQUIRES: ./psycopg[test] ./psycopg_pool
153+
CIBW_TEST_REQUIRES: ./gaussdb[test] ./gaussdb_pool
154154
CIBW_TEST_COMMAND: >-
155155
pytest {project}/tests -m 'not slow and not flakey' --color yes
156156
CIBW_ENVIRONMENT: >-
157157
PG_VERSION=17
158-
PSYCOPG_IMPL=binary
159-
PSYCOPG_TEST_DSN='dbname=postgres'
158+
GAUSSDB_IMPL=binary
159+
GAUSSDB_TEST_DSN='dbname=postgres'
160160
LIBPQ_BUILD_PREFIX=/tmp/libpq.build
161161
PATH="$LIBPQ_BUILD_PREFIX/bin:$PATH"
162-
PSYCOPG_TEST_WANT_LIBPQ_BUILD=">= ${{env.LIBPQ_VERSION}}"
163-
PSYCOPG_TEST_WANT_LIBPQ_IMPORT=">= ${{env.LIBPQ_VERSION}}"
162+
GAUSSDB_TEST_WANT_LIBPQ_BUILD=">= ${{env.LIBPQ_VERSION}}"
163+
GAUSSDB_TEST_WANT_LIBPQ_IMPORT=">= ${{env.LIBPQ_VERSION}}"
164164
165165
- name: Upload artifacts
166166
uses: actions/upload-artifact@v4
@@ -212,7 +212,7 @@ jobs:
212212
- name: Build wheels
213213
uses: pypa/cibuildwheel@v2.23.2
214214
with:
215-
package-dir: psycopg_binary
215+
package-dir: gaussdb_binary
216216
env:
217217
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" # cache vcpkg
218218
CIBW_BUILD: ${{matrix.pyver}}-${{matrix.arch}}
@@ -222,14 +222,14 @@ jobs:
222222
delvewheel repair -w {dest_dir}
223223
--add-path="${{ steps.libdir.outputs.EXTRA_LIB_DIR }}"
224224
--no-mangle "libiconv-2.dll;libwinpthread-1.dll" {wheel}
225-
CIBW_TEST_REQUIRES: ./psycopg[test] ./psycopg_pool
225+
CIBW_TEST_REQUIRES: ./gaussdb[test] ./gaussdb_pool
226226
CIBW_TEST_COMMAND: >-
227227
pytest {project}/tests -m "not slow and not flakey" --color yes
228228
CIBW_ENVIRONMENT_WINDOWS: >-
229-
PSYCOPG_IMPL=binary
230-
PSYCOPG_TEST_DSN="host=127.0.0.1 user=postgres"
231-
PSYCOPG_TEST_WANT_LIBPQ_BUILD=${{env.LIBPQ_VERSION}}
232-
PSYCOPG_TEST_WANT_LIBPQ_IMPORT=${{env.LIBPQ_VERSION}}
229+
GAUSSDB_IMPL=binary
230+
GAUSSDB_TEST_DSN="host=127.0.0.1 user=postgres"
231+
GAUSSDB_TEST_WANT_LIBPQ_BUILD=${{env.LIBPQ_VERSION}}
232+
GAUSSDB_TEST_WANT_LIBPQ_IMPORT=${{env.LIBPQ_VERSION}}
233233
234234
- uses: actions/upload-artifact@v4
235235
with:
@@ -249,7 +249,7 @@ jobs:
249249
- name: Merge Artifacts
250250
uses: actions/upload-artifact/merge@v4
251251
with:
252-
name: psycopg-binary-artifact
252+
name: gaussdb-binary-artifact
253253
delete-merged: true
254254

255255
# }}}

.github/workflows/packages-pool.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Build pool packages
22

33
on:
44
workflow_dispatch:
5-
schedule:
6-
- cron: '28 6 * * sun'
5+
# schedule:
6+
# - cron: '28 6 * * sun'
77

88
jobs:
99

@@ -14,8 +14,8 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
include:
17-
- {package: psycopg_pool, format: sdist}
18-
- {package: psycopg_pool, format: wheel}
17+
- {package: gaussdb_pool, format: sdist}
18+
- {package: gaussdb_pool, format: wheel}
1919

2020
steps:
2121
- uses: actions/checkout@v4
@@ -31,12 +31,12 @@ jobs:
3131
run: python -m build -o dist --${{ matrix.format }} ${{ matrix.package }}
3232

3333
- name: Install the Python pool package and test requirements
34-
run: pip install psycopg[test] dist/*
34+
run: pip install gaussdb[test] dist/*
3535

3636
- name: Test the package
3737
run: pytest -m 'pool and not slow and not flakey' --color yes
3838
env:
39-
PSYCOPG_TEST_DSN: "host=127.0.0.1 user=postgres"
39+
GAUSSDB_TEST_DSN: "host=127.0.0.1 user=postgres"
4040
PGPASSWORD: password
4141

4242
- uses: actions/upload-artifact@v4
@@ -66,5 +66,5 @@ jobs:
6666
- name: Merge Artifacts
6767
uses: actions/upload-artifact/merge@v4
6868
with:
69-
name: psycopg-pool-artifact
69+
name: gaussdb-pool-artifact
7070
delete-merged: true

0 commit comments

Comments
 (0)