From c028ccd8bf35334f2185c77b3d42e6cd4e78af1f Mon Sep 17 00:00:00 2001
From: Marcel Telka <marcel@telka.sk>
Date: Sat, 06 Apr 2024 21:13:40 +0200
Subject: [PATCH] Add pydantic_core Python project

---
 components/python/pydantic_core/python-integrate-project.conf   |   36 +++++++++
 components/python/pydantic_core/Makefile                        |   67 ++++++++++++++++
 components/python/pydantic_core/patches/01-pytest-plugins.patch |   14 +++
 components/python/pydantic_core/pkg5                            |   15 +++
 components/python/pydantic_core/pydantic_core-PYVER.p5m         |   40 ++++++++++
 components/python/pydantic_core/manifests/sample-manifest.p5m   |   40 ++++++++++
 6 files changed, 212 insertions(+), 0 deletions(-)

diff --git a/components/python/pydantic_core/Makefile b/components/python/pydantic_core/Makefile
new file mode 100644
index 0000000..d031894
--- /dev/null
+++ b/components/python/pydantic_core/Makefile
@@ -0,0 +1,67 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# This file was automatically generated using the following command:
+#   $WS_TOOLS/python-integrate-project pydantic_core
+#
+
+BUILD_STYLE = pyproject
+
+include ../../../make-rules/shared-macros.mk
+
+COMPONENT_NAME =		pydantic_core
+HUMAN_VERSION =			2.18.0
+COMPONENT_SUMMARY =		pydantic_core - Core functionality for Pydantic validation and serialization
+COMPONENT_PROJECT_URL =		https://github.com/pydantic/pydantic-core
+COMPONENT_ARCHIVE_HASH =	\
+	sha256:a6d075404af8b8feb42f86196e08053bfae282af2701321f36a1553e966ce1f0
+COMPONENT_LICENSE =		MIT
+COMPONENT_LICENSE_FILE =	LICENSE
+
+TEST_STYLE = pytest
+
+#
+# Following dependency loops were detected (where 'A --> B' means 'A needs B to
+# run tests', and 'A ==> B' means 'A needs B for build and/or run'):
+#
+# pydantic_core --> dirty_equals --> pydantic ==> pydantic_core
+#
+# To break loops we need to allow this project to integrate without testing in
+# a case the required projects are not available yet (bootstrap).
+#
+PYTHON_TEST_BOOTSTRAP = yes
+
+include $(WS_MAKE_RULES)/common.mk
+
+# https://www.illumos.org/issues/15767
+LD_Z_IGNORE=
+
+# This project does not support tox so we need to provide test requirements
+# manually.
+TEST_REQUIREMENTS += tests/requirements.txt
+TEST_REQUIRED_PACKAGES.python += library/python/pytest-benchmark
+
+# Auto-generated dependencies
+PYTHON_REQUIRED_PACKAGES += library/python/maturin
+PYTHON_REQUIRED_PACKAGES += library/python/typing-extensions
+PYTHON_REQUIRED_PACKAGES += runtime/python
+REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
+REQUIRED_PACKAGES += system/library
+REQUIRED_PACKAGES += system/library/math
+TEST_REQUIRED_PACKAGES.python += library/python/coverage
+TEST_REQUIRED_PACKAGES.python += library/python/dirty-equals
+TEST_REQUIRED_PACKAGES.python += library/python/exceptiongroup
+TEST_REQUIRED_PACKAGES.python += library/python/hypothesis
+TEST_REQUIRED_PACKAGES.python += library/python/pytest
+TEST_REQUIRED_PACKAGES.python += library/python/pytest-mock
+TEST_REQUIRED_PACKAGES.python += library/python/pytest-timeout
+TEST_REQUIRED_PACKAGES.python += library/python/pytz
diff --git a/components/python/pydantic_core/manifests/sample-manifest.p5m b/components/python/pydantic_core/manifests/sample-manifest.p5m
new file mode 100644
index 0000000..1e05cc0
--- /dev/null
+++ b/components/python/pydantic_core/manifests/sample-manifest.p5m
@@ -0,0 +1,40 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2024 <contributor>
+#
+
+set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)-$(PYV)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.human-version value=$(HUMAN_VERSION)
+set name=pkg.summary value="$(COMPONENT_SUMMARY)"
+set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+
+license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
+
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core-$(HUMAN_VERSION).dist-info/METADATA
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core-$(HUMAN_VERSION).dist-info/WHEEL
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core-$(HUMAN_VERSION).dist-info/license_files/LICENSE
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core/__init__.py
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core/_pydantic_core.cpython-$(PYV).so
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core/_pydantic_core.pyi
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core/core_schema.py
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core/py.typed
+
+# python modules are unusable without python runtime binary
+depend type=require fmri=__TBD pkg.debug.depend.file=python$(PYVER) \
+    pkg.debug.depend.path=usr/bin
+
+# Automatically generated dependencies based on distribution metadata
+depend type=require fmri=pkg:/library/python/typing-extensions-$(PYV)
diff --git a/components/python/pydantic_core/patches/01-pytest-plugins.patch b/components/python/pydantic_core/patches/01-pytest-plugins.patch
new file mode 100644
index 0000000..176b798
--- /dev/null
+++ b/components/python/pydantic_core/patches/01-pytest-plugins.patch
@@ -0,0 +1,14 @@
+pytest-pretty and pytest-speed are not needed to run tests
+
+--- pydantic_core-2.18.0/tests/requirements.txt.orig
++++ pydantic_core-2.18.0/tests/requirements.txt
+@@ -12,9 +12,7 @@
+ # pytest-examples currently depends on aiohttp via black; we don't want to build
+ # it on platforms like aarch64 musllinux in CI
+ pytest-examples==0.0.10; implementation_name == "cpython" and platform_machine == 'x86_64'
+-pytest-speed==0.3.5
+ pytest-mock==3.14.0
+-pytest-pretty==1.2.0
+ pytest-timeout==2.3.1
+ pytz==2024.1
+ # numpy doesn't offer prebuilt wheels for all versions and platforms we test in CI e.g. aarch64 musllinux
diff --git a/components/python/pydantic_core/pkg5 b/components/python/pydantic_core/pkg5
new file mode 100644
index 0000000..42651bd
--- /dev/null
+++ b/components/python/pydantic_core/pkg5
@@ -0,0 +1,15 @@
+{
+    "dependencies": [
+        "library/python/maturin-39",
+        "library/python/typing-extensions-39",
+        "runtime/python-39",
+        "system/library",
+        "system/library/gcc-13-runtime",
+        "system/library/math"
+    ],
+    "fmris": [
+        "library/python/pydantic-core",
+        "library/python/pydantic-core-39"
+    ],
+    "name": "pydantic_core"
+}
diff --git a/components/python/pydantic_core/pydantic_core-PYVER.p5m b/components/python/pydantic_core/pydantic_core-PYVER.p5m
new file mode 100644
index 0000000..37061ad
--- /dev/null
+++ b/components/python/pydantic_core/pydantic_core-PYVER.p5m
@@ -0,0 +1,40 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# This file was automatically generated using python-integrate-project
+#
+
+set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)-$(PYV)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.human-version value=$(HUMAN_VERSION)
+set name=pkg.summary value="$(COMPONENT_SUMMARY)"
+set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+
+license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
+
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core-$(HUMAN_VERSION).dist-info/METADATA
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core-$(HUMAN_VERSION).dist-info/WHEEL
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core-$(HUMAN_VERSION).dist-info/license_files/LICENSE
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core/__init__.py
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core/_pydantic_core.cpython-$(PYV).so
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core/_pydantic_core.pyi
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core/core_schema.py
+file path=usr/lib/python$(PYVER)/vendor-packages/pydantic_core/py.typed
+
+# python modules are unusable without python runtime binary
+depend type=require fmri=__TBD pkg.debug.depend.file=python$(PYVER) \
+    pkg.debug.depend.path=usr/bin
+
+# Automatically generated dependencies based on distribution metadata
+depend type=require fmri=pkg:/library/python/typing-extensions-$(PYV)
diff --git a/components/python/pydantic_core/python-integrate-project.conf b/components/python/pydantic_core/python-integrate-project.conf
new file mode 100644
index 0000000..3c91ec5
--- /dev/null
+++ b/components/python/pydantic_core/python-integrate-project.conf
@@ -0,0 +1,36 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2024 Marcel Telka
+#
+
+%patch% 01-pytest-plugins.patch
+
+%include-2%
+#
+# Following dependency loops were detected (where 'A --> B' means 'A needs B to
+# run tests', and 'A ==> B' means 'A needs B for build and/or run'):
+#
+# pydantic_core --> dirty_equals --> pydantic ==> pydantic_core
+#
+# To break loops we need to allow this project to integrate without testing in
+# a case the required projects are not available yet (bootstrap).
+#
+PYTHON_TEST_BOOTSTRAP = yes
+%include-3%
+# https://www.illumos.org/issues/15767
+LD_Z_IGNORE=
+
+# This project does not support tox so we need to provide test requirements
+# manually.
+TEST_REQUIREMENTS += tests/requirements.txt
+TEST_REQUIRED_PACKAGES.python += library/python/pytest-benchmark

--
Gitblit v1.9.3