Skip to content

ci: migrate from poetry to uv#561

Merged
tombh merged 1 commit into
mainfrom
migrate-to-uv
Jun 29, 2025
Merged

ci: migrate from poetry to uv#561
tombh merged 1 commit into
mainfrom
migrate-to-uv

Conversation

@tombh

@tombh tombh commented Jun 28, 2025

Copy link
Copy Markdown
Collaborator

Code review checklist (for code reviewer to complete)

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Commit messages are meaningful (see [this][commit messages] for details)
  • Tests have been included and/or updated, as appropriate
  • Docstrings have been included and/or updated, as appropriate
  • Standalone docs have been updated accordingly

@tombh tombh force-pushed the migrate-to-uv branch 2 times, most recently from 029ebe9 to 17111fe Compare June 28, 2025 19:49
@tombh tombh requested a review from alcarney June 28, 2025 19:58
@tombh

tombh commented Jun 28, 2025

Copy link
Copy Markdown
Collaborator Author

I think it's improved the test runtime by almost double!??

@alcarney alcarney left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@tombh tombh merged commit 3fe9778 into main Jun 29, 2025
18 checks passed
@tombh tombh deleted the migrate-to-uv branch June 29, 2025 00:03
@tombh

tombh commented Jun 29, 2025

Copy link
Copy Markdown
Collaborator Author

Thanks!

@alcarney

Copy link
Copy Markdown
Collaborator

Hopefully, I'm just missing something but this appears to have broken things for me...

❯ make test
/home/alex/.local/bin/uv run --all-extras poe test
Poe => pytest --cov
/home/linuxbrew/.linuxbrew/lib/python3.13/site-packages/_pytest/config/__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: ImportError: cannot import name 'AttrsInstance' from 'attrs' (/home/linuxbrew/.linuxbrew/lib/python3.13/site-packages/attrs/__init__.py) (from /var/home/alex/Projects/openlawlibrary/pygls/main/tests/conftest.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
ImportError while loading conftest '/var/home/alex/Projects/openlawlibrary/pygls/main/tests/conftest.py'.
tests/conftest.py:27: in <module>
    from lsprotocol import converters, types
/home/alex/.local/lib/python3.13/site-packages/lsprotocol/converters.py:6: in <module>
    import cattrs
/home/alex/.local/lib/python3.13/site-packages/cattrs/__init__.py:3: in <module>
    from .converters import BaseConverter, Converter, GenConverter, UnstructureStrategy
/home/alex/.local/lib/python3.13/site-packages/cattrs/converters.py:63: in <module>
    from .disambiguators import create_default_dis_func, is_supported_union
/home/alex/.local/lib/python3.13/site-packages/cattrs/disambiguators.py:11: in <module>
    from attrs import NOTHING, Attribute, AttrsInstance
E   ImportError: cannot import name 'AttrsInstance' from 'attrs' (/home/linuxbrew/.linuxbrew/lib/python3.13/site-packages/attrs/__init__.py)
Poe => pytest tests/e2e --lsp-transport tcp
/home/linuxbrew/.linuxbrew/lib/python3.13/site-packages/_pytest/config/__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: ImportError: cannot import name 'AttrsInstance' from 'attrs' (/home/linuxbrew/.linuxbrew/lib/python3.13/site-packages/attrs/__init__.py) (from /var/home/alex/Projects/openlawlibrary/pygls/main/tests/conftest.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
ImportError while loading conftest '/var/home/alex/Projects/openlawlibrary/pygls/main/tests/conftest.py'.
tests/conftest.py:27: in <module>
    from lsprotocol import converters, types
/home/alex/.local/lib/python3.13/site-packages/lsprotocol/converters.py:6: in <module>
    import cattrs
/home/alex/.local/lib/python3.13/site-packages/cattrs/__init__.py:3: in <module>
    from .converters import BaseConverter, Converter, GenConverter, UnstructureStrategy
/home/alex/.local/lib/python3.13/site-packages/cattrs/converters.py:63: in <module>
    from .disambiguators import create_default_dis_func, is_supported_union
/home/alex/.local/lib/python3.13/site-packages/cattrs/disambiguators.py:11: in <module>
    from attrs import NOTHING, Attribute, AttrsInstance
E   ImportError: cannot import name 'AttrsInstance' from 'attrs' (/home/linuxbrew/.linuxbrew/lib/python3.13/site-packages/attrs/__init__.py)
Poe => pytest tests/e2e --lsp-transport websockets
/home/linuxbrew/.linuxbrew/lib/python3.13/site-packages/_pytest/config/__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: ImportError: cannot import name 'AttrsInstance' from 'attrs' (/home/linuxbrew/.linuxbrew/lib/python3.13/site-packages/attrs/__init__.py) (from /var/home/alex/Projects/openlawlibrary/pygls/main/tests/conftest.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
ImportError while loading conftest '/var/home/alex/Projects/openlawlibrary/pygls/main/tests/conftest.py'.
tests/conftest.py:27: in <module>
    from lsprotocol import converters, types
/home/alex/.local/lib/python3.13/site-packages/lsprotocol/converters.py:6: in <module>
    import cattrs
/home/alex/.local/lib/python3.13/site-packages/cattrs/__init__.py:3: in <module>
    from .converters import BaseConverter, Converter, GenConverter, UnstructureStrategy
/home/alex/.local/lib/python3.13/site-packages/cattrs/converters.py:63: in <module>
    from .disambiguators import create_default_dis_func, is_supported_union
/home/alex/.local/lib/python3.13/site-packages/cattrs/disambiguators.py:11: in <module>
    from attrs import NOTHING, Attribute, AttrsInstance
E   ImportError: cannot import name 'AttrsInstance' from 'attrs' (/home/linuxbrew/.linuxbrew/lib/python3.13/site-packages/attrs/__init__.py)
Error: Subtasks 'test[0]', 'test[1]', 'test[2]' returned non-zero exit status
make: *** [Makefile:14: test] Error 1

@alcarney

alcarney commented Jun 29, 2025

Copy link
Copy Markdown
Collaborator

Looks like there's something funky going on with my main system...
why is it pulling packages from my user profile and not the .venv created by uv? 🤷‍♂️

/home/alex/.local/lib/python3.13/site-packages/lsprotocol/converters.py:6: in <module>

Running this in the devcontainer works better, but despite installing websockets in the .venv the tests are convinced it's not there

ERROR    pygls.client:client.py:144 Run `pip install pygls[ws]` to install dependencies required for websockets.
Traceback (most recent call last):
  File "/workspaces/main/pygls/client.py", line 142, in start_ws
    from websockets.asyncio.client import connect
ModuleNotFoundError: No module named 'websockets'

@alcarney

alcarney commented Jun 29, 2025

Copy link
Copy Markdown
Collaborator

Taking a peek at the Github actions workflow definition, looks like the makefile is missing --group test and it appears like it's now working for me - even on my main system! 🤞

Will open a PR, as I'm making a few other tweaks to the Makefile anyway :)

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

Successfully merging this pull request may close these issues.

2 participants