-
Notifications
You must be signed in to change notification settings - Fork 264
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
Fix #2342, and updates for Poetry 1.2 #2349
Conversation
Weird, hadolint passes locally. Wonder if I have an old version or something. Will fix when I get time. |
Actually it's the other way around - CI is using hadolint 2.7 but a locally built dev image has hadolint 2.10. Fails regardless when I run it locally against the actual branch in question 🤦 |
This seems to be a necessary fix as when we ship a new image we'll probably bring in Poetry 1.2 and plugin's development/testing images won't include the necessary dev dependencies at runtime: https://github.com/nautobot/nautobot-plugin-golden-config/blob/develop/development/Dockerfile#L42 |
Does the poetry installer at https://install.python-poetry.org/ support constraining the version with |
It does always install the latest version by default. We could (and probably should) constrain it with the |
This is how most plugins are installing Poetry: https://github.com/networktocode/gh-action-setup-poetry-environment/blob/main/action.yml |
Sure, though that's a virtualenv workflow, not a Docker workflow. I've added an explicit |
@@ -137,7 +137,7 @@ RUN apt-get update && \ | |||
# https://python-poetry.org/docs/master/#installing-with-the-official-installer | |||
# This also makes it so that Poetry will *not* be included in the "final" image since it's not installed to /usr/local/ | |||
RUN curl -sSL https://install.python-poetry.org -o /tmp/install-poetry.py && \ | |||
python /tmp/install-poetry.py && \ | |||
python /tmp/install-poetry.py --version 1.2.0 && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just double checking on the comment above. The installer should install it in a place other than /usr/local
but should we enforce this through providing --path
or $POETRY_HOME
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--path is for specifying where to find the file to install from, if I'm reading the script right. We could explicitly set POETRY_HOME I suppose but I feel like this is a pretty low risk.
@bryanculver any chance this can get cherry picked for 1.2 & 1.3 stable releases? Having some "fun" issues with poetry & development containers downstream for 1.2 & 1.3 |
Closes: #2342
What's Changed
poetry install --extras ...
followed bypoetry install
(without any--extras
) will result in Poetry removing the previously installed extras.dev
image to account for this changepoetry install --no-dev
is deprecated in favor ofpoetry install --only main
, so I've made that change.poetry cache clear --all PyPI
to thefinal-dev
image build, fixing Docker containers should not include a poetry cache #2342 (with a workaround for a couple of Poetry bugs)