<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">This comes from failures seen in SymPy CI:<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1320660371" data-permission-text="Title is private" data-url="https://github.com/sympy/sympy/issues/23847" data-hovercard-type="pull_request" data-hovercard-url="/sympy/sympy/pull/23847/hovercard" href="https://github.com/sympy/sympy/pull/23847">sympy/sympy#23847</a></p>
<p dir="auto">The release of Cython 0.29.31 means that building SciPy from source with pip fails both with the latest release SciPy 1.8.1 and also the main branch.</p>
<p dir="auto">It looks like pyproject.toml on the 1.8.x branch needs to have a better upper bound for the Cython version since it only requires <code class="notranslate">&lt;3.0</code> which does not prevent new releases in Cython's <code class="notranslate">0.29.x</code> series from breaking the build:<br>
</p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/scipy/scipy/blob/b76137f0d4fd82bd74b2e51af33af3ece44e45bc/pyproject.toml#L1-L14">scipy/pyproject.toml</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 1 to 14
      in
      <a data-pjax="true" class="commit-tease-sha" href="/scipy/scipy/commit/b76137f0d4fd82bd74b2e51af33af3ece44e45bc">b76137f</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L1" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1"></td>
          <td id="LC1" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Note that in maintenance branches, all build dependencies should</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2"></td>
          <td id="LC2" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> have an upper bound equal to the most recent already-released version</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L3" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="3"></td>
          <td id="LC3" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> of the dependency. This to prevent that a future backwards-incompatible</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L4" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="4"></td>
          <td id="LC4" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> release will break the source build of a SciPy release.</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L5" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="5"></td>
          <td id="LC5" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> Do accept micro (bug-fix) releases. So for example, if pybind11 2.4.3 is</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L6" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="6"></td>
          <td id="LC6" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> the most recent version on PyPI:</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L7" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="7"></td>
          <td id="LC7" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span></span> </td>
        </tr>

        <tr class="border-0">
          <td id="L8" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="8"></td>
          <td id="LC8" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span>     "pybind11&gt;=2.4.3,&lt;2.5.0",</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L9" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="9"></td>
          <td id="LC9" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">  </td>
        </tr>

        <tr class="border-0">
          <td id="L10" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="10"></td>
          <td id="LC10" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> [<span class="pl-en">build-system</span>] </td>
        </tr>

        <tr class="border-0">
          <td id="L11" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="11"></td>
          <td id="LC11" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-smi">requires</span> = [ </td>
        </tr>

        <tr class="border-0">
          <td id="L12" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="12"></td>
          <td id="LC12" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s"><span class="pl-pds">"</span>wheel&lt;0.38.0<span class="pl-pds">"</span></span>, </td>
        </tr>

        <tr class="border-0">
          <td id="L13" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="13"></td>
          <td id="LC13" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s"><span class="pl-pds">"</span>setuptools&lt;60.0.0<span class="pl-pds">"</span></span>, </td>
        </tr>

        <tr class="border-0">
          <td id="L14" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="14"></td>
          <td id="LC14" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s"><span class="pl-pds">"</span>Cython&gt;=0.29.18,&lt;3.0<span class="pl-pds">"</span></span>, </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<h3 dir="auto">Reproducing Code Example</h3>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ pip install -U pip setuptools wheel cython numpy
Collecting pip
  Downloading pip-22.2.1-py3-none-any.whl (2.0 MB)
     |████████████████████████████████| 2.0 MB 4.8 MB/s 
Collecting setuptools
  Downloading setuptools-63.2.0-py3-none-any.whl (1.2 MB)
     |████████████████████████████████| 1.2 MB 28.2 MB/s 
Collecting wheel
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting cython
  Downloading Cython-0.29.31-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.9 MB)
     |████████████████████████████████| 1.9 MB 2.8 MB/s 
Collecting numpy
  Using cached numpy-1.23.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
Installing collected packages: pip, setuptools, wheel, cython, numpy
  Attempting uninstall: pip
    Found existing installation: pip 20.2.3
    Uninstalling pip-20.2.3:
      Successfully uninstalled pip-20.2.3
  Attempting uninstall: setuptools
    Found existing installation: setuptools 49.2.1
    Uninstalling setuptools-49.2.1:
      Successfully uninstalled setuptools-49.2.1
Successfully installed cython-0.29.31 numpy-1.23.1 pip-22.2.1 setuptools-63.2.0 wheel-0.37.1
$ pip install --no-binary scipy scipy
Collecting scipy
  Downloading scipy-1.8.1.tar.gz (38.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.2/38.2 MB 8.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error"><pre class="notranslate">$ <span class="pl-s1">pip install -U pip setuptools wheel cython numpy</span>
<span class="pl-c1">Collecting pip</span>
<span class="pl-c1">  Downloading pip-22.2.1-py3-none-any.whl (2.0 MB)</span>
<span class="pl-c1">     |████████████████████████████████| 2.0 MB 4.8 MB/s </span>
<span class="pl-c1">Collecting setuptools</span>
<span class="pl-c1">  Downloading setuptools-63.2.0-py3-none-any.whl (1.2 MB)</span>
<span class="pl-c1">     |████████████████████████████████| 1.2 MB 28.2 MB/s </span>
<span class="pl-c1">Collecting wheel</span>
<span class="pl-c1">  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)</span>
<span class="pl-c1">Collecting cython</span>
<span class="pl-c1">  Downloading Cython-0.29.31-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.9 MB)</span>
<span class="pl-c1">     |████████████████████████████████| 1.9 MB 2.8 MB/s </span>
<span class="pl-c1">Collecting numpy</span>
<span class="pl-c1">  Using cached numpy-1.23.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)</span>
<span class="pl-c1">Installing collected packages: pip, setuptools, wheel, cython, numpy</span>
<span class="pl-c1">  Attempting uninstall: pip</span>
<span class="pl-c1">    Found existing installation: pip 20.2.3</span>
<span class="pl-c1">    Uninstalling pip-20.2.3:</span>
<span class="pl-c1">      Successfully uninstalled pip-20.2.3</span>
<span class="pl-c1">  Attempting uninstall: setuptools</span>
<span class="pl-c1">    Found existing installation: setuptools 49.2.1</span>
<span class="pl-c1">    Uninstalling setuptools-49.2.1:</span>
<span class="pl-c1">      Successfully uninstalled setuptools-49.2.1</span>
<span class="pl-c1">Successfully installed cython-0.29.31 numpy-1.23.1 pip-22.2.1 setuptools-63.2.0 wheel-0.37.1</span>
$ <span class="pl-s1">pip install --no-binary scipy scipy</span>
<span class="pl-c1">Collecting scipy</span>
<span class="pl-c1">  Downloading scipy-1.8.1.tar.gz (38.2 MB)</span>
<span class="pl-c1">     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.2/38.2 MB 8.0 MB/s eta 0:00:00</span>
<span class="pl-c1">  Installing build dependencies ... done</span>
<span class="pl-c1">  Getting requirements to build wheel ... done</span>
<span class="pl-c1">  Preparing metadata (pyproject.toml) ... error</span>
<span class="pl-c1">  error: subprocess-exited-with-error</span></pre></div>
<h3 dir="auto">Error message</h3>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ pip install --no-binary scipy scipy
Collecting scipy
  Downloading scipy-1.8.1.tar.gz (38.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.2/38.2 MB 8.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─&gt; [102 lines of output]
      Running scipy/special/_generate_pyx.py
      Running scipy/stats/_generate_pyx.py
      Running scipy/linalg/_generate_pyx.py
      Processing scipy/special/_ufuncs.pyx
      Processing scipy/special/_test_round.pyx
      Processing scipy/special/_ufuncs_cxx.pyx
      Processing scipy/special/_ellip_harm_2.pyx
      Processing scipy/special/cython_special.pyx
      Processing scipy/special/_comb.pyx
      Processing scipy/spatial/_voronoi.pyx
      Processing scipy/spatial/_hausdorff.pyx
      Processing scipy/spatial/_qhull.pyx
      Processing scipy/spatial/_ckdtree.pyx
      Processing scipy/spatial/transform/_rotation.pyx
      Processing scipy/interpolate/_ppoly.pyx
      Processing scipy/interpolate/_bspl.pyx
      Processing scipy/interpolate/interpnd.pyx
      Processing scipy/cluster/_vq.pyx
      Processing scipy/cluster/_hierarchy.pyx
      Processing scipy/cluster/_optimal_leaf_ordering.pyx
      Processing scipy/_lib/messagestream.pyx
      Processing scipy/_lib/_test_deprecation_call.pyx
      Processing scipy/_lib/_test_deprecation_def.pyx
      Processing scipy/_lib/_ccallback_c.pyx
      Processing scipy/signal/_upfirdn_apply.pyx
      Processing scipy/signal/_max_len_seq_inner.pyx
      Processing scipy/signal/_sosfilt.pyx
      Processing scipy/signal/_spectral.pyx
      Processing scipy/signal/_peak_finding_utils.pyx
      Processing scipy/io/matlab/_streams.pyx
      Processing scipy/io/matlab/_mio5_utils.pyx
      Processing scipy/io/matlab/_mio_utils.pyx
      Processing scipy/stats/_stats.pyx
      Processing scipy/stats/_qmc_cy.pyx
      Processing scipy/stats/_biasedurn.pyx
      Processing scipy/stats/_sobol.pyx
      Processing scipy/stats/_boost/src/nbinom_ufunc.pyx
      Processing scipy/stats/_boost/src/beta_ufunc.pyx
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          return np.array(result, dtype=np.int64)
      
      
      @cython.wraparound(False)
      @cython.boundscheck(False)
      def _weightedrankedtau(ordered[:] x, ordered[:] y, intp_t[:] rank, weigher, bool additive):
      ^
      ------------------------------------------------------------
      
      _stats.pyx:173:0: Referring to a memoryview typed argument directly in a nested closure function is not supported in Cython 0.x. Either upgrade to Cython 3, or assign the argument to a local variable and use that in the nested function.
      Processing scipy/stats/_boost/src/binom_ufunc.pyx
      Traceback (most recent call last):
        File &quot;/tmp/pip-install-wnazhy0r/scipy_3ee8a876e4f54aa7bfa3d9fdba592754/tools/cythonize.py&quot;, line 317, in &lt;module&gt;
          main()
        File &quot;/tmp/pip-install-wnazhy0r/scipy_3ee8a876e4f54aa7bfa3d9fdba592754/tools/cythonize.py&quot;, line 313, in main
          find_process_files(root_dir)
        File &quot;/tmp/pip-install-wnazhy0r/scipy_3ee8a876e4f54aa7bfa3d9fdba592754/tools/cythonize.py&quot;, line 302, in find_process_files
          for result in pool.imap_unordered(lambda args: process(*args), jobs):
        File &quot;/usr/lib/python3.8/multiprocessing/pool.py&quot;, line 868, in next
          raise value
        File &quot;/usr/lib/python3.8/multiprocessing/pool.py&quot;, line 125, in worker
          result = (True, func(*args, **kwds))
        File &quot;/tmp/pip-install-wnazhy0r/scipy_3ee8a876e4f54aa7bfa3d9fdba592754/tools/cythonize.py&quot;, line 302, in &lt;lambda&gt;
          for result in pool.imap_unordered(lambda args: process(*args), jobs):
        File &quot;/tmp/pip-install-wnazhy0r/scipy_3ee8a876e4f54aa7bfa3d9fdba592754/tools/cythonize.py&quot;, line 236, in process
          processor_function(fromfile, tofile, cwd=path)
        File &quot;/tmp/pip-install-wnazhy0r/scipy_3ee8a876e4f54aa7bfa3d9fdba592754/tools/cythonize.py&quot;, line 102, in process_pyx
          raise Exception('Cython failed')
      Exception: Cython failed
      setup.py:486: UserWarning: Unrecognized setuptools command ('dist_info --egg-base /tmp/pip-modern-metadata-tcs7khbn'), proceeding with generating Cython sources and expanding templates
        warnings.warn(&quot;Unrecognized setuptools command ('{}'), proceeding with &quot;
      Running from SciPy source directory.
      Cythonizing sources
      Traceback (most recent call last):
        File &quot;setup.py&quot;, line 350, in generate_cython
          import pip
      ModuleNotFoundError: No module named 'pip'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File &quot;/home/oscar/current/sympy/sympy.git/tmpvenv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py&quot;, line 363, in &lt;module&gt;
          main()
        File &quot;/home/oscar/current/sympy/sympy.git/tmpvenv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py&quot;, line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File &quot;/home/oscar/current/sympy/sympy.git/tmpvenv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py&quot;, line 164, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File &quot;/tmp/pip-build-env-nvuzm8iv/overlay/lib/python3.8/site-packages/setuptools/build_meta.py&quot;, line 174, in prepare_metadata_for_build_wheel
          self.run_setup()
        File &quot;/tmp/pip-build-env-nvuzm8iv/overlay/lib/python3.8/site-packages/setuptools/build_meta.py&quot;, line 267, in run_setup
          super(_BuildMetaLegacyBackend,
        File &quot;/tmp/pip-build-env-nvuzm8iv/overlay/lib/python3.8/site-packages/setuptools/build_meta.py&quot;, line 158, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File &quot;setup.py&quot;, line 628, in &lt;module&gt;
          setup_package()
        File &quot;setup.py&quot;, line 612, in setup_package
          generate_cython()
        File &quot;setup.py&quot;, line 352, in generate_cython
          raise RuntimeError(&quot;Running cythonize failed!&quot;)
      RuntimeError: Running cythonize failed!
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─&gt; See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details."><pre class="notranslate">$ <span class="pl-s1">pip install --no-binary scipy scipy</span>
<span class="pl-c1">Collecting scipy</span>
<span class="pl-c1">  Downloading scipy-1.8.1.tar.gz (38.2 MB)</span>
<span class="pl-c1">     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.2/38.2 MB 8.0 MB/s eta 0:00:00</span>
<span class="pl-c1">  Installing build dependencies ... done</span>
<span class="pl-c1">  Getting requirements to build wheel ... done</span>
<span class="pl-c1">  Preparing metadata (pyproject.toml) ... error</span>
<span class="pl-c1">  error: subprocess-exited-with-error</span>
<span class="pl-c1">  </span>
<span class="pl-c1">  × Preparing metadata (pyproject.toml) did not run successfully.</span>
<span class="pl-c1">  │ exit code: 1</span>
<span class="pl-c1">  ╰─&gt; [102 lines of output]</span>
<span class="pl-c1">      Running scipy/special/_generate_pyx.py</span>
<span class="pl-c1">      Running scipy/stats/_generate_pyx.py</span>
<span class="pl-c1">      Running scipy/linalg/_generate_pyx.py</span>
<span class="pl-c1">      Processing scipy/special/_ufuncs.pyx</span>
<span class="pl-c1">      Processing scipy/special/_test_round.pyx</span>
<span class="pl-c1">      Processing scipy/special/_ufuncs_cxx.pyx</span>
<span class="pl-c1">      Processing scipy/special/_ellip_harm_2.pyx</span>
<span class="pl-c1">      Processing scipy/special/cython_special.pyx</span>
<span class="pl-c1">      Processing scipy/special/_comb.pyx</span>
<span class="pl-c1">      Processing scipy/spatial/_voronoi.pyx</span>
<span class="pl-c1">      Processing scipy/spatial/_hausdorff.pyx</span>
<span class="pl-c1">      Processing scipy/spatial/_qhull.pyx</span>
<span class="pl-c1">      Processing scipy/spatial/_ckdtree.pyx</span>
<span class="pl-c1">      Processing scipy/spatial/transform/_rotation.pyx</span>
<span class="pl-c1">      Processing scipy/interpolate/_ppoly.pyx</span>
<span class="pl-c1">      Processing scipy/interpolate/_bspl.pyx</span>
<span class="pl-c1">      Processing scipy/interpolate/interpnd.pyx</span>
<span class="pl-c1">      Processing scipy/cluster/_vq.pyx</span>
<span class="pl-c1">      Processing scipy/cluster/_hierarchy.pyx</span>
<span class="pl-c1">      Processing scipy/cluster/_optimal_leaf_ordering.pyx</span>
<span class="pl-c1">      Processing scipy/_lib/messagestream.pyx</span>
<span class="pl-c1">      Processing scipy/_lib/_test_deprecation_call.pyx</span>
<span class="pl-c1">      Processing scipy/_lib/_test_deprecation_def.pyx</span>
<span class="pl-c1">      Processing scipy/_lib/_ccallback_c.pyx</span>
<span class="pl-c1">      Processing scipy/signal/_upfirdn_apply.pyx</span>
<span class="pl-c1">      Processing scipy/signal/_max_len_seq_inner.pyx</span>
<span class="pl-c1">      Processing scipy/signal/_sosfilt.pyx</span>
<span class="pl-c1">      Processing scipy/signal/_spectral.pyx</span>
<span class="pl-c1">      Processing scipy/signal/_peak_finding_utils.pyx</span>
<span class="pl-c1">      Processing scipy/io/matlab/_streams.pyx</span>
<span class="pl-c1">      Processing scipy/io/matlab/_mio5_utils.pyx</span>
<span class="pl-c1">      Processing scipy/io/matlab/_mio_utils.pyx</span>
<span class="pl-c1">      Processing scipy/stats/_stats.pyx</span>
<span class="pl-c1">      Processing scipy/stats/_qmc_cy.pyx</span>
<span class="pl-c1">      Processing scipy/stats/_biasedurn.pyx</span>
<span class="pl-c1">      Processing scipy/stats/_sobol.pyx</span>
<span class="pl-c1">      Processing scipy/stats/_boost/src/nbinom_ufunc.pyx</span>
<span class="pl-c1">      Processing scipy/stats/_boost/src/beta_ufunc.pyx</span>
<span class="pl-c1">      </span>
<span class="pl-c1">      Error compiling Cython file:</span>
<span class="pl-c1">      ------------------------------------------------------------</span>
<span class="pl-c1">      ...</span>
<span class="pl-c1">          return np.array(result, dtype=np.int64)</span>
<span class="pl-c1">      </span>
<span class="pl-c1">      </span>
<span class="pl-c1">      @cython.wraparound(False)</span>
<span class="pl-c1">      @cython.boundscheck(False)</span>
<span class="pl-c1">      def _weightedrankedtau(ordered[:] x, ordered[:] y, intp_t[:] rank, weigher, bool additive):</span>
<span class="pl-c1">      ^</span>
<span class="pl-c1">      ------------------------------------------------------------</span>
<span class="pl-c1">      </span>
<span class="pl-c1">      _stats.pyx:173:0: Referring to a memoryview typed argument directly in a nested closure function is not supported in Cython 0.x. Either upgrade to Cython 3, or assign the argument to a local variable and use that in the nested function.</span>
<span class="pl-c1">      Processing scipy/stats/_boost/src/binom_ufunc.pyx</span>
<span class="pl-c1">      Traceback (most recent call last):</span>
<span class="pl-c1">        File "/tmp/pip-install-wnazhy0r/scipy_3ee8a876e4f54aa7bfa3d9fdba592754/tools/cythonize.py", line 317, in &lt;module&gt;</span>
<span class="pl-c1">          main()</span>
<span class="pl-c1">        File "/tmp/pip-install-wnazhy0r/scipy_3ee8a876e4f54aa7bfa3d9fdba592754/tools/cythonize.py", line 313, in main</span>
<span class="pl-c1">          find_process_files(root_dir)</span>
<span class="pl-c1">        File "/tmp/pip-install-wnazhy0r/scipy_3ee8a876e4f54aa7bfa3d9fdba592754/tools/cythonize.py", line 302, in find_process_files</span>
<span class="pl-c1">          for result in pool.imap_unordered(lambda args: process(*args), jobs):</span>
<span class="pl-c1">        File "/usr/lib/python3.8/multiprocessing/pool.py", line 868, in next</span>
<span class="pl-c1">          raise value</span>
<span class="pl-c1">        File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker</span>
<span class="pl-c1">          result = (True, func(*args, **kwds))</span>
<span class="pl-c1">        File "/tmp/pip-install-wnazhy0r/scipy_3ee8a876e4f54aa7bfa3d9fdba592754/tools/cythonize.py", line 302, in &lt;lambda&gt;</span>
<span class="pl-c1">          for result in pool.imap_unordered(lambda args: process(*args), jobs):</span>
<span class="pl-c1">        File "/tmp/pip-install-wnazhy0r/scipy_3ee8a876e4f54aa7bfa3d9fdba592754/tools/cythonize.py", line 236, in process</span>
<span class="pl-c1">          processor_function(fromfile, tofile, cwd=path)</span>
<span class="pl-c1">        File "/tmp/pip-install-wnazhy0r/scipy_3ee8a876e4f54aa7bfa3d9fdba592754/tools/cythonize.py", line 102, in process_pyx</span>
<span class="pl-c1">          raise Exception('Cython failed')</span>
<span class="pl-c1">      Exception: Cython failed</span>
<span class="pl-c1">      setup.py:486: UserWarning: Unrecognized setuptools command ('dist_info --egg-base /tmp/pip-modern-metadata-tcs7khbn'), proceeding with generating Cython sources and expanding templates</span>
<span class="pl-c1">        warnings.warn("Unrecognized setuptools command ('{}'), proceeding with "</span>
<span class="pl-c1">      Running from SciPy source directory.</span>
<span class="pl-c1">      Cythonizing sources</span>
<span class="pl-c1">      Traceback (most recent call last):</span>
<span class="pl-c1">        File "setup.py", line 350, in generate_cython</span>
<span class="pl-c1">          import pip</span>
<span class="pl-c1">      ModuleNotFoundError: No module named 'pip'</span>
<span class="pl-c1">      </span>
<span class="pl-c1">      During handling of the above exception, another exception occurred:</span>
<span class="pl-c1">      </span>
<span class="pl-c1">      Traceback (most recent call last):</span>
<span class="pl-c1">        File "/home/oscar/current/sympy/sympy.git/tmpvenv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in &lt;module&gt;</span>
<span class="pl-c1">          main()</span>
<span class="pl-c1">        File "/home/oscar/current/sympy/sympy.git/tmpvenv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main</span>
<span class="pl-c1">          json_out['return_val'] = hook(**hook_input['kwargs'])</span>
<span class="pl-c1">        File "/home/oscar/current/sympy/sympy.git/tmpvenv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel</span>
<span class="pl-c1">          return hook(metadata_directory, config_settings)</span>
<span class="pl-c1">        File "/tmp/pip-build-env-nvuzm8iv/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 174, in prepare_metadata_for_build_wheel</span>
<span class="pl-c1">          self.run_setup()</span>
<span class="pl-c1">        File "/tmp/pip-build-env-nvuzm8iv/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 267, in run_setup</span>
<span class="pl-c1">          super(_BuildMetaLegacyBackend,</span>
<span class="pl-c1">        File "/tmp/pip-build-env-nvuzm8iv/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 158, in run_setup</span>
<span class="pl-c1">          exec(compile(code, __file__, 'exec'), locals())</span>
<span class="pl-c1">        File "setup.py", line 628, in &lt;module&gt;</span>
<span class="pl-c1">          setup_package()</span>
<span class="pl-c1">        File "setup.py", line 612, in setup_package</span>
<span class="pl-c1">          generate_cython()</span>
<span class="pl-c1">        File "setup.py", line 352, in generate_cython</span>
<span class="pl-c1">          raise RuntimeError("Running cythonize failed!")</span>
<span class="pl-c1">      RuntimeError: Running cythonize failed!</span>
<span class="pl-c1">      [end of output]</span>
<span class="pl-c1">  </span>
<span class="pl-c1">  note: This error originates from a subprocess, and is likely not a problem with pip.</span>
<span class="pl-c1">error: metadata-generation-failed</span>

<span class="pl-c1">× Encountered error while generating package metadata.</span>
<span class="pl-c1">╰─&gt; See above for output.</span>

<span class="pl-c1">note: This is an issue with the package mentioned above, not pip.</span>
<span class="pl-c1">hint: See above for details.</span></pre></div>
<h3 dir="auto">SciPy/NumPy/Python version information</h3>
<p dir="auto">SciPy 1.8.1 and current main, numpy 1.23.1, Any version of Python or PyPy (I think), Cython 0.29.31</p>
<p dir="auto">Cython 0.29.31 was release a few hours ago and it corresponds to our CI going red.</p>
<p dir="auto"><a href="https://github.com/cython/cython/releases/tag/0.29.31">https://github.com/cython/cython/releases/tag/0.29.31</a></p>
<p dir="auto">See for instance: <a href="https://github.com/scipy/scipy/runs/7551272609?check_suite_focus=true">https://github.com/scipy/scipy/runs/7551272609?check_suite_focus=true</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Error compiling Cython file:
1453
------------------------------------------------------------
1454
...
1455
    return np.array(result, dtype=np.int64)
1456

1457

1458
@cython.wraparound(False)
1459
@cython.boundscheck(False)
1460
def _weightedrankedtau(ordered[:] x, ordered[:] y, intp_t[:] rank, weigher, bool additive):
1461
^
1462
------------------------------------------------------------
1463

1464
_stats.pyx:173:0: Referring to a memoryview typed argument directly in a nested closure function is not supported in Cython 0.x. Either upgrade to Cython 3, or assign the argument to a local variable and use that in the nested function."><pre class="notranslate"><code class="notranslate">Error compiling Cython file:
1453
------------------------------------------------------------
1454
...
1455
    return np.array(result, dtype=np.int64)
1456

1457

1458
@cython.wraparound(False)
1459
@cython.boundscheck(False)
1460
def _weightedrankedtau(ordered[:] x, ordered[:] y, intp_t[:] rank, weigher, bool additive):
1461
^
1462
------------------------------------------------------------
1463

1464
_stats.pyx:173:0: Referring to a memoryview typed argument directly in a nested closure function is not supported in Cython 0.x. Either upgrade to Cython 3, or assign the argument to a local variable and use that in the nested function.
</code></pre></div>