Repository navigation
Make code compatible with cython 3 - #803
Conversation
travishein
left a comment
There was a problem hiding this comment.
I was able to build these locally on my Python 3.9 environment in Docker, on arm64 , and amd64. .
this does indeed unblock the problem where it was not compiling for me.
|
I can also confirm that this code works on CentOS Stream 9 x86_64 and MacOS Ventura x86_64. |
|
Thank you! |
|
@termim, it sounds like you have resolved the issue and pushed a new version into Main. Could I please ask that you cut a new release tag with this fix e.g. 2.2.9, because many projects using PYMSSQL are looking at the latest release version and are therefore picking up version i.e. 2.2.8. I also wonder why the current release for this project hasn't been set to the latest release tag as well? The current release is pointing to version 2.1.5. Thanks for resolving the issue. |
|
@s7clarke10 2.2.8 is the latest release. Where the current release is pointing to 2.1.5? |
|
@termim, I'm not sure why the AWS Glue issue #833 was closed. The latest release still appears to have issues. This was running on a Redhat 8 server with Python3.8. I wonder if these issues are related to version of Python less that 3.9. Version 3.8 is still a well used version. $ rm -Rf ~/.virtualenv/temp
$ python3.8 -m venv ~/.virtualenv/temp
$ source ~/.virtualenv/temp/bin/activate
(temp) $ pip install git+https://github.com/pymssql/pymssql.git
Collecting git+https://github.com/pymssql/pymssql.git
Cloning https://github.com/pymssql/pymssql.git to /tmp_dont_delete/pip-req-build-5_em97rj
Running command git clone -q https://github.com/pymssql/pymssql.git /tmp_dont_delete/pip-req-build-5_em97rj
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: pymssql
Building wheel for pymssql (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /home/myuser/.virtualenv/temp/bin/python3.8 /home/myuser/.virtualenv/temp/lib64/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp_dont_delete/tmpeezwehfg
cwd: /tmp_dont_delete/pip-req-build-5_em97rj
Complete output (43 lines):
setup.py: platform.system() => Linux
setup.py: platform.architecture() => ('64bit', 'ELF')
setup.py: platform.libc_ver() => ('glibc', '2.28')
setup.py: include_dirs => []
setup.py: library_dirs => []
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/pymssql
copying src/pymssql/__init__.py -> build/lib.linux-x86_64-cpython-38/pymssql
running build_ext
Compiling src/pymssql/_mssql.pyx because it changed.
[1/1] Cythonizing src/pymssql/_mssql.pyx
building 'pymssql._mssql' extension
creating build/temp.linux-x86_64-cpython-38
creating build/temp.linux-x86_64-cpython-38/src
creating build/temp.linux-x86_64-cpython-38/src/pymssql
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/myuser/.virtualenv/temp/include -I/usr/include/python3.8 -c src/pymssql/_mssql.c -o build/temp.linux-x86_64-cpython-38/src/pymssql/_mssql.o -DMSDBLIB
src/pymssql/_mssql.c:1127:10: fatal error: sqlfront.h: No such file or directory
#include "sqlfront.h"
^~~~~~~~~~~~
compilation terminated.
warning: src/pymssql/_mssql.pyx:27:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:28:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:29:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:30:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:31:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:32:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:35:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:36:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:38:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:84:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:243:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:277:4: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:346:4: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:840:8: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:922:8: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:1029:12: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:1403:16: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: src/pymssql/_mssql.pyx:1737:8: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for pymssql
Running setup.py clean for pymssql
Failed to build pymssql
ERROR: Could not build wheels for pymssql which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 19.3.1; however, version 23.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command. |
|
@termim , in reference to the version that I mention. I was confused by the main github page which indicates 2.1.5 is the latest. |
2.1.5 on GitHub, 2.2.8 on PyPI - what is confusing?
You are trying to build from the source. To do that you need to install project dependencies, see Building and developing pymssql |
* we need this to drop our cython pin (see pymssql/pymssql#803) * adapt overriding schemathesis.auths.AuthProvider.get due to new schemathesis version Change-Id: Iaede691795ca3cfbf47126a10349b0e813c6affc JIRA-Ref: CMK-14527

Cython 3 requires noexcept keyword for functions not returning exception: https://cython.readthedocs.io/en/latest/src/userguide/migrating_to_cy30.html#exception-values-and-noexcept