Skip to content

[FIX]using latest good 0.29.35 cython compiler for buildilng; cython=…#827

Closed
marcwimmer wants to merge 5 commits intopymssql:masterfrom
marcwimmer:fix_cython_compiler_version
Closed

[FIX]using latest good 0.29.35 cython compiler for buildilng; cython=…#827
marcwimmer wants to merge 5 commits intopymssql:masterfrom
marcwimmer:fix_cython_compiler_version

Conversation

@marcwimmer
Copy link
Copy Markdown

…=3.0.0 which was recently released does not compile.

message is

     dberrhandle(err_handler)
                  ^
  ------------------------------------------------------------

  src/pymssql/_mssql.pyx:2203:16: Cannot assign type 'int (DBPROCESS *, int, int, int, char *, char *) except? -1' to 'EHANDLEFUNC'

I checked the pyx source code and no obvious errors.

During pip3 install the setuptools download the 3.0.0 cython compiler which makes this error. cython==0.29.35 just works fine.

As cython==3.0.0 is released few days ago many people are complaining.

…=3.0.0 which was recently released does not compile.
@da-woods
Copy link
Copy Markdown

to make it work on Cython 3 the fix would be to add noexcept to the definition of err_handler. I suspect pinning the version is a better short -term fix though

@marcwimmer
Copy link
Copy Markdown
Author

marcwimmer commented Jul 19, 2023

ah great - i have no experience with cython right now. i saw the except? thing - great

@decaz
Copy link
Copy Markdown

decaz commented Jul 19, 2023

Why not ~=0.29? There is 0.29.36 as the latest pre 3 release.

@marcwimmer
Copy link
Copy Markdown
Author

whatever - many pipes are broken on azure now and others; needs to get online;
would it match 3.0.29 then also?!? dont know for sure
but i change it now -- changed!

can you please put it on pypi?

Comment thread pyproject.toml Outdated
Co-authored-by: Edgar R. M. <edgarrm358@gmail.com>
@marcwimmer
Copy link
Copy Markdown
Author

fixed my typo - please online! we need that for a lot of build pipelines that are stuck now.

@mattjbudd
Copy link
Copy Markdown

Thank you @marcwimmer for the fix. Hopefully, they can get this online soon!

potiuk added a commit to potiuk/airflow that referenced this pull request Jul 21, 2023
Workaround an issue with installing pymssql on ARM architecture
triggered by Cython 3.0.0 release as of 18 July 2023. The problem is
that pip uses latest Cython to compile pymssql and since we are using
setuptools, there is no easy way to fix version of Cython used to
compile packages.

This triggers a problem with newer `pip` versions that have build
isolation enabled by default because There is no (easy) way to pin build
dependencies for dependent packages. If a package does not have  limit
on build dependencies, it will use the latest version of them to build
that particular package.

The workaround to the problem suggest in the last thread by Pradyun
Gedam - pip maintainer - is to use PIP_CONSTRAINT environment variable
and constraint the version of Cython used while installing
the package. Which is precisely what we are doing here.

Note that it does not work if we pass ``--constraint`` option to pip
because it will not be passed to the package being build in isolation.
The fact that the PIP_CONSTRAINT env variable works in the isolation is
a bit of side-effect on how env variables work and that they are passed
to subprocesses as pip launches a subprocess `pip` to build the package.

This is a temporary solution until the issue is resolved in pymssql or
Cython.

Issues/discussions that track it:

* cython/cython#5541
* pymssql/pymssql#827
* https://discuss.python.org/t/no-way-to-pin-build-dependencies/29833

Since we have to change Dockerfile around installing `pip`, also
version of `pip` has been upgraded to latest - 23.2
potiuk added a commit to apache/airflow that referenced this pull request Jul 21, 2023
Workaround an issue with installing pymssql on ARM architecture
triggered by Cython 3.0.0 release as of 18 July 2023. The problem is
that pip uses latest Cython to compile pymssql and since we are using
setuptools, there is no easy way to fix version of Cython used to
compile packages.

This triggers a problem with newer `pip` versions that have build
isolation enabled by default because There is no (easy) way to pin build
dependencies for dependent packages. If a package does not have  limit
on build dependencies, it will use the latest version of them to build
that particular package.

The workaround to the problem suggest in the last thread by Pradyun
Gedam - pip maintainer - is to use PIP_CONSTRAINT environment variable
and constraint the version of Cython used while installing
the package. Which is precisely what we are doing here.

