Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Aug 6, 2024

Conversation

iLLiCiTiT
Copy link
Member

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.

@iLLiCiTiT iLLiCiTiT merged commit 96ea5f6 into develop Aug 6, 2024
1 check passed
@iLLiCiTiT iLLiCiTiT deleted the enhancement/poetry-home-variable branch August 6, 2024 14:27
@antirotor
Copy link
Member

antirotor commented Aug 6, 2024

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
Copy link
Member Author

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.

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.

3 participants