Skip to content

Commit a828637

Browse files
committed
Support for Python 3.14 and dynamic tests
1 parent fe97f97 commit a828637

File tree

4 files changed

+19
-41
lines changed

4 files changed

+19
-41
lines changed

.github/workflows/test.yaml

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,13 @@ name: select_ai_py_tests
22
on: push
33

44
jobs:
5-
pysai_test_data_setup:
6-
runs-on: ubuntu-latest
7-
steps:
8-
- name: Check out python-select-ai repository code
9-
uses: actions/checkout@v5
10-
11-
- name: Set up Python 3.12
12-
uses: actions/setup-python@v6
13-
with:
14-
python-version: 3.12
15-
16-
- name: Install select_ai with core dependencies
17-
run: |
18-
python -m pip install --upgrade pip
19-
pip install pytest anyio
20-
pip install -e .
21-
22-
- name: Create Schema
23-
run: |
24-
pytest tests/create_schema.py
25-
env:
26-
PYSAI_TEST_USER: ${{ secrets.PYSAI_TEST_USER }}
27-
PYSAI_TEST_USER_PASSWORD: ${{ secrets.PYSAI_TEST_USER_PASSWORD }}
28-
PYSAI_TEST_ADMIN_USER: ${{ secrets.PYSAI_TEST_ADMIN_USER }}
29-
PYSAI_TEST_ADMIN_PASSWORD: ${{ secrets.PYSAI_TEST_ADMIN_PASSWORD }}
30-
PYSAI_TEST_CONNECT_STRING: ${{ secrets.PYSAI_TEST_CONNECT_STRING }}
31-
PYSAI_TEST_OCI_USER_OCID: ${{ secrets.PYSAI_TEST_OCI_USER_OCID }}
32-
PYSAI_TEST_OCI_TENANCY_OCID: ${{ secrets.PYSAI_TEST_OCI_TENANCY_OCID }}
33-
PYSAI_TEST_OCI_PRIVATE_KEY: ${{ secrets.PYSAI_TEST_OCI_PRIVATE_KEY }}
34-
PYSAI_TEST_OCI_FINGERPRINT: ${{ secrets.PYSAI_TEST_OCI_FINGERPRINT }}
35-
PYSAI_TEST_OCI_COMPARTMENT_ID: ${{ secrets.PYSAI_TEST_OCI_COMPARTMENT_ID }}
36-
37-
38-
pysai_unittests:
5+
test:
396
runs-on: ${{ matrix.os }}
40-
needs: pysai_test_data_setup
417
strategy:
428
fail-fast: true
439
matrix:
4410
os: [ ubuntu-latest ]
45-
python-version: ['3.11', '3.12', '3.13']
11+
python-version: ['3.11', '3.12', '3.13', '3.14']
4612

4713
steps:
4814
- name: Check out python-select-ai repository code
@@ -53,6 +19,12 @@ jobs:
5319
with:
5420
python-version: ${{ matrix.python-version }}
5521

22+
- name: Replace dot in python version with empty space
23+
run: |
24+
python_version=${{matrix.python-version}}
25+
new_version="${python_version//./ }"
26+
echo "PYTHON_VERSION_WITHOUT_DOT=${new_version}" >> $GITHUB_ENV
27+
5628
- name: Install select_ai with core dependencies
5729
run: |
5830
python -m pip install --upgrade pip
@@ -61,9 +33,11 @@ jobs:
6133
6234
- name: Run select_ai tests
6335
run: |
36+
python_version=${{matrix.python-version}}
37+
pytest tests/create_schema.py
6438
pytest -vv
6539
env:
66-
PYSAI_TEST_USER: ${{ secrets.PYSAI_TEST_USER }}
40+
PYSAI_TEST_USER: ${{ secrets.PYSAI_TEST_USER }}_${{env.PYTHON_VERSION_WITHOUT_DOT}}
6741
PYSAI_TEST_USER_PASSWORD: ${{ secrets.PYSAI_TEST_USER_PASSWORD }}
6842
PYSAI_TEST_ADMIN_USER: ${{ secrets.PYSAI_TEST_ADMIN_USER }}
6943
PYSAI_TEST_ADMIN_PASSWORD: ${{ secrets.PYSAI_TEST_ADMIN_PASSWORD }}

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ classifiers = [
3333
"Programming Language :: Python :: 3.11",
3434
"Programming Language :: Python :: 3.12",
3535
"Programming Language :: Python :: 3.13",
36+
"Programming Language :: Python :: 3.14",
3637
"Programming Language :: Python :: Implementation :: CPython",
3738
"Topic :: Database",
3839
"Topic :: Scientific/Engineering :: Artificial Intelligence",

src/select_ai/db.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ async def async_connect(user: str, password: str, dsn: str, *args, **kwargs):
5959
object
6060
"""
6161
async_conn = await oracledb.connect_async(
62-
user=user, password=password, dsn=dsn, *args, **kwargs
62+
user=user,
63+
password=password,
64+
dsn=dsn,
65+
connection_id_prefix="async-python-select-ai",
66+
*args,
67+
**kwargs,
6368
)
6469
_set_connection(async_conn=async_conn)
6570

tests/conftest.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ def connect(setup_test_user, test_env):
110110

111111
@pytest.fixture(autouse=True, scope="session")
112112
async def async_connect(setup_test_user, test_env, anyio_backend):
113-
await select_ai.async_connect(
114-
**test_env.connect_params(), disable_oob=True
115-
)
113+
await select_ai.async_connect(**test_env.connect_params())
116114
yield
117115
await select_ai.async_disconnect()
118116

0 commit comments

Comments
 (0)