Browse Source

Merge pull request #9039 from cotequeiroz/python_conditional

treewide: add PACKAGE_* DEPENDS conditionals to python packages building both variants, update README.md
lilik-openwrt-22.03
Rosen Penev 6 years ago
committed by GitHub
parent
commit
a505e173d6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 56 additions and 51 deletions
  1. +4
    -4
      lang/python/README.md
  2. +16
    -16
      lang/python/python-awscli/Makefile
  3. +12
    -12
      lang/python/python-botocore/Makefile
  4. +2
    -2
      lang/python/python-colorama/Makefile
  5. +2
    -2
      lang/python/python-docutils/Makefile
  6. +2
    -2
      lang/python/python-jmespath/Makefile
  7. +1
    -1
      lang/python/python-ply/Makefile
  8. +2
    -2
      lang/python/python-pyserial/Makefile
  9. +5
    -5
      lang/python/python-requests/Makefile
  10. +2
    -2
      lang/python/python-rsa/Makefile
  11. +7
    -2
      lang/python/python-s3transfer/Makefile
  12. +1
    -1
      lang/python/python-simplejson/Makefile

+ 4
- 4
lang/python/README.md View File

@ -228,9 +228,9 @@ endef
Some considerations here (based on the example above): 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)**) * 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:<dep>` 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 * consider adding conditional DEPENDS for each variant ; so for each Python[3] package add `+PACKAGE_python-lxml:<dep>` 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 * `VARIANT=python` or `VARIANT=python3` must be added
* typically each variant package is named `Package/python3-<something>` & `Package/python3-<something>` ; this convention makes things easier to follow, though it could work without naming things this this
* typically each variant package is named `Package/python-<something>` & `Package/python3-<something>` ; 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 * `TITLE` can be something a bit more verbose/neat ; typically the name is short as seen above
<a name="note-encodings">**note-encodings**</a>: 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. <a name="note-encodings">**note-encodings**</a>: 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: 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))
$(eval $(call PyPackage,python-lxml-src))
$(eval $(call BuildPackage,python-lxml)) $(eval $(call BuildPackage,python-lxml))
$(eval $(call BuildPackage,python-lxml-src))
$(eval $(call Py3Package,python3-lxml)) $(eval $(call Py3Package,python3-lxml))
$(eval $(call Py3Package,python3-lxml-src))
$(eval $(call BuildPackage,python3-lxml)) $(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. The name `*-src` must be the Python package name; so for `python-lxml-src` a equivalent `python-lxml` name must exist.


+ 16
- 16
lang/python/python-awscli/Makefile View File

@ -28,27 +28,27 @@ endef
define Package/python-awscli define Package/python-awscli
$(call Package/python-awscli/Default) $(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 VARIANT:=python
endef endef
define Package/python3-awscli define Package/python3-awscli
$(call Package/python-awscli/Default) $(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 VARIANT:=python3
endef endef


+ 12
- 12
lang/python/python-botocore/Makefile View File

@ -28,23 +28,23 @@ endef
define Package/python-botocore define Package/python-botocore
$(call Package/python-botocore/Default) $(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 VARIANT:=python
endef endef
define Package/python3-botocore define Package/python3-botocore
$(call Package/python-botocore/Default) $(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 VARIANT:=python3
endef endef


+ 2
- 2
lang/python/python-colorama/Makefile View File

@ -28,13 +28,13 @@ endef
define Package/python-colorama define Package/python-colorama
$(call Package/python-colorama/Default) $(call Package/python-colorama/Default)
DEPENDS:=+python
DEPENDS:=+PACKAGE_python-colorama:python
VARIANT:=python VARIANT:=python
endef endef
define Package/python3-colorama define Package/python3-colorama
$(call Package/python-colorama/Default) $(call Package/python-colorama/Default)
DEPENDS:=+python3
DEPENDS:=+PACKAGE_python3-colorama:python3
VARIANT:=python3 VARIANT:=python3
endef endef


+ 2
- 2
lang/python/python-docutils/Makefile View File

@ -28,13 +28,13 @@ endef
define Package/python-docutils define Package/python-docutils
$(call Package/python-docutils/Default) $(call Package/python-docutils/Default)
DEPENDS:=+python
DEPENDS:=+PACKAGE_python-docutils:python
VARIANT:=python VARIANT:=python
endef endef
define Package/python3-docutils define Package/python3-docutils
$(call Package/python-docutils/Default) $(call Package/python-docutils/Default)
DEPENDS:=+python3
DEPENDS:=+PACKAGE_python3-docutils:python3
VARIANT:=python3 VARIANT:=python3
endef endef


+ 2
- 2
lang/python/python-jmespath/Makefile View File

@ -28,13 +28,13 @@ endef
define Package/python-jmespath define Package/python-jmespath
$(call Package/python-jmespath/Default) $(call Package/python-jmespath/Default)
DEPENDS:=+python
DEPENDS:=+PACKAGE_python-jmespath:python
VARIANT:=python VARIANT:=python
endef endef
define Package/python3-jmespath define Package/python3-jmespath
$(call Package/python-jmespath/Default) $(call Package/python-jmespath/Default)
DEPENDS:=+python3
DEPENDS:=+PACKAGE_python3-jmespath:python3
VARIANT:=python3 VARIANT:=python3
endef endef


+ 1
- 1
lang/python/python-ply/Makefile View File

@ -44,7 +44,7 @@ endef
define Package/python3-ply define Package/python3-ply
$(call Package/python-ply/Default) $(call Package/python-ply/Default)
DEPENDS:=+python3-light
DEPENDS:=+PACKAGE_python3-ply:python3-light
VARIANT:=python3 VARIANT:=python3
endef endef


+ 2
- 2
lang/python/python-pyserial/Makefile View File

@ -36,14 +36,14 @@ endef
define Package/python-pyserial define Package/python-pyserial
$(call Package/python-pyserial/Default) $(call Package/python-pyserial/Default)
TITLE:=python-pyserial TITLE:=python-pyserial
DEPENDS:=+python-light
DEPENDS:=+PACKAGE_python-pyserial:python-light
VARIANT:=python VARIANT:=python
endef endef
define Package/python3-pyserial define Package/python3-pyserial
$(call Package/python-pyserial/Default) $(call Package/python-pyserial/Default)
TITLE:=python3-pyserial TITLE:=python3-pyserial
DEPENDS:=+python3-light
DEPENDS:=+PACKAGE_python3-pyserial:python3-light
VARIANT:=python3 VARIANT:=python3
endef endef


+ 5
- 5
lang/python/python-requests/Makefile View File

@ -52,11 +52,11 @@ endef
define Package/python3-requests define Package/python3-requests
$(call Package/python-requests/Default) $(call Package/python-requests/Default)
DEPENDS:= \ 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 VARIANT:=python3
endef endef


+ 2
- 2
lang/python/python-rsa/Makefile View File

@ -28,13 +28,13 @@ endef
define Package/python-rsa define Package/python-rsa
$(call Package/python-rsa/Default) $(call Package/python-rsa/Default)
DEPENDS:=+python +python-pyasn1
DEPENDS:=+PACKAGE_python-rsa:python +PACKAGE_python-rsa:python-pyasn1
VARIANT:=python VARIANT:=python
endef endef
define Package/python3-rsa define Package/python3-rsa
$(call Package/python-rsa/Default) $(call Package/python-rsa/Default)
DEPENDS:=+python3 +python3-pyasn1
DEPENDS:=+PACKAGE_python3-rsa:python3 +PACKAGE_python3-rsa:python3-pyasn1
VARIANT:=python3 VARIANT:=python3
endef endef


+ 7
- 2
lang/python/python-s3transfer/Makefile View File

@ -28,13 +28,18 @@ endef
define Package/python-s3transfer define Package/python-s3transfer
$(call Package/python-s3transfer/Default) $(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 VARIANT:=python
endef endef
define Package/python3-s3transfer define Package/python3-s3transfer
$(call Package/python-s3transfer/Default) $(call Package/python-s3transfer/Default)
DEPENDS:=+python3 +python3-botocore
DEPENDS:= \
+PACKAGE_python3-s3transfer:python3 \
+PACKAGE_python3-s3transfer:python3-botocore
VARIANT:=python3 VARIANT:=python3
endef endef


+ 1
- 1
lang/python/python-simplejson/Makefile View File

@ -34,7 +34,7 @@ endef
define Package/python-simplejson define Package/python-simplejson
$(call Package/python-simplejson/Default) $(call Package/python-simplejson/Default)
TITLE:=Simple, fast, extensible JSON encoder/decoder for Python 2 TITLE:=Simple, fast, extensible JSON encoder/decoder for Python 2
DEPENDS:=+python-light
DEPENDS:=+PACKAGE_python-simplejson:python-light
VARIANT:=python VARIANT:=python
endef endef


Loading…
Cancel
Save