windmill-labs / windmill

Open-source developer platform to power your entire infra and turn scripts into webhooks, workflows and UIs. Fastest workflow engine (13x vs Airflow). Open-source alternative to Retool and Temporal.
https://windmill.dev
Other
10.1k stars 492 forks source link

bug: [cloud version] supabase + wmill imports clashing in Python script node #2220

Closed djpecot closed 1 year ago

djpecot commented 1 year ago

Describe the bug

Followed a simple flow like here: https://www.windmill.dev/docs/advanced/imports#imports-in-python

And am currently unable to manually connect Supabase APAI (I need to access buckets, not via SQL), but am getting an error that seems to do with httpx versions mismatching?

I popped the log in perplexity and it mentioned some options I don't think I as an end user on the cloud platform am able to do.

To reproduce

Use this as your script in either a flow script or stand-alone script (not sure the terminology)

# requirements:
# wmill==1.165.0
# supabase==1.0.4

from supabase import create_client, Client
import wmill

Expected behavior

Clean non-clashing imports.

Screenshots

No response

Browser information

Version 1.56.14 Chromium: 115.0.5790.114 (Official Build) (x86_64)

Application version

EE v1.165.0-4-ge31d843b

Additional Context

Here's the actual output:

job 018a524c-395e-ddbe-db14-bec0ead8840f on worker wk-kzt76-TIAt4 (tag: python3)

resolving dependencies...
content of requirements:
wmill==1.165.0
supabase==1.0.4

  ERROR: Cannot install -r requirements.in (line 2), supabase and wmill because these package versions have conflicting dependencies.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
    result = self._result = resolver.resolve(
                            ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 439, in resolve
    raise ResolutionImpossible(self.state.backtrack_causes)
pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('httpx<0.25.0,>=0.24.0'), parent=LinkCandidate('https://files.pythonhosted.org/packages/c8/4e/0c3de18a974ce3de609fb68f7666c9a1915bfd7f8335c39a0871c3232173/supabase-1.0.4-py3-none-any.whl (from https://pypi.org/simple/supabase/) (requires-python:>=3.8,<4.0)')), RequirementInformation(requirement=SpecifierRequirement('httpx<0.25,>=0.23'), parent=LinkCandidate('https://files.pythonhosted.org/packages/4d/27/d931765f09fbd295162943aedf327f9a69d9cb75c8eb2adaf75adffc4f1d/gotrue-1.0.3-py3-none-any.whl (from https://pypi.org/simple/gotrue/) (requires-python:>=3.8,<4.0)')), RequirementInformation(requirement=SpecifierRequirement('httpx<0.25.0,>=0.24.0'), parent=LinkCandidate('https://files.pythonhosted.org/packages/e9/3d/2d9596a4c0e8c7a98527d6da70fcc98c55bfb81d01de3af0f878002bcfe4/postgrest-0.10.8-py3-none-any.whl (from https://pypi.org/simple/postgrest/) (requires-python:>=3.8,<4.0)')), RequirementInformation(requirement=SpecifierRequirement('httpx<0.25,>=0.23'), parent=LinkCandidate('https://files.pythonhosted.org/packages/19/2e/83ebbab871bad3ae76ed5538d18d8d36cf09089a03911b0cbc8624bf4af5/storage3-0.5.3-py3-none-any.whl (from https://pypi.org/simple/storage3/) (requires-python:>=3.8,<4.0)')), RequirementInformation(requirement=SpecifierRequirement('httpx<0.25.0,>=0.24.0'), parent=LinkCandidate('https://files.pythonhosted.org/packages/98/a5/a4b7dc847ec96185503d8b7d3f4bace91af2c336f98eb735d0beb0d0bd22/supafunc-0.2.3-py3-none-any.whl (from https://pypi.org/simple/supafunc/) (requires-python:>=3.8,<4.0)')), RequirementInformation(requirement=SpecifierRequirement('httpx<0.24.0,>=0.15.4'), parent=LinkCandidate('https://files.pythonhosted.org/packages/6e/b0/78256bd964daad267e9c2676081cbbc8419a657b092bd5413da843df7298/windmill_api-1.165.0-py3-none-any.whl (from https://pypi.org/simple/windmill-api/) (requires-python:>=3.7,<4.0)'))]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/local/bin/pip-compile", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/piptools/scripts/compile.py", line 659, in cli
    results = resolver.resolve(max_rounds=max_rounds)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/piptools/resolver.py", line 604, in resolve
    is_resolved = self._do_resolve(
                  ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/piptools/resolver.py", line 636, in _do_resolve
    resolver.resolve(
  File "/usr/local/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 101, in resolve
    raise error from e
pip._internal.exceptions.DistributionNotFound: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
{
    "error": {
        "name": "ExecutionErr",
        "message": "error during execution of the script:\npip compile failed: Lock file generation failed: ExitStatus(1)"
    }
}
rubenfiszel commented 1 year ago

wmill use an older version of httpx because we pin the generator to an older version:

RUN pipx install openapi-python-client==0.11.6 --include-deps

We just need to test everything work properly with a newer version and this should be solved

rubenfiszel commented 1 year ago

I looked a bit and the newer versions generate the client in slightly different ways which might require us or not to redesign the client. Will investigate more this weekend.

djpecot commented 1 year ago

Sounds good. To save a little time, even giving a broader range like

wmill>=1.0.0
supabase>=1.0.0

didn't fix anything. I thought giving a range of possible libraries might help, but I'm no pro at dep management :)

rubenfiszel commented 1 year ago

Solved starting in wmill 1.166.0