-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (45 loc) · 1.73 KB
/
npyodbc_tests.yml
File metadata and controls
51 lines (45 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: npyodbc tests
permissions: {}
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
name: Run npyodbc tests (python ${{ matrix.python-version }}, numpy ${{ matrix.numpy-version }})
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
numpy-version: ['latest', '<2']
fail-fast: false
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: ${{ matrix.python-version }}
- name: Install sqlite
run: |
sudo apt update
sudo apt install -y sqlite3 unixodbc-dev libsqliteodbc
- name: Install target numpy version to compile against
if: matrix.numpy-version != 'latest'
run: |
pip install 'numpy<2'
- name: Install npyodbc
run: |
pip install '.[test]'
- name: Run Numpy tests against compilation version
working-directory: tests
run: |
pytest test_numpy.py
- name: When compiled with numpy>=2, also run tests against numpy<2
if: matrix.numpy-version == 'latest'
working-directory: tests
run: |
pip install 'numpy<2'
# Ensure we are testing with npyodbc compiled against numpy>=2.
# Run this somewhere besides the current working directory, because python will
# inadvertently try to import the local npyodbc code which doesn't have the compiled
# extension otherwise.
python -c 'import npyodbc; assert npyodbc.numpy_abi_version >= 0x2000000'
pytest test_numpy.py