Use non-editable installs for test generators#4634
Conversation
a92cb7c to
57e2149
Compare
|
Could a maintainer please trigger Generate Vectors to test the fix? Repo: Ref: |
|
I'm not a maintainer but I ran it locally and it works fine now! Thanks for fixing it. If we ever need pickling support, the C libraries can be wrapped easily, e.g., for from collections.abc import Hashable
from typing import Any, Generic, TypeVar
from lru import LRU as OrigLRU
_KT = TypeVar("_KT", bound=Hashable)
_VT = TypeVar("_VT")
class LRU(Generic[_KT, _VT]):
def __init__(self, size):
self.cache_dict = OrigLRU(size=size)
def __contains__(self, __o: Any) -> bool:
return self.cache_dict.__contains__(__o)
def __getitem__(self, item: _KT) -> _VT:
return self.cache_dict.__getitem__(item)
def __setitem__(self, key: _KT, value: _VT) -> None:
self.cache_dict.__setitem__(key, value)
def __reduce__(self):
return (self.__class__, (self.cache_dict.get_size()))with However, #4633's long term plan suggests to move away from pickling entirely. Still leaving the comment in case it becomes an issue in the future. |
|
Thanks for verifying, @etan-status! And thanks for your alternative suggestion - your approach seems absolutely valid 👍 I'm happy if maintainers prefer to apply your suggestion over the less intrusive "hotfix" in this PR. These are the reasons I took the approach in this PR:
|
|
I like this PR as is, my comment was more meant as further documentation in case pickling gets revisited later on. Status quo worked well, no reason to change it on a whim. |
jtraglia
left a comment
There was a problem hiding this comment.
LGTM, thanks @danceratopz! Can confirm it fixes the issue.
Adds `--reinstall-package=eth2spec` for `uv run` commands used with editable installs. This will ensure that `uv` doesn't used a cached version of `eth2spec` (consensus-specs) and ensure that the most recent version of repo source is used when generating test vectors during local development. Follow-up fix to: - #4627 and, in particular: - #4634
Fixes up a regression introduced in:
pyproject.tomland useuvfor project management #4627This issue describes the problem and fix:
This will cause the venv to flip-flop between installing
eth2specin editable and non-editable modes if you switch between non-generator/generator targets. But that should be ok;uv's good at that :)