Meson 與 distutils 的做事方式#

舊的工作流程 (基於 numpy.distutils)

runtests.py 檔案已在 commit 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 上的 Commit 0f73f92255253ec5dff2de5ca45d8d3bdda03f92](scipy/scipy)。