openwrt-packages/lang/python
Alexandru Ardelean f5f0a4e868 python-lxml: bump to version 5.2.1
Also added python-cython/host as a build dependency.

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
2024-04-21 13:46:24 -07:00
..
2to3 2to3: add package host tool 2022-01-05 15:20:13 +01:00
Flask Flask: pass maintainership to Michal Vasílek 2023-02-14 17:37:16 +01:00
django django: bump to version 5.0.4 2024-04-16 14:12:52 +03:00
django-restframework django-restframework: bump to version 3.15.1 2024-04-16 14:13:23 +03:00
flup Revert "lang: python: flup: drop package" 2020-07-15 15:41:37 +02:00
itsdangerous python-packages: Take over maintainership from Daniel Golle 2023-06-27 07:15:47 +02:00
micropython micropython: disable mold 2024-02-22 16:05:05 -08:00
micropython-lib treewide: refresh hashes after move to use ZSTD as default 2024-04-07 12:06:34 +02:00
numpy numpy: update to 1.26.4 2024-04-07 17:04:37 +03:00
openpyxl treewide: remove AUTORELEASE 2023-04-21 22:46:58 +02:00
pillow pillow: bump to version 10.1.0 2023-10-20 13:02:49 +02:00
pipx pipx: Update to 1.3.3 2023-12-13 14:18:06 +08:00
pymysql pymysql: add meta-package for sha256 support 2023-10-05 15:52:07 -03:00
pyproject-metadata pyproject-metadata: add pyproject-metadata 2024-01-02 15:21:37 -08:00
python-aio-mqtt-mod python3-aio-mqtt-mod: update to 0.3.4 2023-08-16 18:22:58 +08:00
python-aiohttp python-aiohttp: update to 3.9.3 2024-02-14 12:58:00 -08:00
python-aiohttp-cors python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-aiosignal python-aiosignal: Add new package 2023-07-24 22:46:12 -07:00
python-apipkg python-apipkg: Update to 3.0.1 2023-07-24 22:45:38 -07:00
python-appdirs treewide: take maintainership from Karel 2023-09-04 11:08:43 +02:00
python-argcomplete python-argcomplete: Update to 3.2.1 2023-12-13 14:16:55 +08:00
python-asgiref python3-asgiref: Update to 3.7.2, rename source package 2023-06-07 23:19:54 +03:00
python-astral treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-async-generator python-async-generator: add package for 1.10 2022-11-26 15:24:04 +01:00
python-async-timeout python-async-timeout: Update to 4.0.2 2023-07-24 22:45:11 -07:00
python-atomicwrites python-atomicwrites: Update to 1.4.1 2023-07-24 22:46:41 -07:00
python-attrs python-attrs: Update to 23.1.0 2023-05-18 11:13:02 +03:00
python-augeas python-cffi: Update to 1.15.1, add host build 2023-03-31 13:06:34 +08:00
python-automat python-automat: Update to 22.10.0, refresh patches 2023-05-18 10:30:52 +03:00
python-awesomeversion treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-awscli python-awscli: Update to 1.29.7, update dependencies 2023-07-24 22:47:29 -07:00
python-babel treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-bcrypt python-bcrypt: Update to 4.1.2 2024-03-02 19:29:59 +01:00
python-bidict python-bidict: Update to 0.22.1 2023-09-23 18:43:37 -07:00
python-ble2mqtt python-ble2mqtt: update to 0.2.2 2024-01-29 11:50:51 +08:00
python-bleak python3-bleak: add missing python3-typing-extensions dependency 2024-01-02 15:26:49 -08:00
python-boto3 python-boto3: Update to 1.28.7, update dependencies 2023-07-24 22:47:29 -07:00
python-botocore python-botocore: Update to 1.31.7, update dependencies 2023-07-24 22:47:29 -07:00
python-build python-build: Update to 1.0.3 2023-09-14 21:37:51 +08:00
python-cached-property python-packages: Clean up build variables 2023-04-24 16:22:03 +08:00
python-cachelib python-cachelib: Update to 0.10.2 2023-08-04 01:57:30 +08:00
python-cachetools treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-calver python-calver: Add new host-only package 2023-05-01 13:34:40 +03:00
python-certifi python-certifi: Update to 2024.2.2 2024-02-05 15:25:45 -03:00
python-cffi python-cffi: Update to 1.16.0 2023-10-03 22:35:59 +08:00
python-chardet python-chardet: bump to 5.2.0 2023-09-09 11:27:37 +03:00
python-charset-normalizer python-charset-normalizer: Update to 3.3.2 2023-11-02 18:45:45 -07:00
python-ciso8601 python-ciso8601: Update to 2.3.0 2023-08-04 01:58:08 +08:00
python-click python-click: Update to 8.1.7 2023-08-24 17:21:25 +08:00
python-click-log treewide: take maintainership from Karel 2023-09-04 11:08:43 +02:00
python-colorama python-colorama: Update to 0.4.6 2023-08-04 01:55:02 +08:00
python-constantly python-constantly: Update to 23.10.4, add new build dependency 2023-11-02 00:27:11 +08:00
python-contextlib2 treewide: take maintainership from Karel 2023-09-04 11:08:43 +02:00
python-crcmod python-crcmod: Fix package section 2023-09-05 06:16:35 +08:00
python-cryptodome python-cryptodome: Update to 3.18.0, refresh patches 2023-09-05 06:02:25 +08:00
python-cryptodomex treewide: assign PKG_CPE_ID 2024-02-04 16:16:10 -08:00
python-cryptography python-cryptography: Update to 41.0.7 2023-12-07 15:07:29 +08:00
python-curl python-packages: Clean up build variables 2023-04-24 16:22:03 +08:00
python-cython python-cython: bump to version 3.0.10 2024-04-17 11:31:26 +03:00
python-dateutil python-dateutil: bump to version 2.9.0.post0 2024-03-14 16:04:24 +02:00
python-dbus-fast python-dbus-fast: upgrade to 2.21.1 2024-01-29 11:50:51 +08:00
python-decorator treewide: take maintainership from Karel 2023-09-04 11:08:43 +02:00
python-defusedxml defusedxml: bump to v. 0.7.0 2021-10-13 22:21:06 -07:00
python-distro python3-distro: update to version 1.9.0 2024-01-02 15:24:44 -08:00
python-dns python-dns: Update to 2.4.1 2023-08-04 01:58:29 +08:00
python-docker lang/python/python-docker: assign PKG_CPE_ID 2024-01-29 16:00:22 -08:00
python-dockerpty python-packages: Clean up build variables 2023-04-24 16:22:03 +08:00
python-docopt python-packages: Clean up build variables 2023-04-24 16:22:03 +08:00
python-docutils python-docutils: Update to 0.20.1 2023-08-04 01:53:32 +08:00
python-dotenv python-dotenv: update to v1.0.1 2024-01-29 13:58:15 +08:00
python-editables python-editables: Update to 0.5 2023-08-04 01:52:23 +08:00
python-engineio treewide: assign PKG_CPE_ID 2024-02-04 16:16:10 -08:00
python-et_xmlfile et_xmlfile: bump to version 1.1.0 2021-05-18 12:29:01 +03:00
python-evdev python-evdev: bump to version 1.7.0 2024-03-14 16:04:24 +02:00
python-eventlet python-eventlet: bump to version 0.33.3 2023-04-29 13:43:16 +03:00
python-execnet python-execnet: Update to 2.0.2 2023-07-24 22:44:44 -07:00
python-flask-babel treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-flask-httpauth python-flask-httpauth: Update to 4.8.0 2023-08-10 05:10:03 +08:00
python-flask-login python-flask-login: Update to 0.6.2, update list of dependencies 2023-08-10 05:10:23 +08:00
python-flask-seasurf treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-flask-session treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-flask-socketio python-flask-socketio: Update to 5.3.5 2023-08-10 05:08:50 +08:00
python-flit-core python-flit-core: Update to 3.9.0 2023-05-24 06:09:41 +03:00
python-flit-scm python-tomli: Remove package 2023-05-26 17:51:53 +08:00
python-fnv-hash-fast python-fnv-hash-fast: Added for v0.5.0 2023-11-16 09:36:10 -05:00
python-fnvhash python-fnvhash: Added for v0.1.0 2023-11-16 09:35:15 -05:00
python-frozenlist python-frozenlist: Add new package 2023-07-24 22:46:12 -07:00
python-gevent python-gevent: add python-gevent 2024-01-02 21:02:10 -08:00
python-gmpy2 python-gmpy2: Update to 2.1.5 2023-05-29 18:15:59 +03:00
python-gnupg python-gnupg: Update to 0.5.1 2023-07-24 22:48:00 -07:00
python-greenlet python-greenlet: update version 3.0.2 2024-01-02 15:17:56 -08:00
python-hatch-fancy-pypi-readme python-hatch-fancy-pypi-readme: Update to 23.1.0 2023-05-29 18:14:46 +03:00
python-hatch-requirements-txt python-hatch-requirements-txt: Add new host-only package 2023-06-02 21:39:58 +08:00
python-hatch-vcs python-hatch-vcs: Update to 0.4.0 2023-11-16 02:19:09 +08:00
python-hatchling python-hatchling: Update to 1.18.0 2023-07-01 04:45:46 -07:00
python-hyperlink python-hyperlink: Update to 21.0.0, refresh patch 2021-02-08 04:49:55 +08:00
python-idna python-idna: Update to 3.6 2023-11-30 12:58:06 +08:00
python-ifaddr python-ifaddr: Update to 0.2.0 2023-08-07 14:00:25 +08:00
python-incremental python-incremental: Add missing host build dependencies 2023-05-11 15:42:33 +08:00
python-influxdb treewide: take maintainership from Karel 2023-09-04 11:08:43 +02:00
python-iniconfig python-iniconfig: Update to 2.0.0 2023-08-13 10:55:05 +08:00
python-installer python-installer: Add host-only package 2023-03-31 13:01:35 +08:00
python-intelhex treewide: take maintainership from Karel 2023-09-04 11:08:43 +02:00
python-jdcal python-packages: Clean up Makefiles 2020-04-22 16:36:55 +08:00
python-jinja2 python-jinja2: create /host target 2024-04-18 16:29:34 +02:00
python-jmespath python-jmespath: Update to 1.0.1 2023-08-13 10:54:46 +08:00
python-jsonpath-ng treewide: take maintainership from Karel 2023-09-04 11:08:43 +02:00
python-jsonschema python-jsonschema: Update to 4.21.1 2024-01-23 15:13:23 +08:00
python-jsonschema-specifications python-jsonschema-specifications: Update to 2023.11.2 2023-12-08 22:44:41 +08:00
python-libmodbus python-libmodbus: Update to 0.6.2 2023-07-01 04:43:26 -07:00
python-lru-dict python-lru-dict: Added for v1.3.0 2023-11-20 09:58:32 -05:00
python-lxml python-lxml: bump to version 5.2.1 2024-04-21 13:46:24 -07:00
python-mako treewide: assign PKG_CPE_ID 2024-02-04 16:16:10 -08:00
python-markdown treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-markupsafe python-markupsafe: Update to 2.1.3, add host build 2023-07-01 04:44:13 -07:00
python-maturin maturin: Update to 1.3.0, build as Python (host-only) package 2023-10-14 01:51:09 +08:00
python-maxminddb python3-maxminddb: Update to 2.4.0, rename source package 2023-07-24 22:45:26 -07:00
python-more-itertools python-more-itertools: Update to 10.1.0 2023-08-17 18:45:03 +08:00
python-msgpack python-msgpack: update version 1.0.7 2024-01-02 16:30:21 -08:00
python-multidict python-multidict: Update to 6.0.4, update list of dependencies 2023-08-12 01:47:53 +08:00
python-netdisco python-netdisco: Update to 3.0.0, update list of dependencies 2023-08-12 01:51:19 +08:00
python-netifaces python3-netifaces: Update to 0.11.0, rename source package 2023-07-20 01:10:00 +08:00
python-networkx treewide: assign PKG_CPE_ID 2024-02-04 16:16:10 -08:00
python-orjson python-orjson: update to version 3.10.0 2024-04-03 18:21:50 -07:00
python-outcome python-outcome: add package for 1.2.0 2022-11-26 15:24:04 +01:00
python-packaging python-packaging: Update to 23.2 2023-10-03 16:55:10 -07:00
python-paho-mqtt lang/python/python-paho-mqtt: fix license 2024-02-04 15:59:21 -08:00
python-paramiko treewide: assign PKG_CPE_ID 2024-02-04 16:16:10 -08:00
python-parsley python-packages: Clean up build variables 2023-04-24 16:22:03 +08:00
python-passlib passlib: Update to 1.7.4, rename source package 2023-06-06 19:53:19 +03:00
python-pathspec python-pathspec: Update to 0.12.1 2023-12-13 14:17:11 +08:00
python-pip lang/python/python-pip: fix PKG_CPE_ID 2024-02-04 16:03:49 -08:00
python-pkgconfig python-pkgconfig: Add new host-only package 2023-04-24 16:18:13 +08:00
python-platformdirs python-platformdirs: Update to 4.1.0 2023-12-13 14:17:25 +08:00
python-pluggy python-pluggy: Update to 1.3.0 2023-08-31 16:16:07 +08:00
python-ply python-ply: Add host build 2023-03-31 13:06:34 +08:00
python-poetry-core python-poetry-core: Update to 1.8.1 2023-11-16 02:20:39 +08:00
python-psutil treewide: assign PKG_CPE_ID 2024-02-04 16:16:10 -08:00
python-psycopg2 python-psycopg2: Update to 2.9.7, update list of dependencies 2023-08-17 18:46:09 +08:00
python-py treewide: assign PKG_CPE_ID 2024-02-04 16:16:10 -08:00
python-pyasn1 python-pyasn1: Update to 0.5.1 2023-11-30 12:58:15 +08:00
python-pyasn1-modules python-packages: remove myself as maintainer 2021-11-23 13:14:43 +02:00
python-pycares python-pycares: bump to 4.4.0 2023-10-11 09:49:14 +08:00
python-pycparser python-pycparser: Add host build 2023-03-31 13:06:34 +08:00
python-pycrate python-pycrate: Update to 0.6.0 2023-04-24 16:18:16 +08:00
python-pyfuse3 python-pyfuse3: Update to 3.3.0, update list of dependencies 2023-08-24 17:20:30 +08:00
python-pynacl python-packages: Clean up build variables 2023-04-24 16:22:03 +08:00
python-pyodbc pyodbc: Update to 5.0.1, rename source package 2023-10-31 12:31:26 +08:00
python-pyopenssl python-pyopenssl: Update to 23.3.0 2023-11-02 18:46:01 -07:00
python-pyotp treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-pyparsing python-pyparsing: Update to 3.1.1 2023-08-24 17:20:49 +08:00
python-pyproject-hooks python-tomli: Remove package 2023-05-26 17:51:53 +08:00
python-pyroute2 python3-pyroute2: Update to 0.7.9, rename source package 2023-07-24 22:45:55 -07:00
python-pyrsistent treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-pyserial python-pyserial: Update to 3.5, update list of dependencies 2023-09-05 06:13:50 +08:00
python-pysocks treewide: change email 2021-07-29 13:21:02 +02:00
python-pytest python-pytest: Update to 7.4.0, update list of dependencies 2023-08-24 17:21:07 +08:00
python-pytest-forked python-pytest-forked: Update to 1.6.0 2023-04-24 16:18:17 +08:00
python-pytest-xdist python-pytest-xdist: Update to 3.3.1, update list of dependencies 2023-08-24 17:21:16 +08:00
python-pytz python-pytz: bump to version 2024.1 2024-03-14 16:04:24 +02:00
python-referencing python-referencing: Update to 0.32.0 2023-12-13 14:17:41 +08:00
python-requests lang/python/python-requests: fix PKG_CPE_ID 2024-02-04 15:56:56 -08:00
python-rpds-py python-rpds-py: Add new package 2023-11-30 12:57:27 +08:00
python-rsa python-rsa: Update to 4.9, update list of dependencies 2023-08-31 16:13:21 +08:00
python-ruamel-yaml treewide: assign PKG_CPE_ID 2024-02-04 16:16:10 -08:00
python-s3transfer python-s3transfer: Update to 0.6.1, update dependencies 2023-07-24 22:47:29 -07:00
python-schedule treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-schema treewide: take maintainership from Karel 2023-09-04 11:08:43 +02:00
python-selinux python3-libselinux: Update to 3.5, rename source/target package 2023-06-19 15:47:09 +08:00
python-semanage python3-libsemanage: Update to 3.5, rename source/target package 2023-06-19 15:47:09 +08:00
python-semantic-version python-semantic-version: Add new host-only package 2023-09-27 16:40:55 -07:00
python-sentry-sdk treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-service-identity python-service-identity: Update to 23.1.0 2023-07-01 04:43:38 -07:00
python-setuptools python-setuptools: Update to 69.0.2 2023-11-30 12:58:25 +08:00
python-setuptools-rust python-setuptools-rust: Update to 1.8.1, remove patch 2023-11-02 00:27:39 +08:00
python-setuptools-scm python-tomli: Remove package 2023-05-26 17:51:53 +08:00
python-six python-packages: remove myself as maintainer 2021-11-23 13:14:43 +02:00
python-slugify treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-sniffio python-sniffio: add package for 1.3.0 2022-11-26 15:24:04 +01:00
python-socketio python-socketio: Update to 5.8.0 2023-08-10 05:08:18 +08:00
python-sortedcontainers python-sortedcontainers: add package for 2.4.0 2022-11-26 15:24:03 +01:00
python-sqlalchemy python-sqlalchemy: update version 2.0.23 2024-01-02 15:18:13 -08:00
python-sqlparse treewide: assign PKG_CPE_ID 2024-02-04 16:16:10 -08:00
python-stem python-stem: update to v1.8.2 2023-07-02 16:29:57 +02:00
python-texttable python3-texttable: update to version 1.7.0 2023-10-14 11:21:21 +08:00
python-toml treewide: change email 2021-07-29 13:21:02 +02:00
python-tornado treewide: assign PKG_CPE_ID 2024-02-04 16:16:10 -08:00
python-trio python-trio: Update to 0.22.2, update list of dependencies 2023-08-31 16:15:37 +08:00
python-trove-classifiers python-trove-classifiers: Update to 2023.11.29 2023-12-04 11:10:46 +01:00
python-twisted python-twisted: Update to 23.10.0, refresh patches 2023-11-16 02:20:59 +08:00
python-typing-extensions python-typing-extensions: Update to 4.9.0 2023-12-13 14:17:53 +08:00
python-ubus python-ubus: Update to 0.1.2 2023-09-04 14:33:49 +08:00
python-uci treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-unidecode treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-urllib3 lang/python/python-urllib3: fix PKG_CPE_ID 2024-02-04 15:56:22 -08:00
python-userpath python-userpath: Add new package 2023-11-16 02:30:21 +08:00
python-versioneer python-versioneer: Add new host-only package 2023-11-02 00:27:11 +08:00
python-voluptuous treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-voluptuous-serialize treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python-wcwidth python-wcwidth: Update to 0.2.6 2023-09-04 14:34:17 +08:00
python-websocket-client python-websocket-client: update to 1.7.0 2024-01-02 15:16:38 -08:00
python-websockets python-websockets: Update to 11.0.3, update list of dependencies 2023-09-04 14:34:24 +08:00
python-werkzeug python-werkzeug: Update to 2.3.6 2023-06-29 18:04:22 -07:00
python-wheel python-wheel: Update to 0.42.0 2023-11-30 12:58:35 +08:00
python-xmltodict xmltodict: Update to 0.13.0, rename source package 2023-09-05 05:57:23 +08:00
python-yaml python-yaml: create /host target 2024-04-18 16:28:59 +02:00
python-yarl python-yarl: Update to 1.9.2 2023-06-05 10:32:04 +02:00
python-zeroconf python-zeroconf: update version 0.131.0 2024-01-02 18:55:52 -08:00
python-zipp python-zipp: Update to 3.16.2, update list of dependencies 2023-09-05 05:42:13 +08:00
python-zope-event python-zope-event: add python-zope-event 2024-01-02 15:19:40 -08:00
python-zope-interface python-zope-interface: Update to 6.1, refresh patch 2023-10-11 09:09:31 +02:00
python3 python3: Update to 3.11.7, refresh patches 2023-12-13 14:16:39 +08:00
python3-bottle treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
python3-django-cors-headers treewide: remove AUTORELEASE 2023-04-21 22:46:58 +02:00
python3-drf-nested-routers treewide: remove AUTORELEASE 2023-04-21 22:46:58 +02:00
python3-iperf3 python3-iperf3: add iperf3 python wrapper 2022-09-14 02:37:44 -07:00
python3-packages python3-packages: Set PYTHON3_PKG_BUILD:=0 2023-05-11 02:54:08 +08:00
python3-pyinotify fail2ban: initial package of fail2ban version 0.11.2 2021-09-01 14:08:17 -07:00
python3-speedtest-cli python3-speedtest-cli: update to 2.1.3 2021-09-18 20:40:54 -04:00
text-unidecode treewide: change my no longer used email 2023-09-04 16:02:56 +02:00
vobject vobject: Remove maintainer 2020-04-23 03:47:12 +08:00
README.md python3: Add Py3Build/InstallBuildDepends recipe 2022-03-17 11:38:19 -07:00
pypi.mk python,python3: Add PYPI_SOURCE_NAME to pypi.mk 2019-10-21 15:27:04 +02:00
python-package-install.sh python: Rework filespec install script 2023-08-25 01:47:43 +08:00
python3-find-stdlib-depends.sh python: Update find stdlib script 2023-04-25 07:49:53 +03:00
python3-host-build.mk python: Add pyproject.toml-based builds for host Python packages 2023-03-30 12:19:05 +08:00
python3-host.mk python-setuptools-rust: Set cargo profile from environment variable 2023-10-11 15:50:24 +08:00
python3-package.mk python-setuptools-rust: Set cargo profile from environment variable 2023-10-11 15:50:24 +08:00
python3-version.mk python3: Update to 3.11.7, refresh patches 2023-12-13 14:16:39 +08:00

