This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/buildstream-plugins.git

commit 6c4a5f69128bf806182289dd961765e3d6fa168b
Author: Tristan van Berkom <[email protected]>
AuthorDate: Fri Mar 18 17:21:03 2022 +0900

    Initially adding pip element
    
    From bst-plugins-experimental
---
 src/buildstream_plugins/elements/pip.py   | 46 +++++++++++++++++++++++++++++++
 src/buildstream_plugins/elements/pip.yaml | 34 +++++++++++++++++++++++
 2 files changed, 80 insertions(+)

diff --git a/src/buildstream_plugins/elements/pip.py 
b/src/buildstream_plugins/elements/pip.py
new file mode 100644
index 0000000..072681a
--- /dev/null
+++ b/src/buildstream_plugins/elements/pip.py
@@ -0,0 +1,46 @@
+#
+#  Copyright (C) 2017 Mathieu Bridon
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+#  Authors:
+#        Mathieu Bridon <[email protected]>
+
+"""
+pip - Pip build element
+=======================
+A `BuildElement
+<https://docs.buildstream.build/master/buildstream.buildelement.html#module-buildstream.buildelement>`_
+implementation for installing Python modules with pip
+
+The pip default configuration:
+  .. literalinclude:: ../../../src/buildstream_plugins/elements/pip.yaml
+     :language: yaml
+
+See `built-in functionality documentation
+<https://docs.buildstream.build/master/buildstream.buildelement.html#core-buildelement-builtins>`_
 for
+details on common configuration options for build elements.
+"""
+
+from buildstream import BuildElement
+
+
+# Element implementation for the 'pip' kind.
+class PipElement(BuildElement):
+
+    BST_MIN_VERSION = "2.0"
+
+
+# Plugin entry point
+def setup():
+    return PipElement
diff --git a/src/buildstream_plugins/elements/pip.yaml 
b/src/buildstream_plugins/elements/pip.yaml
new file mode 100644
index 0000000..e128d50
--- /dev/null
+++ b/src/buildstream_plugins/elements/pip.yaml
@@ -0,0 +1,34 @@
+# Pip default configurations
+
+variables:
+
+  pip: pip
+  pip-flags: |
+    %{pip} install --no-deps --root=%{install-root} --prefix=%{prefix}
+  pip-install-package: |
+    %{pip-flags} %{conf-root}
+  pip-download-dir: |
+    .bst_pip_downloads
+  pip-install-dependencies: |
+    if [ -e %{pip-download-dir} ]; then %{pip-flags} %{pip-download-dir}/*; fi
+
+config:
+
+  configure-commands: []
+  build-commands: []
+
+  # Commands for installing the software into a
+  # destination folder
+  #
+  install-commands:
+  - |
+    %{pip-install-package}
+  - |
+    %{pip-install-dependencies}
+
+  # Commands for stripping debugging information out of
+  # installed binaries
+  #
+  strip-commands:
+  - |
+    %{strip-binaries}

Reply via email to