Meson 與 distutils
的做事方式#
舊工作流程 (基於 numpy.distutils)
python runtests.py
python setup.py build_ext -i
+export PYTHONPATH=/home/username/path/to/numpy/reporoot
(然後編輯 NumPy 中的純 Python 程式碼,並使用python some_script.py
執行它)。python setup.py develop
- 這與 (2) 類似,只是就地建置在環境中永久可見。python setup.py bdist_wheel
+pip install dist/numpy*.whl
- 在目前環境中建置 wheel 並安裝它。pip install .
- 在隔離的建置環境中針對pyproject.toml
中的依賴項建置 wheel 並安裝它。 *注意:請小心,這通常不是用於開發安裝的正確命令 - 通常您會想使用 (4) 或*pip install . -v --no-build-isolation
。
新工作流程 (基於 Meson 和 meson-python)
spin test
pip install -e . --no-build-isolation
(注意:僅適用於處理 NumPy 本身 - 更多詳細資訊,請參閱 IDE support & editable installs)與 (2) 相同
python -m build --no-isolation
+pip install dist/numpy*.whl
- 請參閱 pypa/build。pip install .