Skip to content

Commit 84d5244

Browse files
authored
Merge pull request #15 from pangpang20/master
Add PyPI upload step to release workflow and enhance database compatibility handling
2 parents 9955a5b + 378b1ea commit 84d5244

28 files changed

+689
-660
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and Release
33
on:
44
push:
55
tags:
6-
- "v*.*.*"
6+
- "*"
77

88
permissions:
99
contents: write
@@ -56,3 +56,12 @@ jobs:
5656
uses: softprops/action-gh-release@v1
5757
with:
5858
files: all_dist/*
59+
60+
- name: Upload to PyPI
61+
if: startsWith(github.ref, 'refs/tags/')
62+
run: |
63+
pip install --upgrade twine
64+
twine upload all_dist/*
65+
env:
66+
TWINE_USERNAME: __token__
67+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
8484
- name: Create test database
8585
run: |
86-
docker exec opengauss-custom bash -c "su - omm -c 'gsql -d postgres -c \"CREATE DATABASE test DBCOMPATIBILITY '\''PG'\'';\"'"
86+
docker exec opengauss-custom bash -c "su - omm -c 'gsql -d postgres -c \"CREATE DATABASE test ;\"'"
8787
8888
- name: Create report directory
8989
run: |

README.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,17 @@ EulerOS x86_64 systems, you can obtain it by running::
4545
# libpq.so.5.5 (libc6,x86-64) => /tmp/lib/libpq.so.5.5
4646
ldconfig -p | grep pq
4747

48+
Installation from PyPI:
4849

50+
python3 -m venv test_env
51+
source test_env/bin/activate
52+
pip install --upgrade pip
53+
pip install isort-gaussdb
54+
pip install gaussdb
55+
pip install gaussdb-pool
56+
python -c "import gaussdb; print(gaussdb.__version__)" # Outputs: 1.0.0.dev2
4957

50-
You can then clone this repository to develop GaussDB::
58+
You can also clone this repository to develop GaussDB::
5159

5260
# Create a new Python virtual environment in the .venv directory
5361
python -m venv .venv

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Release notes
4242

4343
news
4444
news_pool
45+
news_isort
4546

4647

4748
Indices and tables

docs/news.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
``gaussdb`` release notes
88
=========================
99

10-
Future releases
11-
---------------
12-
1310
gaussdb.0b1
1411
^^^^^^^^^^^^^
1512

docs/news_isort.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. currentmodule:: isort_gaussdb
2+
3+
.. index::
4+
single: Release notes
5+
single: News
6+
7+
``isort_gaussdb`` release notes
8+
===================================
9+
10+
Current release
11+
---------------
12+
- First release on PyPI.

docs/news_pool.rst

Lines changed: 0 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -10,161 +10,4 @@
1010
Current release
1111
---------------
1212

13-
gaussdb_pool 3.2.6
14-
^^^^^^^^^^^^^^^^^^
15-
16-
- Reset transaction status of connection failing check (:ticket:`#1014`).
17-
18-
19-
gaussdb_pool 3.2.5
20-
^^^^^^^^^^^^^^^^^^
21-
22-
- Fix spurious warning logging on pool shrinking (:ticket:`#1001`).
23-
24-
25-
gaussdb_pool 3.2.4
26-
^^^^^^^^^^^^^^^^^^
27-
28-
- Add a hint to the warning printed if threads fail to stop during
29-
``__del__``, which has been reported happening during interpreter shutdown
30-
on Python 3.13 (see :ticket:`#954`).
31-
32-
33-
gaussdb_pool 3.2.3
34-
^^^^^^^^^^^^^^^^^^
35-
36-
- Add metadata to declare compatibility with Python 3.13.
37-
38-
39-
gaussdb_pool 3.2.2
40-
^^^^^^^^^^^^^^^^^^
41-
42-
- Raise a `RuntimeWarning` instead of a `DeprecationWarning` if an async pool
43-
is open in the constructor.
44-
- Fix connections possibly left in the pool after closing (:ticket:`#784`).
45-
- Use an empty query instead of ``SELECT 1`` to check connections
46-
(:ticket:`#790`).
47-
48-
49-
gaussdb_pool 3.2.1
50-
^^^^^^^^^^^^^^^^^^
51-
52-
- Respect the `!timeout` parameter on `~ConnectionPool.connection()` when
53-
`!check` fails. Also avoid a busy-loop of checking; separate check attempts
54-
using an exponential backoff (:ticket:`#709`).
55-
- Use `typing.Self` as a more correct return value annotation of context
56-
managers and other self-returning methods (see :ticket:`708`).
57-
58-
59-
gaussdb_pool 3.2.0
60-
------------------
61-
62-
- Add support for async `!reconnect_failed` callbacks in `AsyncConnectionPool`
63-
(:ticket:`#520`).
64-
- Add `!check` parameter to the pool constructor and
65-
`~ConnectionPool.check_connection()` method. (:ticket:`#656`).
66-
- Make connection pool classes generic on the connection type (:ticket:`#559`).
67-
- Raise a warning if sync pools rely an implicit `!open=True` and the
68-
pool context is not used. In the future the default will become `!False`
69-
(:ticket:`#659`).
70-
- Raise a warning if async pools are opened in the constructor. In the future
71-
it will become an error. (:ticket:`#659`).
72-
73-
74-
gaussdb_pool 3.1.9
75-
^^^^^^^^^^^^^^^^^^
76-
77-
- Fix the return type annotation of `!NullConnectionPool.__enter__()`
78-
(:ticket:`#540`).
79-
80-
81-
gaussdb_pool 3.1.8
82-
^^^^^^^^^^^^^^^^^^
83-
84-
- Enforce connections' ``max_lifetime`` on `~ConnectionPool.check()`
85-
(:ticket:`#482`).
86-
87-
88-
gaussdb_pool 3.1.7
89-
^^^^^^^^^^^^^^^^^^
90-
91-
- Fix handling of tasks cancelled while waiting in async pool queue
92-
(:ticket:`#503`).
93-
94-
95-
gaussdb_pool 3.1.6
96-
^^^^^^^^^^^^^^^^^^
97-
98-
- Declare all parameters in pools constructors, instead of using `!**kwargs`
99-
(:ticket:`#493`).
100-
101-
102-
gaussdb_pool 3.1.5
103-
^^^^^^^^^^^^^^^^^^
104-
105-
- Make sure that `!ConnectionPool.check()` refills an empty pool
106-
(:ticket:`#438`).
107-
- Avoid error in Pyright caused by aliasing `!TypeAlias` (:ticket:`#439`).
108-
109-
110-
gaussdb_pool 3.1.4
111-
^^^^^^^^^^^^^^^^^^
112-
113-
- Fix async pool exhausting connections, happening if the pool is created
114-
before the event loop is started (:ticket:`#219`).
115-
116-
117-
gaussdb_pool 3.1.3
118-
^^^^^^^^^^^^^^^^^^
119-
120-
- Add support for Python 3.11 (:ticket:`#305`).
121-
122-
123-
gaussdb_pool 3.1.2
124-
^^^^^^^^^^^^^^^^^^
125-
126-
- Fix possible failure to reconnect after losing connection from the server
127-
(:ticket:`#370`).
128-
129-
130-
gaussdb_pool 3.1.1
131-
^^^^^^^^^^^^^^^^^^
132-
133-
- Fix race condition on pool creation which might result in the pool not
134-
filling (:ticket:`#230`).
135-
136-
137-
gaussdb_pool 3.1.0
138-
------------------
139-
140-
- Add :ref:`null-pool` (:ticket:`#148`).
141-
- Add `ConnectionPool.open()` and `!open` parameter to the pool constructor
142-
(:ticket:`#151`).
143-
- Drop support for Python 3.6.
144-
145-
146-
gaussdb_pool 3.0.3
147-
^^^^^^^^^^^^^^^^^^
148-
149-
- Raise `!ValueError` if `ConnectionPool` `!min_size` and `!max_size` are both
150-
set to 0 (instead of hanging).
151-
- Raise `PoolClosed` calling `~ConnectionPool.wait()` on a closed pool.
152-
153-
154-
gaussdb_pool 3.0.2
155-
^^^^^^^^^^^^^^^^^^
156-
157-
- Remove dependency on the internal `!gaussdb._compat` module.
158-
159-
160-
gaussdb_pool 3.0.1
161-
^^^^^^^^^^^^^^^^^^
162-
163-
- Don't leave connections idle in transaction after calling
164-
`~ConnectionPool.check()` (:ticket:`#144`).
165-
166-
167-
gaussdb_pool 3.0
168-
----------------
169-
17013
- First release on PyPI.

gaussdb/pyproject.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "gaussdb"
77
description = "GaussDB database adapter for Python"
88

99
# STOP AND READ! if you change:
10-
version = "1.0.0.dev2"
10+
version = "1.0.1"
1111
# also change:
1212
# - `docs/news.rst` to declare this as the current version or an unreleased one;
1313
# - `gaussdb_c/pyproject.toml` to the same version;
@@ -48,11 +48,10 @@ email = "[email protected]"
4848
text = "GNU Lesser General Public License v3 (LGPLv3)"
4949

5050
[project.urls]
51-
Homepage = "https://psycopg.org/"
52-
Documentation = "https://psycopg.org/psycopg3/docs/"
53-
Changes = "https://psycopg.org/psycopg3/docs/news.html"
54-
Code = "https://github.com/psycopg/psycopg"
55-
"Issue Tracker" = "https://github.com/psycopg/psycopg/issues"
51+
Homepage = "https://github.com/HuaweiCloudDeveloper/gaussdb-python/"
52+
Documentation = "https://github.com/HuaweiCloudDeveloper/gaussdb-python/"
53+
Code = "https://github.com/HuaweiCloudDeveloper/gaussdb-python/"
54+
"Issue Tracker" = "https://github.com/HuaweiCloudDeveloper/gaussdb-python/issues"
5655

5756
[project.readme]
5857
file = "README.rst"

gaussdb_pool/pyproject.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "gaussdb-pool"
77
description = "Connection Pool for GaussDB"
88

99
# STOP AND READ! if you change:
10-
version = "1.0.0.dev1"
10+
version = "1.0.1"
1111
# also change:
1212
# - `docs/news_pool.rst` to declare this version current or unreleased
1313

@@ -44,11 +44,10 @@ email = "[email protected]"
4444
text = "GNU Lesser General Public License v3 (LGPLv3)"
4545

4646
[project.urls]
47-
Homepage = "https://psycopg.org/"
48-
Documentation = "https://www.psycopg.org/psycopg3/docs/advanced/pool.html"
49-
Changes = "https://psycopg.org/psycopg3/docs/news_pool.html"
50-
Code = "https://github.com/psycopg/psycopg"
51-
"Issue Tracker" = "https://github.com/psycopg/psycopg/issues"
47+
Homepage = "https://github.com/HuaweiCloudDeveloper/gaussdb-python/"
48+
Documentation = "https://github.com/HuaweiCloudDeveloper/gaussdb-python/"
49+
Code = "https://github.com/HuaweiCloudDeveloper/gaussdb-python/"
50+
"Issue Tracker" = "https://github.com/HuaweiCloudDeveloper/gaussdb-python/issues"
5251

5352
[project.readme]
5453
file = "README.rst"

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ exclude_lines = [
2929
files = [
3030
"gaussdb/gaussdb",
3131
"gaussdb_pool/gaussdb_pool",
32-
"gaussdb_c/gaussdb_c",
3332
"tests",
3433
]
3534
warn_unused_ignores = true
@@ -57,7 +56,7 @@ disallow_untyped_calls = false
5756

5857
[tool.codespell]
5958
ignore-words-list = "alot,ans,ba,fo,te,erro,varning"
60-
skip = "build,_build,.tox,.mypy_cache,.venv,pq.c,_gaussdb.c,*.html"
59+
skip = "build,_build,.tox,.mypy_cache,.venv,*.html"
6160

6261
[tool.isort]
6362
profile = "black"

0 commit comments

Comments
 (0)