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 support & editable installs )与 (2) 相同
python -m build --no-isolation+pip install dist/numpy.whl- 参见 pypa/build .pip install .