Note that it does not work if we pass ``--constraint`` option to pip
because it will not be passed to the package being build in isolation.
The fact that the PIP_CONSTRAINT env variable works in the isolation is
a bit of side-effect on how env variables work and that they are passed
to subprocesses as pip launches a subprocess `pip` to build the package.

This is a temporary solution until the issue is resolved in pymssql or
Cython.

Issues/discussions that track it:

* cython/cython#5541
* pymssql/pymssql#827
* https://discuss.python.org/t/no-way-to-pin-build-dependencies/29833

Since we have to change Dockerfile around installing `pip`, also
version of `pip` has been upgraded to latest - 23.2
@marcwimmer
Copy link
Copy Markdown
Author

there is an intermediate solution:

use

pip3 install cython==0.29.35
pip3 install --no-build-isolation pymssql==2.1.5

(at the moment the 2.2.x. packages are broken; 2.1.x works - checked that 2 days ago; could be that they work now)

parameter no build isolation makes, that the current env with cython==0.29.35 is used.

@yumingchangsabodota
Copy link
Copy Markdown

when will this be merged and pushed to pip?

@termim
Copy link
Copy Markdown
Contributor

termim commented Jul 30, 2023

Fixed in #803.

@termim termim closed this Jul 30, 2023
ahidalgob pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request May 15, 2024
Workaround an issue with installing pymssql on ARM architecture
triggered by Cython 3.0.0 release as of 18 July 2023. The problem is
that pip uses latest Cython to compile pymssql and since we are using
setuptools, there is no easy way to fix version of Cython used to
compile packages.

This triggers a problem with newer `pip` versions that have build
isolation enabled by default because There is no (easy) way to pin build
dependencies for dependent packages. If a package does not have  limit
on build dependencies, it will use the latest version of them to build
that particular package.

The workaround to the problem suggest in the last thread by Pradyun
Gedam - pip maintainer - is to use PIP_CONSTRAINT environment variable
and constraint the version of Cython used while installing
the package. Which is precisely what we are doing here.

Note that it does not work if we pass ``--constraint`` option to pip
because it will not be passed to the package being build in isolation.
The fact that the PIP_CONSTRAINT env variable works in the isolation is
a bit of side-effect on how env variables work and that they are passed
to subprocesses as pip launches a subprocess `pip` to build the package.

This is a temporary solution until the issue is resolved in pymssql or
Cython.

Issues/discussions that track it:

* cython/cython#5541
* pymssql/pymssql#827
* https://discuss.python.org/t/no-way-to-pin-build-dependencies/29833

Since we have to change Dockerfile around installing `pip`, also
version of `pip` has been upgraded to latest - 23.2

GitOrigin-RevId: 8e054bb57dd0b29f302872b4500b799c369bde71
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Sep 19, 2024
Workaround an issue with installing pymssql on ARM architecture
triggered by Cython 3.0.0 release as of 18 July 2023. The problem is
that pip uses latest Cython to compile pymssql and since we are using
setuptools, there is no easy way to fix version of Cython used to
compile packages.

This triggers a problem with newer `pip` versions that have build
isolation enabled by default because There is no (easy) way to pin build
dependencies for dependent packages. If a package does not have  limit
on build dependencies, it will use the latest version of them to build
that particular package.

The workaround to the problem suggest in the last thread by Pradyun
Gedam - pip maintainer - is to use PIP_CONSTRAINT environment variable
and constraint the version of Cython used while installing
the package. Which is precisely what we are doing here.

Note that it does not work if we pass ``--constraint`` option to pip
because it will not be passed to the package being build in isolation.
The fact that the PIP_CONSTRAINT env variable works in the isolation is
a bit of side-effect on how env variables work and that they are passed
to subprocesses as pip launches a subprocess `pip` to build the package.

This is a temporary solution until the issue is resolved in pymssql or
Cython.

Issues/discussions that track it:

* cython/cython#5541
* pymssql/pymssql#827
* https://discuss.python.org/t/no-way-to-pin-build-dependencies/29833

Since we have to change Dockerfile around installing `pip`, also
version of `pip` has been upgraded to latest - 23.2

