Meson 和 distutils 的工作方式#

旧工作流(基于 numpy.distutils)

runtests.py 文件已在提交 0f73f92255253ec5dff2de5ca45d8d3bdda03f92 [^1^_] 中移除。

  1. python runtests.py

  2. python setup.py build_ext -i + export PYTHONPATH=/home/username/path/to/scipy/reporoot(然后编辑 SciPy 中的纯 Python 代码并使用 python some_script.py 运行它)。

  3. python setup.py develop - 这与 (2) 类似,不同之处在于就地构建在环境中永久可见。

  4. python setup.py bdist_wheel + pip install dist/scipy*.whl - 在当前环境中构建 wheel (即使用已安装的 numpy 等) 并安装它。

  5. pip install . - 在隔离的构建环境中,根据 pyproject.toml 中的依赖项构建 wheel 并安装它。注意:请小心,这通常不是开发安装的正确命令——通常您会希望使用 (4) 或 pip install . -v --no-build-isolation

新工作流(基于 Meson 和 meson-python)

  1. python dev.py

  2. pip install -e . --no-build-isolation(参见 meson-python 文档)

  3. 与 (2) 相同

  4. python -m build --no-isolation + pip install dist/scipy*.whl - 参见 pypa/build

  5. pip install .

[^1^_]: [GitHub 上的提交 0f73f92255253ec5dff2de5ca45d8d3bdda03f92](scipy/scipy)。