[Mlir-commits] [mlir] 4ca39da - NFC: Update MLIR python bindings docs to install deps via requirements.txt.

Stella Laurenzo llvmlistbot at llvm.org
Mon Mar 29 11:33:14 PDT 2021


Author: Stella Laurenzo
Date: 2021-03-29T18:32:51Z
New Revision: 4ca39dad529c44de63596c41bfd226e7804e5ecc

URL: https://github.com/llvm/llvm-project/commit/4ca39dad529c44de63596c41bfd226e7804e5ecc
DIFF: https://github.com/llvm/llvm-project/commit/4ca39dad529c44de63596c41bfd226e7804e5ecc.diff

LOG: NFC: Update MLIR python bindings docs to install deps via requirements.txt.

* Also adds some verbiage about upgrading `pip` itself, since this is a
  common source of issues.

Differential Revision: https://reviews.llvm.org/D99522

Added: 
    mlir/lib/Bindings/Python/requirements.txt

Modified: 
    mlir/docs/Bindings/Python.md

Removed: 
    


################################################################################
diff  --git a/mlir/docs/Bindings/Python.md b/mlir/docs/Bindings/Python.md
index 902c03916a8ea..510de6365451a 100644
--- a/mlir/docs/Bindings/Python.md
+++ b/mlir/docs/Bindings/Python.md
@@ -7,9 +7,8 @@ Current status: Under development and not enabled by default
 ### Pre-requisites
 
 * A relatively recent Python3 installation
-* [`pybind11`](https://github.com/pybind/pybind11) must be installed and able to
-  be located by CMake (auto-detected if installed via
-  `python -m pip install pybind11`). Note: minimum version required: :2.6.0.
+* Installation of python dependencies as specified in
+  `mlir/lib/Bindings/Python/requirements.txt`
 
 ### CMake variables
 
@@ -45,9 +44,18 @@ which python
 python -m venv ~/.venv/mlirdev
 source ~/.venv/mlirdev/bin/activate
 
+# Note that many LTS distros will bundle a version of pip itself that is too
+# old to download all of the latest binaries for certain platforms.
+# The pip version can be obtained with `python -m pip --version`, and for
+# Linux specifically, this should be cross checked with minimum versions
+# here: https://github.com/pypa/manylinux
+# It is recommended to upgrade pip:
+python -m pip install --upgrade pip
+
+
 # Now the `python` command will resolve to your virtual environment and
 # packages will be installed there.
-python -m pip install pybind11 numpy
+python -m pip install -r mlir/lib/Bindings/Python/requirements.txt
 
 # Now run `cmake`, `ninja`, et al.
 ```

diff  --git a/mlir/lib/Bindings/Python/requirements.txt b/mlir/lib/Bindings/Python/requirements.txt
new file mode 100644
index 0000000000000..51b35c22eef85
--- /dev/null
+++ b/mlir/lib/Bindings/Python/requirements.txt
@@ -0,0 +1,3 @@
+numpy
+pybind11>=2.6.0
+PyYAML


        


More information about the Mlir-commits mailing list