-
Notifications
You must be signed in to change notification settings - Fork 75
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
Remove --upgrade
from pip install
#1136
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,26 +239,26 @@ def _install_dependencies(self, staging_venv_dir): | |
with instrum.Timer("Installing all dependencies"): | ||
if self.binary_python_packages: | ||
# install python packages, allowing binary packages | ||
cmd = [pip_cmd, "install", "--upgrade"] # base command | ||
cmd = [pip_cmd, "install"] # base command | ||
cmd.extend(self.binary_python_packages) # the python packages to install | ||
_process_run(cmd) | ||
|
||
if self.python_packages: | ||
# install python packages from source | ||
cmd = [pip_cmd, "install", "--upgrade", "--no-binary", ":all:"] # base command | ||
cmd = [pip_cmd, "install", "--no-binary", ":all:"] # base command | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like the Jupyter notebooks charm is failing because of this (see spread test. Between this and the above, I'm wondering whether the right change for now might be to keep the I believe that'll resolve #1135 with a fairly minimal change that we can put into a 2.4 release fairly quickly, with a bigger rethink of package handling for a future release. How's that sound? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or we can change the order of install There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So if a pinned version is installed, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was my original thought, but it could leave us with invalid PYDEPS that we won't discover until runtime. Example: PYDEPS includes Ideal behaviour would probably be to error out during the charm build due to a dependency conflict. However:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then we need to check all deps in charmcraft without rely on pip There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or maybe we can add |
||
cmd.extend(self.python_packages) # the python packages to install | ||
_process_run(cmd) | ||
|
||
if self.requirement_paths: | ||
# install dependencies from requirement files | ||
cmd = [pip_cmd, "install", "--upgrade", "--no-binary", ":all:"] # base command | ||
cmd = [pip_cmd, "install", "--no-binary", ":all:"] # base command | ||
for reqspath in self.requirement_paths: | ||
cmd.append("--requirement={}".format(reqspath)) # the dependencies file(s) | ||
_process_run(cmd) | ||
|
||
if self.charmlib_deps: | ||
# install charmlibs python dependencies | ||
cmd = [pip_cmd, "install", "--upgrade", "--no-binary", ":all:"] # base command | ||
cmd = [pip_cmd, "install", "--no-binary", ":all:"] # base command | ||
cmd.extend(self.charmlib_deps) # the python packages to install | ||
_process_run(cmd) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
summary: pack a charm with a specific (old) dependency version | ||
|
||
include: | ||
- tests/ | ||
|
||
prepare: | | ||
tests.pkgs install unzip | ||
charmcraft init --project-dir=charm | ||
cd charm | ||
echo "ops==2.0.0" > requirements.txt | ||
|
||
cat <<- EOF >> charmcraft.yaml | ||
parts: | ||
charm: | ||
charm-requirements: [requirements.txt] | ||
EOF | ||
|
||
mkdir -p lib/charms/charm/v0/ | ||
cat <<- EOF > lib/charms/charm/v0/my_lib.py | ||
PYDEPS = ["ops"] | ||
LIBID = "my_lib" | ||
LIBAPI = 0 | ||
LIBPATCH = 1 | ||
EOF | ||
|
||
|
||
restore: | | ||
pushd charm | ||
charmcraft clean | ||
popd | ||
|
||
rm -rf charm | ||
|
||
execute: | | ||
cd charm | ||
charmcraft pack --verbose | ||
test -f charm*.charm | ||
unzip -p charm_*.charm venv/ops/version.py | MATCH "version = '2.0.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.
This change is breaking centos 7. I'm not sure what the best way to handle it is, so I'm going to tag in @syu-w for thoughts. My best proposal right now is to add a
pip install --upgrade pip setuptools
run before starting any of the conditional installs.