summaryrefslogtreecommitdiff
path: root/lang/python/README.md
diff options
context:
space:
mode:
authorAlexandru Ardelean <ardeleanalex@gmail.com>2019-05-08 14:46:21 +0300
committerAlexandru Ardelean <ardeleanalex@gmail.com>2019-05-08 14:49:04 +0300
commitdab8f49f82f10d9517aa0f2703aaab01f0b307b3 (patch)
tree17ea6274fbb3f6b046d42032f27d529da5cd8127 /lang/python/README.md
parent1a916b2d3528ba47715f3205fc7457e982ffd721 (diff)
lang/python/README.md: add note about use in other packages feeds
By popular demand, via: https://github.com/openwrt/packages/issues/8892#issuecomment-489992926 Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Diffstat (limited to 'lang/python/README.md')
-rw-r--r--lang/python/README.md44
1 files changed, 41 insertions, 3 deletions
diff --git a/lang/python/README.md b/lang/python/README.md
index 2c5aa18ba..698c09e01 100644
--- a/lang/python/README.md
+++ b/lang/python/README.md
@@ -8,9 +8,10 @@
2. [Python 2 end-of-life](#python-2-end-of-life)
1. [Transition policy / schedule](#transition-policy--schedule)
3. [Introduction](#introduction)
-4. [Build considerations](#build-considerations)
-5. [General folder structure](#general-folder-structure)
-6. [Building a Python[3] package](#building-a-python3-package)
+4. [Using Python[3] in external/other package feeds](#using-python3-in-externalother-package-feeds)
+5. [Build considerations](#build-considerations)
+6. [General folder structure](#general-folder-structure)
+7. [Building a Python[3] package](#building-a-python3-package)
1. [PKG_BUILD_DIR](#pkg_build_dir)
2. [PKG_UNPACK](#pkg_unpack)
3. [Include python[3]-package.mk](#include-python3-packagemk)
@@ -65,6 +66,43 @@ It contains the 2 Python interpreters (Python & Python3) and Python packages. Mo
If more packages (than the ones packaged here) are needed, they can be downloaded via [pip or pip3](https://pip.pypa.io). Note that the versions of `pip` & `setuptools` [available in this repo] are the ones that are packaged inside the Python & Python3 packages (yes, Python & Python3 come packaged with `pip` & `setuptools`).
+## Using Python[3] in external/other package feeds
+
+In the feeds.conf (or feeds.conf.default file, whatever is preferred), the packages repo should be present.
+
+Example
+```
+src-git packages https://git.openwrt.org/feed/packages.git
+src-git luci https://git.openwrt.org/project/luci.git
+src-git routing https://git.openwrt.org/feed/routing.git
+src-git telephony https://git.openwrt.org/feed/telephony.git
+#
+#
+src-git someotherfeed https://github.com/<github-user>/<some-other-package>
+```
+
+Assuming that there are Python packages in the `<some-other-package>`, they should include `python[3]-package.mk` like this:
+```
+include $(TOPDIR)/feeds/packages/lang/python/python-package.mk
+include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
+```
+
+Same rules apply for `python[3]-package.mk` as the Python packages in this repo.
+And if only 1 of `python-package.mk` or `python3-package.mk` is needed, then only the needed mk file should be included (though it's not an issue if both are included).
+
+**One important consideration:**: if the local name is not `packages`, it's something else, like `openwrt-packages`. And in `feeds.conf[.default]` it's:
+```
+src-git openwrt-packages https://git.openwrt.org/feed/packages.git
+```
+
+Then, the inclusions also change:
+```
+include $(TOPDIR)/feeds/openwrt-packages/lang/python/python-package.mk
+include $(TOPDIR)/feeds/openwrt-packages/lang/python/python3-package.mk
+```
+
+Each maintainer[s] of external packages feeds is responsible for the local name, and relative inclusion path back to this feed (which is named `packages` by default).
+
## Build considerations
In order to build the Python[3] interpreters, a host Python/Python3 interpreter needs to be built, in order to process some of the build for the target Python/Python3 build. The host Python[3] interpreters are also needed so that Python bytecodes are generated, so the host interpreters need to be the exact versions as on the target. And finally, the host Python[3] interpreters also provide pip & pip3, so that they may be used to install some Python[3] packages that are required to build other Python[3] packages.