README.md

Python packages folder

Table of contents

  1. Description
  2. Introduction
  3. Python 2 end-of-life
  4. Using Python in external/other package feeds
  5. Build considerations
  6. General folder structure
  7. Building a Python package
    1. Include python3-package.mk
    2. Add Package/<PKG_NAME> OpenWrt definitions
    3. Python package dependencies
    4. Wrapping things up so that they build
    5. Customizing things
    6. Host-side Python packages for build

Description

This section describes specifics for the Python packages that are present in this repo, and how things are structured.

In terms of license, contributing guide, etc, all of that information is described in the top README.md file, and it applies here as well. This document attempts to cover only technical aspects of Python packages, and maybe some explanations about how things are (and why they are as they are).

Introduction

This sub-tree came to exist after a number of contributions (Python packages) were made to this repo, and the lang subtree grew to a point where a decision was made to move all Python packages under lang/python.

It contains the Python 3 interpreter and Python packages. Most of the Python packages are downloaded from pypi.org. Python packages from pypi.org are typically preferred when adding new packages.

If more packages (than the ones packaged here) are needed, they can be downloaded via pip. Note that the versions of pip & setuptools [available in this repo] are the ones that are packaged inside the Python package (yes, Python comes packaged with pip & setuptools).

Python 2 end-of-life