GitOrigin-RevId: 8e054bb57dd0b29f302872b4500b799c369bde71
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Nov 8, 2024
Workaround an issue with installing pymssql on ARM architecture
triggered by Cython 3.0.0 release as of 18 July 2023. The problem is
that pip uses latest Cython to compile pymssql and since we are using
setuptools, there is no easy way to fix version of Cython used to
compile packages.

This triggers a problem with newer `pip` versions that have build
isolation enabled by default because There is no (easy) way to pin build
dependencies for dependent packages. If a package does not have  limit
on build dependencies, it will use the latest version of them to build
that particular package.

The workaround to the problem suggest in the last thread by Pradyun
Gedam - pip maintainer - is to use PIP_CONSTRAINT environment variable
and constraint the version of Cython used while installing
the package. Which is precisely what we are doing here.

Note that it does not work if we pass ``--constraint`` option to pip
because it will not be passed to the package being build in isolation.
The fact that the PIP_CONSTRAINT env variable works in the isolation is
a bit of side-effect on how env variables work and that they are passed
to subprocesses as pip launches a subprocess `pip` to build the package.

This is a temporary solution until the issue is resolved in pymssql or
Cython.

Issues/discussions that track it:

* cython/cython#5541
* pymssql/pymssql#827
* https://discuss.python.org/t/no-way-to-pin-build-dependencies/29833

Since we have to change Dockerfile around installing `pip`, also
version of `pip` has been upgraded to latest - 23.2

GitOrigin-RevId: 8e054bb57dd0b29f302872b4500b799c369bde71
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request May 4, 2025
Workaround an issue with installing pymssql on ARM architecture
triggered by Cython 3.0.0 release as of 18 July 2023. The problem is
that pip uses latest Cython to compile pymssql and since we are using
setuptools, there is no easy way to fix version of Cython used to
compile packages.

This triggers a problem with newer `pip` versions that have build
isolation enabled by default because There is no (easy) way to pin build
dependencies for dependent packages. If a package does not have  limit
on build dependencies, it will use the latest version of them to build
that particular package.

The workaround to the problem suggest in the last thread by Pradyun
Gedam - pip maintainer - is to use PIP_CONSTRAINT environment variable
and constraint the version of Cython used while installing
the package. Which is precisely what we are doing here.

Note that it does not work if we pass ``--constraint`` option to pip
because it will not be passed to the package being build in isolation.
The fact that the PIP_CONSTRAINT env variable works in the isolation is
a bit of side-effect on how env variables work and that they are passed
to subprocesses as pip launches a subprocess `pip` to build the package.

This is a temporary solution until the issue is resolved in pymssql or
Cython.

Issues/discussions that track it:

* cython/cython#5541
* pymssql/pymssql#827
* https://discuss.python.org/t/no-way-to-pin-build-dependencies/29833

Since we have to change Dockerfile around installing `pip`, also
version of `pip` has been upgraded to latest - 23.2

GitOrigin-RevId: 8e054bb57dd0b29f302872b4500b799c369bde71
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request May 25, 2025
Workaround an issue with installing pymssql on ARM architecture
triggered by Cython 3.0.0 release as of 18 July 2023. The problem is
that pip uses latest Cython to compile pymssql and since we are using
setuptools, there is no easy way to fix version of Cython used to
compile packages.

This triggers a problem with newer `pip` versions that have build
isolation enabled by default because There is no (easy) way to pin build
dependencies for dependent packages. If a package does not have  limit
on build dependencies, it will use the latest version of them to build
that particular package.

The workaround to the problem suggest in the last thread by Pradyun
Gedam - pip maintainer - is to use PIP_CONSTRAINT environment variable
and constraint the version of Cython used while installing
the package. Which is precisely what we are doing here.

Note that it does not work if we pass ``--constraint`` option to pip
because it will not be passed to the package being build in isolation.
The fact that the PIP_CONSTRAINT env variable works in the isolation is
a bit of side-effect on how env variables work and that they are passed
to subprocesses as pip launches a subprocess `pip` to build the package.

This is a temporary solution until the issue is resolved in pymssql or
Cython.

Issues/discussions that track it:

* cython/cython#5541
* pymssql/pymssql#827
* https://discuss.python.org/t/no-way-to-pin-build-dependencies/29833

Since we have to change Dockerfile around installing `pip`, also
version of `pip` has been upgraded to latest - 23.2

GitOrigin-RevId: 8e054bb57dd0b29f302872b4500b799c369bde71
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Sep 20, 2025
Workaround an issue with installing pymssql on ARM architecture
triggered by Cython 3.0.0 release as of 18 July 2023. The problem is
that pip uses latest Cython to compile pymssql and since we are using
setuptools, there is no easy way to fix version of Cython used to
compile packages.

This triggers a problem with newer `pip` versions that have build
isolation enabled by default because There is no (easy) way to pin build
dependencies for dependent packages. If a package does not have  limit
on build dependencies, it will use the latest version of them to build
that particular package.

The workaround to the problem suggest in the last thread by Pradyun
Gedam - pip maintainer - is to use PIP_CONSTRAINT environment variable
and constraint the version of Cython used while installing
the package. Which is precisely what we are doing here.

Note that it does not work if we pass ``--constraint`` option to pip
because it will not be passed to the package being build in isolation.
The fact that the PIP_CONSTRAINT env variable works in the isolation is
a bit of side-effect on how env variables work and that they are passed
to subprocesses as pip launches a subprocess `pip` to build the package.

This is a temporary solution until the issue is resolved in pymssql or
Cython.

Issues/discussions that track it:

* cython/cython#5541
* pymssql/pymssql#827
* https://discuss.python.org/t/no-way-to-pin-build-dependencies/29833

Since we have to change Dockerfile around installing `pip`, also
version of `pip` has been upgraded to latest - 23.2

GitOrigin-RevId: 8e054bb57dd0b29f302872b4500b799c369bde71
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Oct 18, 2025
Workaround an issue with installing pymssql on ARM architecture
triggered by Cython 3.0.0 release as of 18 July 2023. The problem is
that pip uses latest Cython to compile pymssql and since we are using
setuptools, there is no easy way to fix version of Cython used to
compile packages.

This triggers a problem with newer `pip` versions that have build
isolation enabled by default because There is no (easy) way to pin build
dependencies for dependent packages. If a package does not have  limit
on build dependencies, it will use the latest version of them to build
that particular package.

The workaround to the problem suggest in the last thread by Pradyun
Gedam - pip maintainer - is to use PIP_CONSTRAINT environment variable
and constraint the version of Cython used while installing
the package. Which is precisely what we are doing here.

Note that it does not work if we pass ``--constraint`` option to pip
because it will not be passed to the package being build in isolation.
The fact that the PIP_CONSTRAINT env variable works in the isolation is
a bit of side-effect on how env variables work and that they are passed
to subprocesses as pip launches a subprocess `pip` to build the package.

This is a temporary solution until the issue is resolved in pymssql or
Cython.

Issues/discussions that track it:

* cython/cython#5541
* pymssql/pymssql#827
* https://discuss.python.org/t/no-way-to-pin-build-dependencies/29833

Since we have to change Dockerfile around installing `pip`, also
version of `pip` has been upgraded to latest - 23.2

GitOrigin-RevId: 8e054bb57dd0b29f302872b4500b799c369bde71
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Feb 23, 2026
Workaround an issue with installing pymssql on ARM architecture
triggered by Cython 3.0.0 release as of 18 July 2023. The problem is
that pip uses latest Cython to compile pymssql and since we are using
setuptools, there is no easy way to fix version of Cython used to
compile packages.

This triggers a problem with newer `pip` versions that have build
isolation enabled by default because There is no (easy) way to pin build
dependencies for dependent packages. If a package does not have  limit
on build dependencies, it will use the latest version of them to build
that particular package.

The workaround to the problem suggest in the last thread by Pradyun
Gedam - pip maintainer - is to use PIP_CONSTRAINT environment variable
and constraint the version of Cython used while installing
the package. Which is precisely what we are doing here.

Note that it does not work if we pass ``--constraint`` option to pip
because it will not be passed to the package being build in isolation.
The fact that the PIP_CONSTRAINT env variable works in the isolation is
a bit of side-effect on how env variables work and that they are passed
to subprocesses as pip launches a subprocess `pip` to build the package.

This is a temporary solution until the issue is resolved in pymssql or
Cython.

Issues/discussions that track it:

* cython/cython#5541
* pymssql/pymssql#827
* https://discuss.python.org/t/no-way-to-pin-build-dependencies/29833

Since we have to change Dockerfile around installing `pip`, also
version of `pip` has been upgraded to latest - 23.2

GitOrigin-RevId: 8e054bb57dd0b29f302872b4500b799c369bde71
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.

7 participants