Skip to content

Make code compatible with cython 3 - #803

Merged
termim merged 1 commit into
pymssql:masterfrom
matusvalo:cython3_fix
Jul 30, 2023
Merged

termim merged 1 commit into
pymssql:masterfrom
matusvalo:cython3_fix

Conversation

@matusvalo

Copy link
Copy Markdown
Contributor

@travishein travishein left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tomdesair

Copy link
Copy Markdown

I can also confirm that this code works on CentOS Stream 9 x86_64 and MacOS Ventura x86_64.

@termim
termim merged commit 078d044 into pymssql:master Jul 30, 2023
@termim

termim commented Jul 30, 2023

Copy link
Copy Markdown
Contributor

Thank you!

@s7clarke10

Copy link
Copy Markdown

@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.

@termim

termim commented Aug 2, 2023

Copy link
Copy Markdown
Contributor

@s7clarke10 2.2.8 is the latest release.

Where the current release is pointing to 2.1.5?

@s7clarke10

s7clarke10 commented Aug 3, 2023 •

Copy link
Copy Markdown

@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.

@s7clarke10

Copy link
Copy Markdown

@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.

image

@termim

termim commented Aug 3, 2023

Copy link
Copy Markdown
Contributor

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?

(temp) $ pip i(temp) $ pip install git+https://github.com/pymssql/pymssql.git

You are trying to build from the source. To do that you need to install project dependencies, see Building and developing pymssql

CheckmkCI pushed a commit to Checkmk/checkmk that referenced this pull request Oct 23, 2023
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants