PrefectHQ / prefect

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
https://prefect.io
Apache License 2.0
15.81k stars 1.55k forks source link

griffe 1.0.0 causes breaking changes for prefect #14975

Closed N-Demir closed 3 weeks ago

N-Demir commented 3 weeks ago

Bug summary

Seems like griffe just released v1.0.0 that has breaking changes for fresh prefect installs. For example:

  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/prefect/client/orchestration.py", line 23, in <module>
    from prefect._internal.compatibility.experimental import (
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/prefect/_internal/compatibility/experimental.py", line 24, in <module>
    from prefect.settings import PREFECT_EXPERIMENTAL_WARN, SETTING_VARIABLES, Setting
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/prefect/settings.py", line 95, in <module>
    from prefect._internal.compatibility.deprecated import generate_deprecation_message
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/prefect/_internal/compatibility/deprecated.py", line 26, in <module>
    from prefect.utilities.callables import get_call_parameters
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/prefect/utilities/callables.py", line 24, in <module>
    from griffe.dataclasses import Docstring
ModuleNotFoundError: No module named 'griffe.dataclasses'

Looking at prefect's requirements.txt it seems like the version for griffe isn't locked? Maybe change that until the new version is compatible?

Version info (prefect version output)

2.16.8

Additional context

No response

desertaxle commented 3 weeks ago

Thanks for the issue @N-Demir!

The griffe dependency for prefect was pinned in https://github.com/PrefectHQ/prefect/pull/14675 which I believe was released in version 2.19.9. You can either pin griffe in your application or install prefect>=2.19.9 to avoid installing griffe>=1.0.0.

It looks like there isn't any issue for making the changes necessary to support griffe>=1.0.0, so this can be that issue! If anyone wants to make the necessary updates, leave a comment!

cicdw commented 3 weeks ago

@desertaxle we just got another report of this same issue and it appears we have duplicate (and inconsistent) griffe specs across the core requirements file and the client requirements file.

desertaxle commented 3 weeks ago

Ah interesting, it looks like the upper bound is in the 2.x, but not on main, so I'd expect the newer 2.x versions to work, but see issues with the 3rc versions. Either way, I'll go clean up the requirements on both branches.