ansys / ansys-templates

A tool for creating new projects according to Ansys guidelines
https://templates.ansys.com
MIT License
11 stars 4 forks source link

fix: updating poetry.lock before local wheels are used in solution template #495

Closed JoseRamonRodriguez closed 3 months ago

JoseRamonRodriguez commented 3 months ago

It is considered as a good practice that whenever you change the pyproject.toml file, you should run poetry lock --no-update afterwards to sync the poetry.lock files with those changes. This is what we do when some packages are provided as wheel files through the setup_environment.py. The --no-update flag tries to preserve existing versions of dependencies.

In this PR I am executing poetry lock --no-update as part of setup_environment.py before installing dependencies.

nick-marnik commented 3 months ago

@JoseRamonRodriguez Can you please elaborate on the context that triggered the need for this change?

I am not totally opposed to it, but I'm not sure it is the right approach to take. To prevent situations where the TOML file and the lock file get out-of-sync, we use:

Specific to the solution template in this repo, we also rely on the E2E solution tests to validate the lock file since the TOML file contains placeholders and is technically invalid TOML. These tests tend to break and I'm not sure they are monitored, so we may need to investigate their current state.

We also have the -F option available on the setup script to allow developers to delete the poetry.lock file.

My concerns: