Overv / outrun

Execute a local command using the processing power of another Linux machine.
Apache License 2.0
3.12k stars 64 forks source link

Use default_factory in Config dataclass #20

Closed evan-goode closed 1 year ago

evan-goode commented 1 year ago

Fixes #19. You can't use something mutable as the default value for a field on a dataclass. Similar to how it's bad practice to use something mutable as a kwarg default; as in:

def foo(bar=[]):
Overv commented 1 year ago

I know that this is a bug that needed to be fixed, but do you know why Python has only started complaining about this recently?

evan-goode commented 1 year ago

There is this change: https://docs.python.org/3.11/whatsnew/3.11.html#dataclasses, but I have no idea how the reporter of #19 could be experiencing the bug on 3.7.

Overv commented 1 year ago

@evan-goode Thanks for the info and contribution, I suppose @erentar may have made a mistake.

evan-goode commented 1 year ago

Thanks! Useful tool!

erentar commented 1 year ago

@evan-goode Thanks for the info and contribution, I suppose @erentar may have made a mistake.

I installed the package using pipx and specifying the version using the command pipx install outrun --python /usr/bin/python3.7

I can supply more information as requested

evan-goode commented 1 year ago

@evan-goode Thanks for the info and contribution, I suppose @erentar may have made a mistake.

I installed the package using pipx and specifying the version using the command pipx install outrun --python /usr/bin/python3.7

I can supply more information as requested

Hmm, could this be a bug in pipx or something? Could you run

which outrun

and make sure it points to pipx's installation? And perhaps check

~/.local/pipx/venvs/outrun/bin/python --version

and maybe even make sure the shebang on outrun points to the right python binary:

head -n1 ~/.local/pipx/venvs/outrun/bin/outrun