From 36d0c59e99ca1d71232156a677bf1b6fe3aea736 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Mon, 20 May 2019 13:49:31 -0300 Subject: [PATCH 1/2] python: README.md: adjust recursive dep text, misc Adding the conditionals to DEPENDS should not cause circular dependencies any more. This adjusts the text to point out that it used to be a problem, and if it happens again, one should open an issue. Also, some spotted trivial errors were fixed. Signed-off-by: Eneas U de Queiroz --- lang/python/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/python/README.md b/lang/python/README.md index 698c09e01..bde643e82 100644 --- a/lang/python/README.md +++ b/lang/python/README.md @@ -228,9 +228,9 @@ endef Some considerations here (based on the example above): * be sure to make sure that `DEPENDS` are correct for both variants; as seen in the example above, `python-codecs` is needed only for `python-lxml` (see **[note-encodings](#note-encodings)**) * consider adding conditional DEPENDS for each variant ; so for each Python[3] package add `+PACKAGE_python-lxml:` as seen in the above example ; the reason for this is build-time reduction ; if you want to build Python3 only packages, this won't build Python & Python packages + dependencies ; this is a known functionality of OpenWrt build deps - * there is an exception to the above consideration: if adding `+PACKAGE_python-lxml` conditional deps creates circular dependencies [for some weird reason], then this can be omitted + * this should not happen anymore, but if adding `+PACKAGE_python-lxml` conditional deps creates circular dependencies, then open an issue so this can be resolved again. * `VARIANT=python` or `VARIANT=python3` must be added -* typically each variant package is named `Package/python3-` & `Package/python3-` ; this convention makes things easier to follow, though it could work without naming things this this +* typically each variant package is named `Package/python-` & `Package/python3-` ; this convention makes things easier to follow, though it could work without naming things this way * `TITLE` can be something a bit more verbose/neat ; typically the name is short as seen above **note-encodings**: That's because some character encodings are needed, which are present in `python3-base` but not in `python-light` (but are present in `python-codecs`) ; this is because Python3 is designed to be more Unicode friendly than Python2 (it's one of the fundamental differences between the 2), and Python3 won't start without those encodings being present. @@ -272,12 +272,12 @@ These packages will contain byte-codes and binaries (shared libs & other stuff). If a user wishes to ship source code, adding 2 more lines creates 2 more packages that ship Python source code: ``` $(eval $(call PyPackage,python-lxml)) -$(eval $(call PyPackage,python-lxml-src)) $(eval $(call BuildPackage,python-lxml)) +$(eval $(call BuildPackage,python-lxml-src)) $(eval $(call Py3Package,python3-lxml)) -$(eval $(call Py3Package,python3-lxml-src)) $(eval $(call BuildPackage,python3-lxml)) +$(eval $(call BuildPackage,python3-lxml-src)) ``` The name `*-src` must be the Python package name; so for `python-lxml-src` a equivalent `python-lxml` name must exist. From 65009e8127414fe6796f8ace6d532750b622773a Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Mon, 20 May 2019 13:53:39 -0300 Subject: [PATCH 2/2] treewide: Add PACKAGE_* conds to python packages If a package builds python & python3 variants, then the respective PACKAGE-python* conditional DEPENDS were added, since circular dependencies should all be resolved now. Signed-off-by: Eneas U de Queiroz --- lang/python/python-awscli/Makefile | 32 +++++++++++++------------- lang/python/python-botocore/Makefile | 24 +++++++++---------- lang/python/python-colorama/Makefile | 4 ++-- lang/python/python-docutils/Makefile | 4 ++-- lang/python/python-jmespath/Makefile | 4 ++-- lang/python/python-ply/Makefile | 2 +- lang/python/python-pyserial/Makefile | 4 ++-- lang/python/python-requests/Makefile | 10 ++++---- lang/python/python-rsa/Makefile | 4 ++-- lang/python/python-s3transfer/Makefile | 9 ++++++-- lang/python/python-simplejson/Makefile | 2 +- 11 files changed, 52 insertions(+), 47 deletions(-) diff --git a/lang/python/python-awscli/Makefile b/lang/python/python-awscli/Makefile index d52faac56..c290c6ac4 100644 --- a/lang/python/python-awscli/Makefile +++ b/lang/python/python-awscli/Makefile @@ -28,27 +28,27 @@ endef define Package/python-awscli $(call Package/python-awscli/Default) - DEPENDS:=+python \ - +python-yaml \ - +python-pyasn1 \ - +python-botocore \ - +python-rsa \ - +python-colorama \ - +python-docutils \ - +python-s3transfer + DEPENDS:=+PACKAGE_python-awscli:python \ + +PACKAGE_python-awscli:python-yaml \ + +PACKAGE_python-awscli:python-pyasn1 \ + +PACKAGE_python-awscli:python-botocore \ + +PACKAGE_python-awscli:python-rsa \ + +PACKAGE_python-awscli:python-colorama \ + +PACKAGE_python-awscli:python-docutils \ + +PACKAGE_python-awscli:python-s3transfer VARIANT:=python endef define Package/python3-awscli $(call Package/python-awscli/Default) - DEPENDS:=+python3 \ - +python3-yaml \ - +python3-pyasn1 \ - +python3-botocore \ - +python3-rsa \ - +python3-colorama \ - +python3-docutils \ - +python3-s3transfer + DEPENDS:=+PACKAGE_python3-awscli:python3 \ + +PACKAGE_python3-awscli:python3-yaml \ + +PACKAGE_python3-awscli:python3-pyasn1 \ + +PACKAGE_python3-awscli:python3-botocore \ + +PACKAGE_python3-awscli:python3-rsa \ + +PACKAGE_python3-awscli:python3-colorama \ + +PACKAGE_python3-awscli:python3-docutils \ + +PACKAGE_python3-awscli:python3-s3transfer VARIANT:=python3 endef diff --git a/lang/python/python-botocore/Makefile b/lang/python/python-botocore/Makefile index 6ebc616cf..e02c6d61f 100644 --- a/lang/python/python-botocore/Makefile +++ b/lang/python/python-botocore/Makefile @@ -28,23 +28,23 @@ endef define Package/python-botocore $(call Package/python-botocore/Default) - DEPENDS:=+python \ - +python-urllib3 \ - +python-docutils \ - +python-dateutil \ - +python-jmespath \ - +python-requests + DEPENDS:=+PACKAGE_python-botocore:python \ + +PACKAGE_python-botocore:python-urllib3 \ + +PACKAGE_python-botocore:python-docutils \ + +PACKAGE_python-botocore:python-dateutil \ + +PACKAGE_python-botocore:python-jmespath \ + +PACKAGE_python-botocore:python-requests VARIANT:=python endef define Package/python3-botocore $(call Package/python-botocore/Default) - DEPENDS:=+python3 \ - +python3-urllib3 \ - +python3-docutils \ - +python3-dateutil \ - +python3-jmespath \ - +python3-requests + DEPENDS:=+PACKAGE_python3-botocore:python3 \ + +PACKAGE_python3-botocore:python3-urllib3 \ + +PACKAGE_python3-botocore:python3-docutils \ + +PACKAGE_python3-botocore:python3-dateutil \ + +PACKAGE_python3-botocore:python3-jmespath \ + +PACKAGE_python3-botocore:python3-requests VARIANT:=python3 endef diff --git a/lang/python/python-colorama/Makefile b/lang/python/python-colorama/Makefile index 815708cfb..c5b8c67f5 100644 --- a/lang/python/python-colorama/Makefile +++ b/lang/python/python-colorama/Makefile @@ -28,13 +28,13 @@ endef define Package/python-colorama $(call Package/python-colorama/Default) - DEPENDS:=+python + DEPENDS:=+PACKAGE_python-colorama:python VARIANT:=python endef define Package/python3-colorama $(call Package/python-colorama/Default) - DEPENDS:=+python3 + DEPENDS:=+PACKAGE_python3-colorama:python3 VARIANT:=python3 endef diff --git a/lang/python/python-docutils/Makefile b/lang/python/python-docutils/Makefile index f7bbe3297..23500a57a 100644 --- a/lang/python/python-docutils/Makefile +++ b/lang/python/python-docutils/Makefile @@ -28,13 +28,13 @@ endef define Package/python-docutils $(call Package/python-docutils/Default) - DEPENDS:=+python + DEPENDS:=+PACKAGE_python-docutils:python VARIANT:=python endef define Package/python3-docutils $(call Package/python-docutils/Default) - DEPENDS:=+python3 + DEPENDS:=+PACKAGE_python3-docutils:python3 VARIANT:=python3 endef diff --git a/lang/python/python-jmespath/Makefile b/lang/python/python-jmespath/Makefile index 0e4c3090f..ce11ca7b2 100644 --- a/lang/python/python-jmespath/Makefile +++ b/lang/python/python-jmespath/Makefile @@ -28,13 +28,13 @@ endef define Package/python-jmespath $(call Package/python-jmespath/Default) - DEPENDS:=+python + DEPENDS:=+PACKAGE_python-jmespath:python VARIANT:=python endef define Package/python3-jmespath $(call Package/python-jmespath/Default) - DEPENDS:=+python3 + DEPENDS:=+PACKAGE_python3-jmespath:python3 VARIANT:=python3 endef diff --git a/lang/python/python-ply/Makefile b/lang/python/python-ply/Makefile index aacaf15d5..a728e15c8 100644 --- a/lang/python/python-ply/Makefile +++ b/lang/python/python-ply/Makefile @@ -44,7 +44,7 @@ endef define Package/python3-ply $(call Package/python-ply/Default) - DEPENDS:=+python3-light + DEPENDS:=+PACKAGE_python3-ply:python3-light VARIANT:=python3 endef diff --git a/lang/python/python-pyserial/Makefile b/lang/python/python-pyserial/Makefile index 00b6410f9..8a25c1153 100644 --- a/lang/python/python-pyserial/Makefile +++ b/lang/python/python-pyserial/Makefile @@ -36,14 +36,14 @@ endef define Package/python-pyserial $(call Package/python-pyserial/Default) TITLE:=python-pyserial - DEPENDS:=+python-light + DEPENDS:=+PACKAGE_python-pyserial:python-light VARIANT:=python endef define Package/python3-pyserial $(call Package/python-pyserial/Default) TITLE:=python3-pyserial - DEPENDS:=+python3-light + DEPENDS:=+PACKAGE_python3-pyserial:python3-light VARIANT:=python3 endef diff --git a/lang/python/python-requests/Makefile b/lang/python/python-requests/Makefile index 3c823893c..dd6df4fb1 100644 --- a/lang/python/python-requests/Makefile +++ b/lang/python/python-requests/Makefile @@ -52,11 +52,11 @@ endef define Package/python3-requests $(call Package/python-requests/Default) DEPENDS:= \ - +python3-light \ - +python3-chardet \ - +python3-idna \ - +python3-urllib3 \ - +python3-certifi + +PACKAGE_python3-requests:python3-light \ + +PACKAGE_python3-requests:python3-chardet \ + +PACKAGE_python3-requests:python3-idna \ + +PACKAGE_python3-requests:python3-urllib3 \ + +PACKAGE_python3-requests:python3-certifi VARIANT:=python3 endef diff --git a/lang/python/python-rsa/Makefile b/lang/python/python-rsa/Makefile index cb84dfd02..5bd94fc7b 100644 --- a/lang/python/python-rsa/Makefile +++ b/lang/python/python-rsa/Makefile @@ -28,13 +28,13 @@ endef define Package/python-rsa $(call Package/python-rsa/Default) - DEPENDS:=+python +python-pyasn1 + DEPENDS:=+PACKAGE_python-rsa:python +PACKAGE_python-rsa:python-pyasn1 VARIANT:=python endef define Package/python3-rsa $(call Package/python-rsa/Default) - DEPENDS:=+python3 +python3-pyasn1 + DEPENDS:=+PACKAGE_python3-rsa:python3 +PACKAGE_python3-rsa:python3-pyasn1 VARIANT:=python3 endef diff --git a/lang/python/python-s3transfer/Makefile b/lang/python/python-s3transfer/Makefile index a50f1b418..255b5b678 100644 --- a/lang/python/python-s3transfer/Makefile +++ b/lang/python/python-s3transfer/Makefile @@ -28,13 +28,18 @@ endef define Package/python-s3transfer $(call Package/python-s3transfer/Default) - DEPENDS:=+python +python-botocore +python-futures + DEPENDS:= \ + +PACKAGE_python-s3transfer:python \ + +PACKAGE_python-s3transfer:python-botocore \ + +PACKAGE_python-s3transfer:python-futures VARIANT:=python endef define Package/python3-s3transfer $(call Package/python-s3transfer/Default) - DEPENDS:=+python3 +python3-botocore + DEPENDS:= \ + +PACKAGE_python3-s3transfer:python3 \ + +PACKAGE_python3-s3transfer:python3-botocore VARIANT:=python3 endef diff --git a/lang/python/python-simplejson/Makefile b/lang/python/python-simplejson/Makefile index 11a66a117..3ba4a6764 100644 --- a/lang/python/python-simplejson/Makefile +++ b/lang/python/python-simplejson/Makefile @@ -34,7 +34,7 @@ endef define Package/python-simplejson $(call Package/python-simplejson/Default) TITLE:=Simple, fast, extensible JSON encoder/decoder for Python 2 - DEPENDS:=+python-light + DEPENDS:=+PACKAGE_python-simplejson:python-light VARIANT:=python endef