canonical / mysql-operator

Machine charm for MySQL following the operator framework
https://charmhub.io/mysql
Apache License 2.0
7 stars 10 forks source link

fix: ensure that poetry is available to tox #368

Closed tonyandrewmeyer closed 9 months ago

tonyandrewmeyer commented 9 months ago

Issue

If you don't have poetry installed locally (and on your PATH) then cloning the repo and running tox will fail (because tox tries to use poetry to set up the test requirements).

Solution

Have tox install poetry as a dependency. I haven't pinned it at all - I'm not sure if you would prefer to do that or not (but currently you're using whatever poetry people have on their system, or is in the CI runner, so that's also unpinned in a way). I can do that if you pick a version, or feel free to adjust it yourself of course.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (19c37be) 65.92% compared to head (6f02c3c) 65.92%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #368 +/- ## ======================================= Coverage 65.92% 65.92% ======================================= Files 17 17 Lines 3120 3120 Branches 410 410 ======================================= Hits 2057 2057 Misses 935 935 Partials 128 128 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

carlcsaposs-canonical commented 9 months ago

This is intentional. We're using poetry to manage virtual environment dependencies instead of tox. Installing poetry inside a tox virtual environment can become a nightmare to debug and isn't how poetry is meant to be used. More details: https://python-poetry.org/docs/faq/#is-tox-supported

One issue with installing poetry in the virtual environment is that poetry & its dependencies are now added to the virtual env which can cause dependency conflicts

We ran into issues before when poetry was installed in a tox environment. I can't remember off the top of my head, but if you're curious I can go digging and provide more concrete examples