Meson 和 distutils 的工作方式#
旧工作流程 (基于 numpy.distutils)
python runtests.pypython 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 testpip install -e . --no-build-isolation(注意:仅适用于开发 NumPy 本身 - 更多详情,请参阅 IDE 支持 & 可编辑安装)与 (2) 相同
python -m build --no-isolation+pip install dist/numpy*.whl- 请参阅 pypa/build。pip install .