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

error, with pydantic core #1500

Closed
Progamercursa1 opened this issue Oct 23, 2024 · 4 comments
Closed

error, with pydantic core #1500

Progamercursa1 opened this issue Oct 23, 2024 · 4 comments

Comments

@Progamercursa1
Copy link

error: failed to run custom build command for pydantic-core v2.14.5 (C:\Users\litvi\AppData\Local\Temp\pip-install-gnrpxnw1\pydantic-core_3d8c8d0bdb7f4fd781867a9a2a256457)

  Caused by:
    process didn't exit successfully: `C:\Users\litvi\AppData\Local\Temp\pip-install-gnrpxnw1\pydantic-core_3d8c8d0bdb7f4fd781867a9a2a256457\target\release\build\pydantic-core-1f7ecd8c544c2fc8\build-script-build` (exit code: 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:rerun-if-changed=python/pydantic_core/core_schema.py
    cargo:rerun-if-changed=generate_self_schema.py

    --- stderr
    Traceback (most recent call last):
      File "C:\Users\litvi\AppData\Local\Temp\pip-install-gnrpxnw1\pydantic-core_3d8c8d0bdb7f4fd781867a9a2a256457\generate_self_schema.py", line 192, 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 "C:\Users\litvi\AppData\Local\Temp\pip-install-gnrpxnw1\pydantic-core_3d8c8d0bdb7f4fd781867a9a2a256457\generate_self_schema.py", line 240, in <module>
        main()
        ~~~~^^
      File "C:\Users\litvi\AppData\Local\Temp\pip-install-gnrpxnw1\pydantic-core_3d8c8d0bdb7f4fd781867a9a2a256457\generate_self_schema.py", line 210, in main
        value = get_schema(s, definitions)
      File "C:\Users\litvi\AppData\Local\Temp\pip-install-gnrpxnw1\pydantic-core_3d8c8d0bdb7f4fd781867a9a2a256457\generate_self_schema.py", line 54, in get_schema
        return type_dict_schema(obj, definitions)
      File "C:\Users\litvi\AppData\Local\Temp\pip-install-gnrpxnw1\pydantic-core_3d8c8d0bdb7f4fd781867a9a2a256457\generate_self_schema.py", line 152, in type_dict_schema
        field_type = eval_forward_ref(field_type)
      File "C:\Users\litvi\AppData\Local\Temp\pip-install-gnrpxnw1\pydantic-core_3d8c8d0bdb7f4fd781867a9a2a256457\generate_self_schema.py", line 195, 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:
    generate_self_schema.py failed with exit code: 1
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  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 code: 101": `"cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "C:\\Users\\litvi\\AppData\\Local\\Temp\\pip-install-gnrpxnw1\\pydantic-core_3d8c8d0bdb7f4fd781867a9a2a256457\\Cargo.toml" "--release" "--lib" "--crate-type" "cdylib"`
  Error: command ['maturin', 'pep517', 'build-wheel', '-i', 'C:\\Users\\litvi\\AppData\\Local\\Programs\\Python\\Python313\\python.exe', '--compatibility', 'off'] returned non-zero exit status 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pydantic-core
Failed to build pydantic-core
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pydantic-core)

@andy-maier
Copy link

I have the same problem with pydantic-core version 2.14.6 on Python 3.13. It does not happen on Python 3.11 or below. Did not test Python 3.12.

Log file with Python 3.13: https://github.com/zhmcclient/python-zhmcclient/actions/runs/11495456556/job/31995020656?pr=1685

@davidhewitt
Copy link
Contributor

Duplicate of #1366, please update.

@davidhewitt davidhewitt closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2024
@andy-maier
Copy link

The problem is this dependency (shown for Python 3.12):

$ python -m pipdeptree -p pydantic-core -r
pydantic_core==2.14.6
└── pydantic==2.5.3 [requires: pydantic_core==2.14.6]
    ├── safety==3.2.3 [requires: pydantic>=1.10.12]
    └── safety-schemas==0.0.7 [requires: pydantic~=2.5.0]
        └── safety==3.2.3 [requires: safety-schemas>=0.0.2]

But I agree that this is not the fault of pydantic or pydantic-core.

@andy-maier
Copy link

andy-maier commented Oct 24, 2024

Just for the record, and for future readers, I have reported this to the safety repo as pyupio/safety#620, along with our circumvention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants