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 . - 在隔离的构建环境中构建 wheel,依赖于 pyproject.toml 中的依赖项,并安装它。注意:小心使用,这通常不是开发安装的正确命令 - 通常您需要使用 (4) 或 pip install . -v --no-build-isolation

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

  1. spin

  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 .