Skip to contentSkip to conversation

package/python3: add sqlite support for the host variant

PATCH New James Hilliard 1 participant 3 messages Oct 24

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 package/python3: add sqlite support for the host variant

From: Waldemar Brodkorb <[email protected]>

Add an option to enable the sqlite3 module in host Python. This is needed by the default cache backend in mypy 2.4.0.

[James: drop the undefined host-sqlite selection and use the correct --disable-sqlite3 option.]

---
 package/python3/Config.in.host | 5 +++++
 package/python3/python3.mk     | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
package/python3/Config.in.host +5 -0
index 28fc0dbaf8..cfebbd8e8e 100644
@@ -27,4 +27,9 @@ config BR2_PACKAGE_HOST_PYTHON3_SSL
 	help
 	  _ssl module for host Python3.
 
+config BR2_PACKAGE_HOST_PYTHON3_SQLITE
+	bool "sqlite"
+	help
+	  sqlite module for host Python3.
+
 endif
package/python3/python3.mk +6 -1
index 1916982dfe..03ce2d1a05 100644
@@ -18,7 +18,6 @@ PYTHON3_CPE_ID_PRODUCT = python
 
 HOST_PYTHON3_CONF_OPTS += \
 	--without-ensurepip \
-	--disable-sqlite3 \
 	--disable-tk \
 	--with-expat=system \
 	--disable-test-modules \
@@ -73,6 +72,12 @@ HOST_PYTHON3_CONF_ENV += \
 	py_cv_module__ssl=n/a
 endif
 
+ifeq ($(BR2_PACKAGE_HOST_PYTHON3_SQLITE),y)
+HOST_PYTHON3_DEPENDENCIES += host-sqlite
+else
+HOST_PYTHON3_CONF_OPTS += --disable-sqlite3
+endif
+
 PYTHON3_INSTALL_STAGING = YES
 
 ifeq ($(BR2_PACKAGE_PYTHON3_BERKELEYDB),y)
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/3 package/python-ast-serialize: new package

Python bindings for the native parser and AST serializer used by mypy.

---
 package/Config.in                             |  1 +
 package/python-ast-serialize/Config.in        |  7 +++++++
 .../python-ast-serialize.hash                 |  6 ++++++
 .../python-ast-serialize.mk                   | 19 +++++++++++++++++++
 4 files changed, 33 insertions(+)
 create mode 100644 package/python-ast-serialize/Config.in
 create mode 100644 package/python-ast-serialize/python-ast-serialize.hash
 create mode 100644 package/python-ast-serialize/python-ast-serialize.mk
package/Config.in +1 -0
index d3bef2d5f0..2b9bafb4b4 100644
@@ -1018,6 +1018,7 @@ menu "External python modules"
 	source "package/python-arrow/Config.in"
 	source "package/python-asgiref/Config.in"
 	source "package/python-asn1crypto/Config.in"
+	source "package/python-ast-serialize/Config.in"
 	source "package/python-asttokens/Config.in"
 	source "package/python-async-generator/Config.in"
 	source "package/python-async-lru/Config.in"
package/python-ast-serialize/Config.in new file +7 -0
new file mode 100644
index 0000000000..5ef1b0bffb
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_PYTHON_AST_SERIALIZE
+	bool "python-ast-serialize"
+	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+	help
+	  Python bindings for mypy AST serialization.
+
+	  https://github.com/mypyc/ast_serialize
package/python-ast-serialize/python-ast-serialize.hash new file +6 -0
new file mode 100644
index 0000000000..213d185346
@@ -0,0 +1,6 @@
+# Locally calculated after vendoring
+sha256  13fbac7f6da4d7660a171d0c04ddbb5803434b6a21ed1c18c025d04c4ebc3777  python-ast-serialize-0.13.1-cargo6.tar.gz
+# Locally computed sha256 checksums
+sha256  db90b8fd0ae1748117ab467680a5193bfd057a3119846cb53ee3b64f16577b3b  LICENSE
+sha256  2597d854122b77ddc71971564ca2350a37608575ce324adc5650a2b2051c8f18  crates/LICENSE
+sha256  6efb0476a1cc085077ed49357026d8c173bf33017278ef440f222fb9cbcb66e6  crates/ruff_annotate_snippets/LICENSE-MIT
package/python-ast-serialize/python-ast-serialize.mk new file +19 -0
new file mode 100644
index 0000000000..169941ea89
@@ -0,0 +1,19 @@
+################################################################################
+#
+# python-ast-serialize
+#
+################################################################################
+
+PYTHON_AST_SERIALIZE_VERSION = 0.13.1
+PYTHON_AST_SERIALIZE_SOURCE_PYPI = ast_serialize-$(PYTHON_AST_SERIALIZE_VERSION).tar.gz
+PYTHON_AST_SERIALIZE_SITE_PYPI = https://files.pythonhosted.org/packages/21/d5/5dc1ee8a80c3b20a0b63c61b43ba6bc53517faecd1def47bcd752d22268e
+PYTHON_AST_SERIALIZE_SITE = $(PYTHON_AST_SERIALIZE_SITE_PYPI)/$(PYTHON_AST_SERIALIZE_SOURCE_PYPI)?buildroot-path=filename
+PYTHON_AST_SERIALIZE_SETUP_TYPE = maturin
+PYTHON_AST_SERIALIZE_LICENSE = MIT
+PYTHON_AST_SERIALIZE_LICENSE_FILES = \
+	LICENSE \
+	crates/LICENSE \
+	crates/ruff_annotate_snippets/LICENSE-MIT
+
+$(eval $(python-package))
+$(eval $(host-python-package))
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

