Cannot install scikit-learn==1.0.2 with poetry toml file

### Describe the bug

I am using a poetry.toml file to install the dependencies of my package. But when trying to install scikit-learn==1.0.2, it fails.

 Below is my poetry.toml file:

```
[tool.poetry]
name = "sample"
version = "0.1.0"
description = ""

[tool.poetry.dependencies]
python = ">=3.11,<3.12"
pandas = "1.1.5"
scikit-learn = "1.0.2"
xlrd = "1.2.0"
openpyxl = "3.0.4"

[tool.poetry.dev-dependencies]
pytest = "^5.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
```


### Steps/Code to Reproduce

So I have created a conda environement for python-3.11 env and then installed the dependencies, the following are the steps:

```
conda create -n 3.11 python=3.11
conda activate 3.11
pip install poetry==1.4.2
poetry install 
```


### Expected Results

No error is thrown and the dependencies are installed

### Actual Results

```

          n_class = get_nr(model)
          n_class = n_class * (n_class - 1) // 2
  
      dec_values = np.empty((T_indptr.shape[0] - 1, n_class), dtype=np.float64)
      cdef BlasFunctions blas_functions
      blas_functions.dot = _dot[double]
                               ^
  ------------------------------------------------------------
  
  sklearn/svm/_libsvm_sparse.pyx:412:29: Cannot assign type 'double (int, double *, int, double *, int) except * nogil' to 'dot_func'
  Traceback (most recent call last):
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
      return cythonize_one(*m)
             ^^^^^^^^^^^^^^^^^
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: sklearn/svm/_libsvm_sparse.pyx
  warning: sklearn/tree/_criterion.pxd:57:45: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:58:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:59:48: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:60:57: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pxd:61:73: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pxd:62:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pxd:63:63: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pxd:84:72: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pxd:89:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:57:45: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:82:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:89:48: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:96:57: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:278:76: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:344:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:371:48: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:398:57: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:740:45: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:784:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:795:48: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:806:57: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:1028:45: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:1078:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:1109:48: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pyx:1137:57: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:49:75: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:87:61: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:119:56: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:137:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:139:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:160:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:161:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:72:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:91:51: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:94:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:95:63: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:96:80: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pxd:84:72: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pxd:89:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:57:45: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:58:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:59:48: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:60:57: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pxd:61:73: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pxd:62:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pxd:63:63: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pyx:180:72: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pyx:210:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pyx:264:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pyx:578:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pyx:1096:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pyx:1326:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:49:75: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:87:61: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:119:56: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:137:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:139:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:160:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:161:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:72:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:91:51: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:94:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:95:63: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:96:80: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      if not is_samples_sorted[0]:
          n_samples = end - start
          memcpy(sorted_samples + start, samples + start,
                 n_samples * sizeof(SIZE_t))
          qsort(sorted_samples + start, n_samples, sizeof(SIZE_t),
                compare_SIZE_t)
                ^
  ------------------------------------------------------------
  
  sklearn/tree/_splitter.pyx:1033:14: Cannot assign type 'int (const void *, const void *) except? -1 nogil' to 'int (*)(const void *, const void *) noexcept nogil'
  Traceback (most recent call last):
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
      return cythonize_one(*m)
             ^^^^^^^^^^^^^^^^^
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: sklearn/tree/_splitter.pyx
  warning: sklearn/tree/_tree.pxd:61:73: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pxd:62:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pxd:63:63: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pxd:84:72: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pxd:89:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:57:45: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:58:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:59:48: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:60:57: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pyx:267:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pyx:414:76: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pyx:668:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pyx:680:70: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pyx:714:73: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:49:75: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:87:61: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:119:56: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:137:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:139:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:160:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:161:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:72:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:91:51: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:94:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:95:63: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:96:80: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  
          # Initial capacity
          cdef int init_capacity
  
          if tree.max_depth <= 10:
              init_capacity = (2 ** (tree.max_depth + 1)) - 1
                                                          ^
  ------------------------------------------------------------
  
  sklearn/tree/_tree.pyx:146:56: Cannot assign type 'double' to 'int'
  Traceback (most recent call last):
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
      return cythonize_one(*m)
             ^^^^^^^^^^^^^^^^^
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: sklearn/tree/_tree.pyx
  warning: sklearn/tree/_utils.pxd:49:75: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:87:61: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:119:56: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:137:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:139:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:160:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pxd:161:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pxd:61:73: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pxd:62:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_tree.pxd:63:63: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pxd:84:72: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_splitter.pxd:89:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:57:45: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:58:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:59:48: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_criterion.pxd:60:57: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:72:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:91:51: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:94:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:95:63: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/neighbors/_quad_tree.pxd:96:80: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pyx:25:75: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pyx:110:61: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pyx:226:56: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pyx:314:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pyx:331:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pyx:489:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: sklearn/tree/_utils.pyx:503:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
          dec(end)
          # Construct our arguments
          cdef pair[ITYPE_t, DTYPE_t] args
          args.first = key
          args.second = value
          self.my_map.insert(end, args)
                             ^
  ------------------------------------------------------------
  
  sklearn/utils/_fast_dict.pyx:136:27: Cannot assign type 'iterator' to 'const_iterator'
  Traceback (most recent call last):
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
      return cythonize_one(*m)
             ^^^^^^^^^^^^^^^^^
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: sklearn/utils/_fast_dict.pyx
  warning: sklearn/utils/_openmp_helpers.pyx:1: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: sklearn/utils/_openmp_helpers.pyx:44: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
  multiprocessing.pool.RemoteTraceback: 
  """
  Traceback (most recent call last):
    File "/home/albint/miniconda3/envs/3.11/lib/python3.11/multiprocessing/pool.py", line 125, in worker
      result = (True, func(*args, **kwds))
                      ^^^^^^^^^^^^^^^^^^^
    File "/home/albint/miniconda3/envs/3.11/lib/python3.11/multiprocessing/pool.py", line 48, in mapstar
      return list(map(*args))
             ^^^^^^^^^^^^^^^^
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
      return cythonize_one(*m)
             ^^^^^^^^^^^^^^^^^
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: sklearn/ensemble/_hist_gradient_boosting/splitting.pyx
  """
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "/home/albint/miniconda3/envs/3.11/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
  [ 1/55] Cythonizing sklearn/__check_build/_check_build.pyx
  [ 2/55] Cythonizing sklearn/_isotonic.pyx
  [ 3/55] Cythonizing sklearn/cluster/_dbscan_inner.pyx
  [ 4/55] Cythonizing sklearn/cluster/_hierarchical_fast.pyx
  [ 5/55] Cythonizing sklearn/cluster/_k_means_common.pyx
  [ 6/55] Cythonizing sklearn/cluster/_k_means_elkan.pyx
  [ 7/55] Cythonizing sklearn/cluster/_k_means_lloyd.pyx
  [ 8/55] Cythonizing sklearn/cluster/_k_means_minibatch.pyx
  [ 9/55] Cythonizing sklearn/datasets/_svmlight_format_fast.pyx
  [10/55] Cythonizing sklearn/decomposition/_cdnmf_fast.pyx
  [11/55] Cythonizing sklearn/decomposition/_online_lda_fast.pyx
  [12/55] Cythonizing sklearn/ensemble/_gradient_boosting.pyx
  [13/55] Cythonizing sklearn/ensemble/_hist_gradient_boosting/_binning.pyx
  [14/55] Cythonizing sklearn/ensemble/_hist_gradient_boosting/_bitset.pyx
  [15/55] Cythonizing sklearn/ensemble/_hist_gradient_boosting/_gradient_boosting.pyx
  [16/55] Cythonizing sklearn/ensemble/_hist_gradient_boosting/_loss.pyx
  [17/55] Cythonizing sklearn/ensemble/_hist_gradient_boosting/_predictor.pyx
  [18/55] Cythonizing sklearn/ensemble/_hist_gradient_boosting/common.pyx
  [19/55] Cythonizing sklearn/ensemble/_hist_gradient_boosting/histogram.pyx
  [20/55] Cythonizing sklearn/ensemble/_hist_gradient_boosting/splitting.pyx
  [21/55] Cythonizing sklearn/ensemble/_hist_gradient_boosting/utils.pyx
  [22/55] Cythonizing sklearn/feature_extraction/_hashing_fast.pyx
  [23/55] Cythonizing sklearn/linear_model/_cd_fast.pyx
  [24/55] Cythonizing sklearn/linear_model/_sag_fast.pyx
  [25/55] Cythonizing sklearn/linear_model/_sgd_fast.pyx
  [26/55] Cythonizing sklearn/manifold/_barnes_hut_tsne.pyx
  [27/55] Cythonizing sklearn/manifold/_utils.pyx
  [28/55] Cythonizing sklearn/metrics/_dist_metrics.pyx
  [29/55] Cythonizing sklearn/metrics/_pairwise_fast.pyx
  [30/55] Cythonizing sklearn/metrics/cluster/_expected_mutual_info_fast.pyx
  [31/55] Cythonizing sklearn/neighbors/_ball_tree.pyx
  [32/55] Cythonizing sklearn/neighbors/_kd_tree.pyx
  [33/55] Cythonizing sklearn/neighbors/_partition_nodes.pyx
  [34/55] Cythonizing sklearn/neighbors/_quad_tree.pyx
  [35/55] Cythonizing sklearn/preprocessing/_csr_polynomial_expansion.pyx
  [36/55] Cythonizing sklearn/svm/_liblinear.pyx
  [37/55] Cythonizing sklearn/svm/_libsvm.pyx
  [38/55] Cythonizing sklearn/svm/_libsvm_sparse.pyx
  [39/55] Cythonizing sklearn/svm/_newrand.pyx
  [40/55] Cythonizing sklearn/tree/_criterion.pyx
  [41/55] Cythonizing sklearn/tree/_splitter.pyx
  [42/55] Cythonizing sklearn/tree/_tree.pyx
  [43/55] Cythonizing sklearn/tree/_utils.pyx
  [44/55] Cythonizing sklearn/utils/_cython_blas.pyx
  [45/55] Cythonizing sklearn/utils/_fast_dict.pyx
  [46/55] Cythonizing sklearn/utils/_logistic_sigmoid.pyx
  [47/55] Cythonizing sklearn/utils/_openmp_helpers.pyx
  [48/55] Cythonizing sklearn/utils/_random.pyx
  [49/55] Cythonizing sklearn/utils/_readonly_array_wrapper.pyx
  [50/55] Cythonizing sklearn/utils/_seq_dataset.pyx
  [51/55] Cythonizing sklearn/utils/_typedefs.pyx
  [52/55] Cythonizing sklearn/utils/_weight_vector.pyx
  [53/55] Cythonizing sklearn/utils/arrayfuncs.pyx
  [54/55] Cythonizing sklearn/utils/murmurhash.pyx
  [55/55] Cythonizing sklearn/utils/sparsefuncs_fast.pyx
      main()
    File "/home/albint/miniconda3/envs/3.11/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/albint/miniconda3/envs/3.11/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 230, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 268, in run_setup
      self).run_setup(setup_script=setup_script)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 158, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 319, in <module>
      setup_package()
    File "setup.py", line 315, in setup_package
      setup(**metadata)
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/numpy/distutils/core.py", line 135, in setup
      config = configuration()
               ^^^^^^^^^^^^^^^
    File "setup.py", line 201, in configuration
      config.add_subpackage("sklearn")
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/numpy/distutils/misc_util.py", line 1050, in add_subpackage
      config_list = self.get_subpackage(subpackage_name, subpackage_path,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/numpy/distutils/misc_util.py", line 1016, in get_subpackage
      config = self._get_configuration_from_setup_py(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/numpy/distutils/misc_util.py", line 958, in _get_configuration_from_setup_py
      config = setup_module.configuration(*args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmpe5pgqo_b/scikit-learn-1.0.2/sklearn/setup.py", line 85, in configuration
      cythonize_extensions(top_path, config)
    File "/tmp/tmpe5pgqo_b/scikit-learn-1.0.2/sklearn/_build_utils/__init__.py", line 78, in cythonize_extensions
      config.ext_modules = cythonize(
                           ^^^^^^^^^^
    File "/tmp/tmprjb2urui/.venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1125, in cythonize
      result.get(99999)  # seconds
      ^^^^^^^^^^^^^^^^^
    File "/home/albint/miniconda3/envs/3.11/lib/python3.11/multiprocessing/pool.py", line 774, in get
      raise self._value
  Cython.Compiler.Errors.CompileError: sklearn/ensemble/_hist_gradient_boosting/splitting.pyx
  

  at ~/miniconda3/envs/3.11/lib/python3.11/site-packages/poetry/installation/chef.py:152 in _prepare
      148│ 
      149│                 error = ChefBuildError("\n\n".join(message_parts))
      150│ 
      151│             if error is not None:
    → 152│                 raise error from None
      153│ 
      154│             return path
      155│ 
      156│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with scikit-learn (1.0.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "scikit-learn (==1.0.2)"'.

```

### Versions

```shell
Not able to run the command. 
python=3.11
```

COMMENT:
There are no wheels for Python 3.11 for scikit-learn==1.0.2, which means you are building scikit-learn from source. You have two options:

- Downgrading to Python 3.9 to use scikit-learn==1.0.2. (Python 3.9 was the newest Python when scikit-learn==1.0.2 was released)
- Upgrade to scikit-learn==1.3 to use Python 3.11

Labels: Bug, Needs Triage