geopython / pygeoapi

pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
https://pygeoapi.io
MIT License
483 stars 259 forks source link

validate pydantic version when testing on Debian #1766

Open tomkralidis opened 1 month ago

tomkralidis commented 1 month ago

As discussed at FOSS4G Europe 2024 with @EdwardBetts and @pantierra (in support of pygeoapi on Debian):

https://hachyderm.io/@edward/112728302761775798

@EdwardBetts @pantierra can you confirm the Debian version?

On jammy (our current baseline):

dpkg -l | grep -i pydantic
ii  python3-pydantic            1.8.2-1                                 all          Data validation and settings management using Python type hinting

And a small script to test/reproduce (Debian sid):

docker run -it debian:sid
apt update -y && apt install python3-pydantic
from pydantic import BaseModel, Field

class Foo(BaseModel):
    api_version: str = Field(regex=r'^\d+\.\d+\..+$',
                             description="Semantic API version number.")

f = Foo(api_version='1.0.0')
francbartoli commented 1 month ago

regex is replaced by pattern when migrating from v1 to v2 docs. Atm, pygeoapi relies only to pydantic v1 while we are waiting for the debian package for v2 (the one based on rust)

pantierra commented 1 month ago

The current version in Debian sid is the latest v1 version 1.10.17, which already has the renaming from regex to pattern included before v2.

francbartoli commented 1 month ago

Sorry @pantierra, looking at the v1.10.17 tag in the field class I do see a regex parameter. Can you help me to find where it is the renamed pattern?