bluerobotics / BlueOS

The open source platform for ROV, USV, robotic system operation, development, and expansion.
https://blueos.cloud/docs/
Other
123 stars 67 forks source link

fix pre-push hooks, and move to Poetry #2677

Closed joaoantoniocardoso closed 2 weeks ago

joaoantoniocardoso commented 3 weeks ago

This migrates the hooks/pre-push to use Poetry directly, and makes all the files contained within the project's virtual environment, instead of loading files on the users' folder, making the development environment more replicable.

To use the pre-push, the user must have a Python 3.11 available. Before, it would use whatever the system's Python was, failing to run when the user had 3.12 or 3.10 for example.

To test:

To check whether it had any impact on the normal installation:

I have tested it myself, but more samples are welcome.

After this patch is merged, we can all clean our system:

Williangalvani commented 2 weeks ago

works great once it works! but I had to manually configure a local python3.11 with pyenv. can we add a check for python version and add hints on how to set it up?

joaoantoniocardoso commented 2 weeks ago

@Williangalvani is the command python3.11 available when using pyenv, or should I use some pyenv command to figure it out?

Williangalvani commented 2 weeks ago

@Williangalvani is the command python3.11 available when using pyenv, or should I use some pyenv command to figure it out?

once you do pyenv local 3.11, python3.11 is available on path

altenatively, pyenv versions show the versions available on your system:

➜  ~ pyenv versions
* system (set by /home/will/.pyenv/version)
  3.7.9
  3.8.18
  3.11.9
joaoantoniocardoso commented 2 weeks ago

@Williangalvani

Okay, I rewrote the Python check code to automatically use pyenv if it's available

Williangalvani commented 2 weeks ago

working well locally here

joaoantoniocardoso commented 2 weeks ago

@Williangalvani I just rebased, some of the commits were already merged.