Skip to content

Commit 13ec985

Browse files
committed
Update the pyodbc version to patch to 5.3.0
1 parent 9461a1c commit 13ec985

9 files changed

Lines changed: 38 additions & 152 deletions

File tree

.gitignore

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# Meson
2-
subprojects/*
3-
!subprojects/*.wrap
4-
!subprojects/packagefiles
52
build/
6-
subprojects/packagefiles/patches/*.h
7-
subprojects/packagefiles/patches/*.cpp
8-
subprojects/packagefiles/patches/*.toml
3+
subprojects/pyodbc/
4+
subprojects/.wraplock
95

106
# Python
117
__pycache__/

include/npcontainer.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
#define _NPCONTAINER_H_
33

44
#include <Python.h>
5+
#include "pyodbc.h"
6+
#include "wrapper.h"
7+
#include "textenc.h"
8+
#include "connection.h"
9+
#include "cursor.h"
510

611
PyObject *Cursor_fetchdictarray(PyObject *self, PyObject *args, PyObject *kwargs);
712

meson.build

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ npyodbc_sources = [
2929
'src/npyodbcmodule.cpp'
3030
]
3131

32-
add_project_arguments('-DPYODBC_VERSION=' + meson.project_version(), language: 'cpp')
32+
add_project_arguments(
33+
[
34+
'-DPYODBC_VERSION=' + meson.project_version(),
35+
'-Wno-write-strings',
36+
'-Wno-deprecated-declarations',
37+
],
38+
language: 'cpp'
39+
)
3340

3441
# Build the npyodbc module
3542
python.extension_module(
@@ -44,4 +51,6 @@ python.extension_module(
4451
],
4552
include_directories : [npyodbc_inc],
4653
install : true,
54+
cpp_args : run_command(['odbc_config', '--cflags'], check : true).stdout().strip(),
55+
link_args : run_command(['odbc_config', '--libs'], check : true).stdout().strip(),
4756
)

src/npcontainer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
// do not correctly specify includes inside themselves,
2626
// and there will be undefined objects if the order is changed.
2727
#include "pyodbc.h"
28+
#include "wrapper.h"
29+
#include "textenc.h"
2830
#include "connection.h"
2931
#include "cursor.h"
3032
#include "dbspecific.h"
Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
1-
--- pyodbc/pyproject.toml 2024-06-13 15:43:19.682449229 -0500
2-
+++
3-
@@ -10,7 +10,7 @@
4-
5-
description = "DB API module for ODBC"
6-
readme = "README.md"
7-
-license = {text = "MIT License"}
8-
+license = {text = "MIT-0 License"}
9-
10-
authors = [{name = "Michael Kleehammer", email="michael@kleehammer.com"}]
11-
12-
@@ -22,7 +22,7 @@
13-
classifiers=['Development Status :: 5 - Production/Stable',
14-
'Intended Audience :: Developers',
15-
'Intended Audience :: System Administrators',
16-
- 'License :: OSI Approved :: MIT License',
17-
+ 'License :: OSI Approved :: MIT No Attribution License (MIT-0)',
18-
'Operating System :: Microsoft :: Windows',
19-
'Operating System :: POSIX',
20-
'Programming Language :: Python',
21-
@@ -34,5 +34,5 @@
1+
--- a/pyproject.toml
2+
+++ b/pyproject.toml
3+
@@ -33,5 +33,5 @@ classifiers=['Development Status :: 5 - Production/Stable',
224
Homepage = "https://github.com/mkleehammer/pyodbc"
23-
5+
246
[build-system]
257
-requires = ["setuptools"]
268
-build-backend = "setuptools.build_meta"
9+
+requires = ["meson-python"]
2710
+build-backend = "mesonpy"
28-
+requires = ["meson-python", "numpy <2"]

subprojects/packagefiles/patches/textenc.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--- pyodbc/src/textenc.h 2024-06-13 15:22:07.845998858 -0500
2-
+++
2+
+++
33
@@ -1,5 +1,7 @@
44
#ifndef _TEXTENC_H
55
#define _TEXTENC_H

subprojects/packagefiles/pyodbc/meson.build

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
project('pyodbc', 'cpp', version : '5.1.0')
1+
project(
2+
'pyodbc',
3+
'cpp',
4+
version : '5.3.0',
5+
)
26

37
python = import('python').find_installation()
4-
python_dependency = python.dependency()
8+
python_dep = python.dependency()
59

610
compiler = meson.get_compiler('cpp')
711

812
# ODBC driver needs to be installed by the OS.
9-
odbc_dependency = compiler.find_library('odbc')
13+
odbc_dep = compiler.find_library('odbc')
1014

1115
pyodbc_sources = [
1216
'src/cnxninfo.cpp',
@@ -27,9 +31,12 @@ pyodbc_inc = include_directories(
2731
)
2832

2933
pyodbc_dep = declare_dependency(
30-
include_directories: pyodbc_inc,
3134
sources: pyodbc_sources,
32-
dependencies: [python_dependency, odbc_dependency],
35+
dependencies: [
36+
python_dep,
37+
odbc_dep,
38+
],
39+
include_directories: [pyodbc_inc],
3340
)
3441

3542
meson.override_dependency('pyodbc', pyodbc_dep)

subprojects/packagefiles/pyodbc/src/connection.h

Lines changed: 0 additions & 115 deletions
This file was deleted.

subprojects/pyodbc.wrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[wrap-git]
22
directory = pyodbc
33
url = https://github.com/mkleehammer/pyodbc.git
4-
revision = 5.1.0
4+
revision = 5.3.0
55
depth = 1
66
patch_directory = pyodbc
77
diff_files = patches/textenc.patch, patches/pyproject.patch, patches/cursor.patch, patches/pyodbcmodule.patch

0 commit comments

Comments
 (0)