Skip to content

Commit

Permalink
Updated infra python package version check to work without pip, dropp…
Browse files Browse the repository at this point in the history
…ed '--upgrade-pip-to' arg from dh_virtualenv
  • Loading branch information
zenmonkeykstop committed May 14, 2021
1 parent 2de94f2 commit fc78532
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion install_files/securedrop-app-code/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ override_dh_virtualenv:
dh_virtualenv \
--python=/usr/bin/python3 \
--builtin-venv \
--upgrade-pip-to "21.1.1" \
--preinstall setuptools-scm==6.0.1 \
--extra-pip-arg "--verbose" \
--extra-pip-arg "--no-deps" \
Expand Down
10 changes: 6 additions & 4 deletions molecule/testinfra/app/test_appenv.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os.path
import pytest

import testutils
Expand All @@ -9,9 +8,12 @@

@pytest.mark.parametrize('exp_pip_pkg', sdvars.pip_deps)
def test_app_pip_deps(host, exp_pip_pkg):
""" Ensure pip dependencies are installed """
pip = host.pip_package.get_packages(pip_path=os.path.join(sdvars.securedrop_venv_bin, "pip"))
assert pip[exp_pip_pkg['name']]['version'] == exp_pip_pkg['version']
""" Ensure expected package versions are installed """
cmd = "{}/bin/python3 -c \"from importlib.metadata import version; print(version('{}'))\"".format( # noqa
sdvars.securedrop_venv, exp_pip_pkg['name']
)
result = host.run(cmd)
assert result.stdout.strip() == exp_pip_pkg['version']


@pytest.mark.skip_in_prod
Expand Down

0 comments on commit fc78532

Please sign in to comment.