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

Fix unversioned package update regression #167

Merged
merged 1 commit into from Apr 28, 2020
Merged

Conversation

johnsca
Copy link
Contributor

@johnsca johnsca commented Apr 28, 2020

Prior to #160, we were passing filenames to pip for the wheelhouse install rather than package names. It seems that using filenames implicitly disables pip's caching of package archive files. After #160, since we are now using package names rather than file names (which does allow pip to handle dependency resolution better), the packages were getting copied out of the wheelhouse directory and into pip's cache dir on the initial install and not updated unless the filename changed (i.e., the version number changed). Some of the OpenStack charms use a shared library directly from GitHub which doesn't bother tracking the library version, causing it to always have the same version.

Adding --no-cache-dir forces pip to always use the copy from the wheelhouse, even if it seems like it hasn't been changed, based on the file name.

This also switches from --ignore-installed to --force-reinstall because the latter is cleaner since the former can leave artifacts from previous package versions in the venv if they are removed from the newer package version.

Fixes #166

Prior to #160, we were passing filenames to pip for the wheelhouse
install rather than package names. It seems that using filenames
implicitly disables pip's caching of package archive files. After #160,
since we are now using package names rather than file names (which does
allow pip to handle dependency resolution better), the packages were
getting copied out of the wheelhouse directory and into pip's cache dir
on the initial install and not updated unless the filename changed
(i.e., the version number changed).  Some of the OpenStack charms use a
shared library directly from GitHub which doesn't bother tracking the
library version, causing it to always have the same version.

Adding `--no-cache-dir` forces pip to always use the copy from the
wheelhouse, even if it seems like it hasn't been changed, based on the
file name.

This also switches from `--ignore-installed` to `--force-reinstall`
because the latter is cleaner since the former can leave artifacts from
previous package versions in the venv if they are removed from the newer
pacakge version.

Fixes #166
Copy link
Contributor

@thedac thedac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed: This resolves the regression

@johnsca johnsca merged commit f8629db into master Apr 28, 2020
johnsca added a commit that referenced this pull request May 12, 2020
The change in #167 to use --force-reinstall, while significantly safer
overall does fail on bionic and earlier when using `use_venv: false`.
This was missed in the existing functional tests, so this adds tests to
cover that.
Cynerva pushed a commit to charmed-kubernetes/layer-basic that referenced this pull request Jun 1, 2020
…install

Fix unversioned package update regression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants