Meson 與 distutils 的做事方式#

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

  1. python runtests.py

  2. python setup.py build_ext -i + export PYTHONPATH=/home/username/path/to/numpy/reporoot (然後編輯 NumPy 中的純 Python 程式碼,並使用 python some_script.py 執行它)。

  3. python setup.py develop - 這與 (2) 類似,只是就地建置在環境中永久可見。

  4. python setup.py bdist_wheel + pip install dist/numpy*.whl - 在目前環境中建置 wheel 並安裝它。

  5. pip install . - 在隔離的建置環境中針對 pyproject.toml 中的依賴項建置 wheel 並安裝它。 *注意:請小心,這通常不是用於開發安裝的正確命令 - 通常您會想使用 (4) 或* pip install . -v --no-build-isolation

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

  1. spin test

  2. pip install -e . --no-build-isolation (注意:僅適用於處理 NumPy 本身 - 更多詳細資訊,請參閱 IDE support & editable installs)

  3. 與 (2) 相同

  4. python -m build --no-isolation + pip install dist/numpy*.whl - 請參閱 pypa/build

  5. pip install .