Skip to content

Fideslang cannot be imported as a package above 3.12 #204

@tariqajyusuf

Description

@tariqajyusuf

When trying to include Fideslang into a project, I receive an error likely originating from pydantic:

...
error: the configured Python interpreter version (3.14) is newer than PyO3's maximum supported version (3.12)
    |   = help: please check if an updated version of PyO3 is available. Current version: 0.21.1
    |   = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI
    | warning: build failed, waiting for other jobs to finish...
    | 💥 maturin failed
    |   Caused by: Failed to build a native library through cargo
    |   Caused by: Cargo build finished with "exit status: 101": `env -u CARGO MACOSX_DEPLOYMENT_TARGET="11.0" PYO3_BUILD_EXTENSION_MODULE="1" PYO3_ENVIRONMENT_SIGNATURE="cpython-3.14-64bit" PYO3_PYTHON="/var/folders/86/d03mtb217cj1vvlhtng6z40w0000gn/T/tmpsodtj4za/.venv/bin/python" PYTHON_SYS_EXECUTABLE="/var/folders/86/d03mtb217cj1vvlhtng6z40w0000gn/T/tmpsodtj4za/.venv/bin/python" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/private/var/folders/86/d03mtb217cj1vvlhtng6z40w0000gn/T/tmpawrghvvx/pydantic_core-2.18.2/Cargo.toml" "--release" "--lib" "--crate-type" "cdylib" "--" "-C" "link-arg=-undefined" "-C" "link-arg=dynamic_lookup" "-C" "link-args=-Wl,-install_name,@rpath/pydantic_core._pydantic_core.cpython-314-darwin.so"`
    | Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/var/folders/86/d03mtb217cj1vvlhtng6z40w0000gn/T/tmpsodtj4za/.venv/bin/python', '--compatibility', 'off'] returned non-zero exit status 1

Upon trying to set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 in my environment, the dependency install still fails:

error: failed to run custom build command for `pydantic-core v2.18.2 (/private/var/folders/86/d03mtb217cj1vvlhtng6z40w0000gn/T/tmpnz0nq_1k/pydantic_core-2.18.2)`
    | 
    | Caused by:
    |   process didn't exit successfully: `/private/var/folders/86/d03mtb217cj1vvlhtng6z40w0000gn/T/tmpnz0nq_1k/pydantic_core-2.18.2/target/release/build/pydantic-core-733339ca6174934f/build-script-build` (exit status: 101)
    |   --- stdout
    |   cargo:rustc-cfg=Py_3_6
    |   cargo:rustc-cfg=Py_3_7
    |   cargo:rustc-cfg=Py_3_8
    |   cargo:rustc-cfg=Py_3_9
    |   cargo:rustc-cfg=Py_3_10
    |   cargo:rustc-cfg=Py_3_11
    |   cargo:rustc-cfg=Py_3_12
    |   cargo:rustc-cfg=Py_3_13
    |   cargo:rustc-cfg=Py_3_14
    |   cargo:rustc-cfg=Py_LIMITED_API
    |   cargo:rerun-if-changed=python/pydantic_core/core_schema.py
    |   cargo:rerun-if-changed=generate_self_schema.py
    | 
    |   --- stderr
    |   Traceback (most recent call last):
    |     File "/private/var/folders/86/d03mtb217cj1vvlhtng6z40w0000gn/T/tmpnz0nq_1k/pydantic_core-2.18.2/generate_self_schema.py", line 193, in eval_forward_ref
    |       return type_._evaluate(core_schema.__dict__, None, set())
    |              ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
    | 
    |   During handling of the above exception, another exception occurred:
    | 
    |   Traceback (most recent call last):
    |     File "/private/var/folders/86/d03mtb217cj1vvlhtng6z40w0000gn/T/tmpnz0nq_1k/pydantic_core-2.18.2/generate_self_schema.py", line 241, in <module>
    |       main()
    |       ~~~~^^
    |     File "/private/var/folders/86/d03mtb217cj1vvlhtng6z40w0000gn/T/tmpnz0nq_1k/pydantic_core-2.18.2/generate_self_schema.py", line 211, in main
    |       value = get_schema(s, definitions)
    |     File "/private/var/folders/86/d03mtb217cj1vvlhtng6z40w0000gn/T/tmpnz0nq_1k/pydantic_core-2.18.2/generate_self_schema.py", line 55, in get_schema
    |       return type_dict_schema(obj, definitions)
    |     File "/private/var/folders/86/d03mtb217cj1vvlhtng6z40w0000gn/T/tmpnz0nq_1k/pydantic_core-2.18.2/generate_self_schema.py", line 153, in type_dict_schema
    |       field_type = eval_forward_ref(field_type)
    |     File "/private/var/folders/86/d03mtb217cj1vvlhtng6z40w0000gn/T/tmpnz0nq_1k/pydantic_core-2.18.2/generate_self_schema.py", line 196, in eval_forward_ref
    |       return type_._evaluate(core_schema.__dict__, None)
    |              ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
    | 
    |   thread 'main' panicked at build.rs:29:9:

In debugging this I also noticed that fideslang cannot be built with python versions above 3.9. I suspect these issues may be related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions