ynput / ayon-launcher

AYON desktop application launcher
Apache License 2.0
31 stars 13 forks source link

Chore: Scripts don't rely on POETRY_HOME env variable #142

Closed iLLiCiTiT closed 1 month ago

iLLiCiTiT commented 1 month ago

Changelog Description

Manage.ps1 and make.sh scripts do not rely on POETRY_HOME environment variable but always use relative path to repository.

Additional info

The scripts did rely on the environment variable value and did set the variable only if was not set already. If there is global env variable set for user, or user have terminal which has set the env variable from different script it uses wrong path which leads to confusion and potentially broken environment.

The environment variable is set only when create-env is called to define target path, which is not possible with arguments.

Testing notes:

  1. Remove ./.poetry/ with it's content (and ./.venv/).
  2. Open terminal and set env variable POETRY_HOME to some random directory.
  3. Run ./manage.ps1 create-env on windows or ./make.sh create-env on linux/macOs
  4. It should install poetry to the repository instead of the path set in POETRY_HOME.
  5. Re-open terminal and run ./manage.ps1 run on windows or ./make.sh run on linux/macOs.
  6. It should start AYON launcher even if POETRY_HOME is not set.
antirotor commented 1 month ago

I still think it is correct to use POETRY_HOME if set explicitly by the user. It should work the same as with other variables like PATH, or PYTHONHOME or LD_LIBRARY_PATH.

so where is:

poetry_home_root="$repo_root/.poetry"

should be something like poetry_home_root = $POETRY_HOME or "$repo_root/.poetry"

iLLiCiTiT commented 1 month ago

I still think it is correct to use POETRY_HOME if set explicitly by the user. It should work the same as with other variables like PATH, or PYTHONHOME or LD_LIBRARY_PATH.

Did you know about anyone who would like to use different location for poetry in ayon launcher? We have scripts based on that location.