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)类似,只是就地构建在 env 中永久可见.python setup.py bdist_wheel+pip install dist/numpy.whl- 在当前 env 中构建 wheel 并安装它.pip install .- 在隔离的构建 env 中根据pyproject.toml中的依赖项构建 wheel 并安装它.注意:小心,这通常不是开发安装的正确命令 - 通常您需要使用 (4) 或pip install . -v --no-build-isolation.
新的工作流程(基于 Meson 和 meson-python):
spin testpip 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 .