Python 2 will not be maintained past 2020. All Python 2 packages have been removed from the packages feed (this repo) and archived in the abandoned packages feed.

Using Python 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 python3-package.mk like this:

include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk

Same rules apply for python3-package.mk as the Python packages in this repo.

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/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).

In case there is a need/requirement such that the local package feed is named something else than packages, one approach to make the package flexible to change is:

PYTHON3_PACKAGE_MK:=$(wildcard $(TOPDIR)/feeds/*/lang/python/python3-package.mk)

# verify that there is only one single file returned
ifneq (1,$(words $(PYTHON3_PACKAGE_MK)))
ifeq (0,$(words $(PYTHON3_PACKAGE_MK)))
$(error did not find python3-package.mk in any feed)
else
$(error found multiple python3-package.mk files in the feeds)
endif
else
$(info found python3-package.mk at $(PYTHON3_PACKAGE_MK))
endif

include $(PYTHON3_PACKAGE_MK)

This should solve the corner-case where the python3-package.mk can be in some other feed, or if the packages feed will be named something else locally.

Build considerations

In order to build the Python interpreter, a host Python interpreter needs to be built, in order to process some of the build for the target Python build. The host Python interpreter is also needed so that Python bytecodes are generated, so the host interpreter needs to be the exact version as on the target. And finally, the host Python interpreter also provides pip, so that it may be used to install some Python packages that are required to build other Python packages. That's why you'll also see a Python build & staging directories.

As you're probably thinking, this sounds [and is] somewhat too much complication [just for packaging], but the status of things is-as-it-is, and it's probably much worse than what's currently visible on the surface [with respect to packaging Python & packages].

As mentioned earlier, Python packages are shipped with bytecodes, and the reason for this is simply performance & size. The thought/discussion matrix derives a bit like this:

  • shipping both Python source-code & bytecodes takes too much space on some devices ; Python source code & byte-code take about similar disk-size
  • shipping only Python source code has a big performance penalty [on some lower end systems] ; something like 500 msecs (Python source-only) -> 70 msecs (Python byte-codes) time reduction for a simple "Hello World" script
  • shipping only Python byte-codes seems like a good trade-off, and this means that python3-src can be provided for people that want the source code

By default, automatic Python byte-code generation is disabled when running a Python script, in order to prevent a disk from accidentally filling up. Since some disks reside in RAM, this also means not filling up the RAM. If someone wants to convert Python source to byte-code then he/she is free to compile it [directly on the device] manually via the Python interpreter & library.

General folder structure

The basis of all these packages is:

This is a normal OpenWrt package, which will build the Python interpreter. This also provides python3-pip & python3-setuptools. Each Python package is actually split into multiple sub-packages [e.g. python3-email, python3-sqlite3, etc]. This can be viewed inside lang/python/python3/files.

The reason for this splitting, is purely to offer a way for some people to package Python in as-minimal-as-possible-and-still-runable way, and also to be somewhat maintainable when packaging. A standard Python installation can take ~20-30 MBs of disk, which can be somewhat big for some people, so there is the python3-base package which brings that down to ~5 MBs. This seems to be good enough (and interesting) for a number of people.

The Python interpreter is structured like this:

  • python3-base, which is just the minimal package to startup Python and run basic commands
  • python3 is a meta-package, which installs almost everything (python3-base [plus] Python library [minus] some unit-tests & some windows-y things)
  • python3-light is python3 [minus] packages that are in lang/python/python3/files ; the size of this package may be sensible (and interesting) to another group of people

All other Python packages (aside from the intepreter) typically use these files:

  • python3-host.mk - this file contains paths and build rules for running the Python interpreter on the host-side; they also provide paths to host interprete, host Python lib-dir & so on
  • python3-package.mk
    • includes python3-host.mk
    • contains all the default build rules for Python packages; these will be detailed below in the Building a Python package section

Note that Python packages don't need to use these files (i.e. python3-package.mk & python3-host.mk), but they do provide some ease-of-use & reduction of duplicate code. And they do contain some learned-lessons about packaging Python packages, so it's a good idea to use them.

Building a Python package

Include python3-package.mk

Add this after include $(INCLUDE_DIR)/package.mk

include ../python3-package.mk

This will make sure that build rules for Python can be specified and picked up for build.

Include pypi.mk (optional)

pypi.mk is an include file that makes downloading package source code from pypi.org simpler.

To use pypi.mk, add this before include $(INCLUDE_DIR)/package.mk:

include ../pypi.mk

pypi.mk has several PYPI_* variables that can/must be set (see below); these should be set before pypi.mk is included, i.e. before the include ../pypi.mk line.

pypi.mk also provides default values for PKG_SOURCE and PKG_SOURCE_URL, so these variables may be omitted.

Required variables:

  • PYPI_NAME: Package name on pypi.org. This should match the PyPI name exactly.

    For example (from the python-yaml package):

    PYPI_NAME:=PyYAML
    

Optional variables:

  • PYPI_SOURCE_NAME: Package name component of the source tarball filename
    Default: Same value as PYPI_NAME

  • PYPI_SOURCE_EXT: File extension of the source tarball filename
    Default: tar.gz

pypi.mk constructs the default PKG_SOURCE value from these variables (and PKG_VERSION):

PKG_SOURCE?=$(PYPI_SOURCE_NAME)-$(PKG_VERSION).$(PYPI_SOURCE_EXT)

Add Package/<PKG_NAME> OpenWrt definitions

This part is similar to default OpenWrt packages.

Example:

define Package/python3-lxml
  SECTION:=lang
  CATEGORY:=Languages
  SUBMENU:=Python
  TITLE:=Pythonic XML processing library
  URL:=https://lxml.de
  DEPENDS:=+python3-light +libxml2 +libxslt +libexslt
endef

define Package/python3-lxml/description
  The lxml XML toolkit is a Pythonic binding
  for the C libraries libxml2 and libxslt.
endef

Some considerations here (based on the example above):

  • typically the package is named 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

Python package dependencies

Aside from other libraries and programs, every Python package will depend on at least one of these three types of packages:

  • The Python interpreter: All Python packages should depend on one of these three interpreter packages:

    • python3-light is the best default for most Python packages.

    • python3-base should only be used as a dependency if you are certain the bare interpreter is sufficient.

    • python3 is useful if many (more than three) Python standard library packages are needed.

  • Python standard library packages: As noted above, many parts of the Python standard library are packaged separate from the Python interpreter. These packages are defined by the files in lang/python/python3/files.

    To find out which of these separate standard library packages are necessary, after completing a draft Makefile (including the $(eval ...) lines described in the next section), run make with the configure target and PY3=stdlib V=s in the command line. For example:

    make package/python-lxml/configure PY3=stdlib V=s
    

    If the package has been built previously, include the clean target to trigger configure again:

    make package/python-lxml/{clean,configure} PY3=stdlib V=s
    

    This will search the package for module imports and generate a list of suggested dependencies. Some of the found imports may be false positives, e.g. in example or test files, so examine the matches for more information.

  • Other Python packages: The easiest way to find these dependencies is to look for the install_requires keyword inside the package's setup.py file (it will be a keyword argument to the setup() function). This will be a list of run-time dependencies for the package.

    There may already be packages in the packages feed that provide these dependencies. If not, they will need to be packaged for your Python package to function correctly.

    Any packages in a setup_requires keyword argument are build-time dependencies that may need to be installed on the host (host Python inside of OpenWrt buildroot, not system Python that is part of the outer computer system). To ensure these build-time dependencies are present, see Host-side Python packages for build. (Note that Setuptools is already installed as part of host Python.)

Wrapping things up so that they build

If all the above prerequisites have been met, all that's left is:

$(eval $(call Py3Package,python3-lxml))
$(eval $(call BuildPackage,python3-lxml))

The $(eval $(call Py3Package,python3-lxml)) part will instantiate all the default Python build rules so that the final Python package is packaged into an OpenWrt. And $(eval $(call BuildPackage,python3-lxml)) will bind all the rules generated with $(eval $(call Py3Package,python3-lxml)) into the OpenWrt build system.

These packages will contain byte-codes and binaries (shared libs & other stuff).

If a user wishes to ship source code, adding one more line creates one more package that ship Python source code:

$(eval $(call Py3Package,python3-lxml))
$(eval $(call BuildPackage,python3-lxml))
$(eval $(call BuildPackage,python3-lxml-src))

The name *-src must be the Python package name; so for python3-lxml-src a equivalent python3-lxml name must exist.

Customizing things

Some packages need custom build rules (because they do).

The default package build and install processes are defined in python3-package.mk.

Building

The default build process calls setup.py install inside the directory where the Python source package is extracted (PKG_BUILD_DIR). This "installs" the Python package to an intermediate location (PKG_INSTALL_DIR) where it is used by the default install process.

There are several Makefile variables that can be used to customize this process (all optional):

  • PYTHON3_PKG_SETUP_DIR: Path where setup.py can be found, relative to the package directory (PKG_BUILD_DIR).
    Default: empty value (setup.py is in the package directory)
  • PYTHON3_PKG_SETUP_VARS: Additional environment variables to set for the call to setup.py. Should be in the form of VARIABLE1=value VARIABLE2=value ....
    Default: empty value
  • PYTHON3_PKG_SETUP_GLOBAL_ARGS: Additional command line arguments to pass to setup.py, before / in front of the install command.
    Default: empty value
  • PYTHON3_PKG_SETUP_ARGS: Additional command line arguments to pass to setup.py, after the install command.
    Default: --single-version-externally-managed

Conceptually, these variables are used in this way:

cd $(PKG_BUILD_DIR)/$(PYTHON3_PKG_SETUP_DIR)
$(PYTHON3_PKG_SETUP_VARS) python3 setup.py $(PYTHON3_PKG_SETUP_GLOBAL_ARGS) install $(PYTHON3_PKG_SETUP_ARGS)

The default build process can be completely overridden by defining a custom Py3Build/Compile rule in the package Makefile.

Installing

The default install process copies some/all of the files from PKG_INSTALL_DIR, placed there by the build process, to a location passed to the install rule as the first argument ($(1)). The OpenWrt build system will then take those files and create the actual .ipk package archives.

This default process uses 2 build rules:

  • Py3Package/<package>/filespec which are Python library files relative to /usr/lib/pythonX.Y ; by default this is /usr/lib/python$(PYTHON3_VERSION)/site-packages (PYTHON3_PKG_DIR) ; most Python packages generate files that get installed in this sub-folder
  • Py3Package/<package>/install is similar to Package/<package>/install ; this allows binary (or other files) to be installed on the target

Both the 2 above rules generate a Package/<package>/install build rule, which gets picked up by the build system. Both can be used together (they are not mutually exclusive), and provide a good enough flexibility for specifying Python packages.

The Py3Package/<package>/filespec rule contains one or more lines of the following format (whitespace added for clarity):

<one of: +-=> | <file/directory path> | <file permissions>

The initial character controls the action that will be taken:

  • +: Install the given path. If the path is a directory, all files and subdirectories inside are installed.
    • If file permissions is specified (optional), then the file or directory (and all files and subdirectories) are assigned the given permissions; if omitted, then the file or directory retains its original permissions.
  • -: Remove the given path. Useful when most of a directory should be installed except for a few files or subdirectories.
    • File permissions is not used / ignored in this case.
  • =: Assign the given file permissions to the given path. File permissions is required in this case.

As mentioned, the default Py3Package/<package>/filespec installs PYTHON3_PKG_DIR:

define Py3Package/python3-example/filespec
+|$(PYTHON3_PKG_DIR)
endef

If the package installs a example_package directory inside PYTHON3_PKG_DIR, and there is an examples directory and test_*.py files that can be omitted to save space, this can be specified as:

define Py3Package/python3-example/filespec
+|$(PYTHON3_PKG_DIR)
-|$(PYTHON3_PKG_DIR)/example_package/examples
-|$(PYTHON3_PKG_DIR)/example_package/test_*.py
endef

Host-side Python packages for build

These can be installed via pip and ideally they should only be installed like this, because it's a bit simpler than running them through the OpenWrt build system.

Requirements files

All host-side Python packages are installed with pip using requirements files, with hash-checking mode enabled. These requirements files are stored in the host-pip-requirements directory.

Each requirements file is named after the Python package it installs and contains the package's pinned version and --hash option. The --hash option value is the SHA256 hash of the package's source tarball; this value can be found on pypi.org.

For example, the requirements file for setuptools-scm (setuptools-scm.txt) contains:

setuptools-scm==4.1.2 --hash=sha256:a8994582e716ec690f33fec70cca0f85bd23ec974e3f783233e4879090a7faa8

If the Python package to be installed depends on other Python packages, those dependencies, with their pinned versions and --hash options, also need to be specified in the requirements file. For instance, cffi.txt includes information for pycparser because pycparser is a dependency of cffi and will be installed with cffi.

There are two types of requirements files in host-pip-requirements:

  • Installs the latest version of a Python package.

    A requirements file of this type is named with the package name only (for example, setuptools-scm.txt) and is used when there is no strict version requirement.

    These files will be updated as newer versions of the Python packages are available.

  • Installs a specific version of a Python package.

    A requirements file of this type is named with the package name and version number (for example, Django-1.11.txt) and is used when a specific (usually older) version is required.

    Installing the latest versions of packages is preferred over specific versions whenever possible.

Installing host-side Python packages

Set HOST_PYTHON3_PACKAGE_BUILD_DEPENDS to the names of one or more requirements files in host-pip-requirements, without the directory path or ".txt" extension.

For example:

HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm

The Python package will be installed in $(STAGING_DIR_HOSTPKG)/lib/pythonX.Y/site-packages.

Non-Python packages installing host-side Python packages

Non-Python packages can also install host-side Python packages using the same mechanism:

  • Set HOST_PYTHON3_PACKAGE_BUILD_DEPENDS (see above for details).

  • Include python3-package.mk (set PYTHON3_PKG_BUILD:=0 to avoid using the default Python package build recipes).

  • Call Py3Build/InstallBuildDepends to initiate the installation.

For example:

PYTHON3_PKG_BUILD:=0
HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm

include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python3-package.mk
# If outside of the packages feed:
# include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk

define Build/Compile
	$(call Py3Build/InstallBuildDepends)
	$(call Build/Compile/Default)
endef