Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] python3-pydantic: update to 2.2.1. #45722

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions srcpkgs/python3-annotated-types/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Template file for 'python3-annotated-types'
pkgname=python3-annotated-types
version=0.5.0
revision=1
build_style=python3-pep517
hostmakedepends="hatchling"
depends="python3"
checkdepends="python3-pytest"
short_desc="Reusable constraint types to use with typing.Annotated"
maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
license="MIT"
homepage="https://github.com/annotated-types/annotated-types"
distfiles="${PYPI_SITE}/a/annotated_types/annotated_types-${version}.tar.gz"
checksum=47cdc3490d9ac1506ce92c7aaa76c579dc3509ff11e098fc867e5130ab7be802

post_install() {
vlicense LICENSE
}
21 changes: 21 additions & 0 deletions srcpkgs/python3-dirty-equals/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Template file for 'python3-dirty-equals'
pkgname=python3-dirty-equals
version=0.6.0
revision=1
build_style=python3-pep517
# requires unpackaged pytest-examples and circular dependency on pydantic
make_check_args="--ignore=tests/test_docs.py --ignore=tests/test_other.py"
hostmakedepends="hatchling"
depends="python3-pytz"
checkdepends="${depends} python3-pytest"
short_desc="Doing dirty (but extremely useful) things with equals"
maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
license="MIT"
homepage="https://github.com/samuelcolvin/dirty-equals"
changelog="https://github.com/samuelcolvin/dirty-equals/releases"
distfiles="${PYPI_SITE}/d/dirty_equals/dirty_equals-${version}.tar.gz"
checksum=4c4e4b9b52670ad8b880c46734e5ffc52e023250ae817398b78b30e329c3955d

post_install() {
vlicense LICENSE
}
7 changes: 4 additions & 3 deletions srcpkgs/python3-inflect/template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Template file for 'python3-inflect'
pkgname=python3-inflect
version=6.0.4
version=7.0.0
revision=1
build_style=python3-pep517
hostmakedepends="python3-wheel python3-setuptools_scm"
Expand All @@ -10,9 +10,10 @@ short_desc="Correctly generate plurals, ordinals; convert numbers to words"
maintainer="icp <pangolin@vivaldi.net>"
license="MIT"
homepage="https://github.com/jaraco/inflect"
changelog="https://raw.githubusercontent.com/jaraco/inflect/main/CHANGES.rst"
changelog="https://raw.githubusercontent.com/jaraco/inflect/main/NEWS.rst"
distfiles="${PYPI_SITE}/i/inflect/inflect-${version}.tar.gz"
checksum=1842649a17b6cad66812a5c9bdfacb6310e1e7b6dd8a31f026766df1b62612eb
checksum=63da9325ad29da81ec23e055b41225795ab793b4ecb483be5dc1fa363fd4717e
make_check_pre="env PY_IGNORE_IMPORTMISMATCH=1"

post_install() {
vlicense LICENSE
Expand Down
36 changes: 36 additions & 0 deletions srcpkgs/python3-pydantic-core/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Template file for 'python3-pydantic-core'
pkgname=python3-pydantic-core
version=2.6.1
revision=1
build_style=python3-pep517
build_helper=rust
hostmakedepends="maturin cargo"
makedepends="python3-typing_extensions"
depends="python3-typing_extensions"
checkdepends="${depends} python3-pytest python3-pytest-benchmark
python3-pytest-timeout python3-pytest-mock python3-hypothesis
python3-dirty-equals"
short_desc="Core functionality for pydantic-core validation and serialization"
maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
license="MIT"
homepage="https://github.com/pydantic/pydantic-core"
distfiles="${PYPI_SITE}/p/pydantic_core/pydantic_core-${version}.tar.gz"
checksum=5b4efa68bcfa6f2b93624c6660b6cf4b7b4336d4225afb314254a0ed9c9f4153

# taken from python3-adblock
if [ "$CROSS_BUILD" ]; then
makedepends+=" rust-std"
hostmakedepends+=" python3-typing_extensions"
export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
fi

do_build() {
maturin build -o . --release --target "${RUST_TARGET}" --manylinux off
mkdir -p dist
mv pydantic_core-${version}-*.whl dist/pydantic_core-${version}-py3-none-any.whl
}

post_install() {
vlicense LICENSE
}
38 changes: 38 additions & 0 deletions srcpkgs/python3-pydantic/patches/drop-fancy-pypi-readme-dep.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/pyproject.toml b/pyproject.toml
index aba4d03..d2af96e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,5 +1,5 @@
[build-system]
-requires = ['hatchling', 'hatch-fancy-pypi-readme>=22.5.0']
+requires = ['hatchling']
build-backend = 'hatchling.build'

[tool.hatch.version]
diff --git a/pyproject.toml b/pyproject.toml
index d2af96e..5ccd6f6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -128,22 +128,6 @@ Funding = 'https://github.com/sponsors/samuelcolvin'
Source = 'https://github.com/pydantic/pydantic'
Changelog = 'https://docs.pydantic.dev/latest/changelog/'

-[tool.hatch.metadata.hooks.fancy-pypi-readme]
-content-type = 'text/markdown'
-# construct the PyPI readme from README.md and HISTORY.md
-fragments = [
- {path = "README.md"},
- {text = "\n## Changelog\n\n"},
- {path = "HISTORY.md", pattern = "(.+?)<!-- package description limit -->"},
- {text = "\n... see [here](https://docs.pydantic.dev/changelog/#v0322-2019-08-17) for earlier changes.\n"},
-]
-# convert GitHuB issue/PR numbers and handles to links
-substitutions = [
- {pattern = '(\s+)#(\d+)', replacement = '\1[#\2](https://github.com/pydantic/pydantic/issues/\2)'},
- {pattern = '(\s+)@([\w\-]+)', replacement = '\1[@\2](https://github.com/\2)'},
- {pattern = '@@', replacement = '@'},
-]
-
[tool.pytest.ini_options]
testpaths = 'tests'
xfail_strict = true
18 changes: 10 additions & 8 deletions srcpkgs/python3-pydantic/template
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Template file for 'python3-pydantic'
pkgname=python3-pydantic
version=1.10.7
version=2.2.1
revision=1
build_style=python3-module
# added to stop test failing due to DeprecationWarning on pkg_resources import
make_check_args="-p no:warnings"
hostmakedepends="python3-setuptools"
depends="python3-typing_extensions"
checkdepends="${depends} python3-pytest python3-pytest-mock"
build_style=python3-pep517
# requires unpackaged pytest-examples
make_check_args="--ignore=tests/test_docs.py"
hostmakedepends="hatchling"
depends="python3-typing_extensions python3-annotated-types
python3-pydantic-core"
checkdepends="${depends} python3-pytest python3-pytest-benchmark
python3-pytest-mock python3-dirty-equals python3-Faker"
short_desc="Data parsing and validation using Python type hints"
maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
license="MIT"
homepage="https://github.com/pydantic/pydantic"
changelog="https://raw.githubusercontent.com/pydantic/pydantic/main/HISTORY.md"
distfiles="${PYPI_SITE}/p/pydantic/pydantic-${version}.tar.gz"
checksum=cfc83c0678b6ba51b0532bea66860617c4cd4251ecf76e9846fa5a9f3454e97e
checksum=31b5cada74b2320999fb2577e6df80332a200ff92e7775a52448b6b036fce24a

post_install() {
vlicense LICENSE
Expand Down