Skip to content

Commit

Permalink
Bump cython in cmake (#19473)
Browse files Browse the repository at this point in the history
* Bump cython in cmake

* Remove the check altogether

* Debug fix

* Updtae docs req

* Add separate cython installation

* Correct python3

* debug

* Add python3-venv package

* Remove source

* Debug

* debug

* pip install flag

* Debug

* Debug

* debug

* debug

* Debug

---------

Co-authored-by: Artyom Anokhov <[email protected]>
  • Loading branch information
p-wysocki and artanokhov authored Aug 29, 2023
1 parent f9c0e96 commit 35a1840
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
10 changes: 8 additions & 2 deletions .ci/openvino-onnx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@ RUN apt-get update && apt-get -y --no-install-recommends install \
python3-dev \
pybind11-dev \
python3-virtualenv \
cython3 \
python3-venv \
tox && \
apt-get clean autoclean && \
apt-get autoremove -y

RUN python3 -m venv ~/.venv
RUN . ~/.venv/bin/activate
RUN which python3
RUN python3 -m pip install "cython>=3.0.0" --break-system-packages

# Build OpenVINO
COPY . /openvino/
WORKDIR /openvino/build
Expand All @@ -65,7 +70,8 @@ RUN cmake .. \
-DENABLE_OV_PYTORCH_FRONTEND=ON \
-DENABLE_OV_TF_FRONTEND=OFF \
-DENABLE_OPENVINO_DEBUG=OFF \
-DCMAKE_INSTALL_PREFIX=/openvino/dist
-DCMAKE_INSTALL_PREFIX=/openvino/dist \
-DPYTHON_EXECUTABLE=`which python3`
RUN ninja install

# Run tests via tox
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Babel==2.11.0
beautifulsoup4==4.9.3
certifi==2023.7.22
colorama==0.4.6
Cython==0.29.33
Cython==3.0.2
docutils==0.16
idna==3.4
imagesize==1.2.0
Expand Down
13 changes: 7 additions & 6 deletions src/bindings/python/src/compatibility/openvino/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ endif()

include (cmake/UseCython.cmake)

# Check Cython version
if(CYTHON_VERSION VERSION_LESS "0.29")
message(FATAL_ERROR "OpenVINO Python API needs at least Cython version 0.29, found version ${CYTHON_VERSION}")
else()
message(STATUS "Found Cython version ${CYTHON_VERSION}")
endif()
# TODO: Reenable once Windows issue is resolved
# # Check Cython version
# if(CYTHON_VERSION VERSION_LESS "3.0.0")
# message(FATAL_ERROR "OpenVINO Python API needs at least Cython version 3.0.0, found version ${CYTHON_VERSION}")
# else()
# message(STATUS "Found Cython version ${CYTHON_VERSION}")
# endif()

set(pyversion python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ include( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( Cython REQUIRED_VARS CYTHON_EXECUTABLE )

# Find Cython version
execute_process(COMMAND ${CYTHON_EXECUTABLE} -V ERROR_VARIABLE CYTHON_OUTPUT OUTPUT_QUIET)
execute_process(COMMAND ${CYTHON_EXECUTABLE} -V ERROR_VARIABLE CYTHON_OUTPUT)
string(REGEX REPLACE "^Cython version ([0-9]+\\.[0-9]+(\\.[0-9]+)?).*" "\\1" CYTHON_VERSION "${CYTHON_OUTPUT}")

mark_as_advanced( CYTHON_EXECUTABLE CYTHON_VERSION )
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cython>=0.29.32
Cython>=3.0.0

0 comments on commit 35a1840

Please sign in to comment.