PATCH 3/3 package/python-mypy: bump to version 2.4.0

In reply to James Hilliard

Add ast-serialize for the native parser, both at build time and at runtime, and propagate its Rust architecture constraint.

Enable sqlite3 for the default cache backend. Add a host option that selects the host Python sqlite3 module as well.

Record the MIT license and collect the bundled typeshed license notices. The existing LICENSE hash is unchanged.

---
 package/Config.in.host               |  1 +
 package/python-mypy/Config.in        |  3 +++
 package/python-mypy/Config.in.host   |  9 +++++++++
 package/python-mypy/python-mypy.hash |  5 +++--
 package/python-mypy/python-mypy.mk   | 10 ++++++----
 5 files changed, 22 insertions(+), 6 deletions(-)
 create mode 100644 package/python-mypy/Config.in.host
package/Config.in.host +1 -0
index 595caf9e7f..33f3691309 100644
@@ -94,6 +94,7 @@ menu "Host utilities"
 	source "package/python-iniparse/Config.in.host"
 	source "package/python-kflash/Config.in.host"
 	source "package/python-lxml/Config.in.host"
+	source "package/python-mypy/Config.in.host"
 	source "package/python-pyyaml/Config.in.host"
 	source "package/python-six/Config.in.host"
 	source "package/python-uswid/Config.in.host"
package/python-mypy/Config.in +3 -0
index 2ac5bd7c76..3237bb17f7 100644
@@ -1,9 +1,12 @@
 config BR2_PACKAGE_PYTHON_MYPY
 	bool "python-mypy"
+	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS # python-ast-serialize
+	select BR2_PACKAGE_PYTHON_AST_SERIALIZE # runtime
 	select BR2_PACKAGE_PYTHON_LIBRT # runtime
 	select BR2_PACKAGE_PYTHON_MYPY_EXTENSIONS # runtime
 	select BR2_PACKAGE_PYTHON_PATHSPEC # runtime
 	select BR2_PACKAGE_PYTHON_TYPING_EXTENSIONS # runtime
+	select BR2_PACKAGE_PYTHON3_SQLITE # runtime
 	help
 	  Optional static typing for Python.
 
package/python-mypy/Config.in.host new file +9 -0
new file mode 100644
index 0000000000..b43221e001
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_HOST_PYTHON_MYPY
+	bool "host python-mypy"
+	depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS # host-python-ast-serialize
+	select BR2_PACKAGE_HOST_PYTHON3
+	select BR2_PACKAGE_HOST_PYTHON3_SQLITE
+	help
+	  Optional static typing for Python.
+
+	  https://www.mypy-lang.org/
package/python-mypy/python-mypy.hash +3 -2
index a31cb5dba6..6b52f15231 100644
@@ -1,5 +1,6 @@
 # md5, sha256 from https://pypi.org/pypi/mypy/json
-md5  a23b930a86aa298a97b72da06ee84084  mypy-1.19.1.tar.gz
-sha256  19d88bb05303fe63f71dd2c6270daca27cb9401c4ca8255fe50d1d920e0eb9ba  mypy-1.19.1.tar.gz
+md5  ec1d664d1e3304484e63381a64136227  mypy-2.4.0.tar.gz
+sha256  77bdaebd452f43fcfc4cc3ba94352a3ea537cd01e3f2d0879f48673d2ec00d6e  mypy-2.4.0.tar.gz
 # Locally computed sha256 checksums
 sha256  fdf1cd17f50e1305ed8cfd37467312d27a984648dba622cef70573b5512e4e1b  LICENSE
+sha256  295f8538c94ae5c3043301cf7cff1c852dab6a786a8ddee471e061b40d5ecabe  mypy/typeshed/LICENSE
package/python-mypy/python-mypy.mk +6 -4
index 4b02753978..7e4b69d936 100644
@@ -4,13 +4,14 @@
 #
 ################################################################################
 
-PYTHON_MYPY_VERSION = 1.19.1
+PYTHON_MYPY_VERSION = 2.4.0
 PYTHON_MYPY_SOURCE = mypy-$(PYTHON_MYPY_VERSION).tar.gz
-PYTHON_MYPY_SITE = https://files.pythonhosted.org/packages/f5/db/4efed9504bc01309ab9c2da7e352cc223569f05478012b5d9ece38fd44d2
+PYTHON_MYPY_SITE = https://files.pythonhosted.org/packages/34/4e/64300736cf0a0373a27b94a91b664ee7382e36f77b0621bae6381da3e180
 PYTHON_MYPY_SETUP_TYPE = setuptools
-PYTHON_MYPY_LICENSE = Apache-2.0, BSD-2-Clause, Python-2.0.1
-PYTHON_MYPY_LICENSE_FILES = LICENSE
+PYTHON_MYPY_LICENSE = Apache-2.0, BSD-2-Clause, MIT, Python-2.0.1
+PYTHON_MYPY_LICENSE_FILES = LICENSE mypy/typeshed/LICENSE
 PYTHON_MYPY_DEPENDENCIES = \
+	host-python-ast-serialize \
 	host-python-librt \
 	host-python-mypy-extensions \
 	host-python-pathspec \
@@ -18,6 +19,7 @@ PYTHON_MYPY_DEPENDENCIES = \
 	host-python-types-setuptools \
 	host-python-typing-extensions
 HOST_PYTHON_MYPY_DEPENDENCIES = \
+	host-python-ast-serialize \
 	host-python-librt \
 	host-python-mypy-extensions \
 	host-python-pathspec \
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot