diff --git a/docs/source/conf.py b/docs/source/conf.py index 962268a..238fbf6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -25,7 +25,7 @@ author = "Akshay Gupta" # The short X.Y version -version = "2022.7.0" +version = "2022.7.1" # The full version, including alpha/beta/rc tags release = "" diff --git a/edgetest_conda/__init__.py b/edgetest_conda/__init__.py index fd2a6fb..a7a65aa 100644 --- a/edgetest_conda/__init__.py +++ b/edgetest_conda/__init__.py @@ -1,6 +1,6 @@ """Package initialization.""" -__version__ = "2022.7.0" +__version__ = "2022.7.1" __title__ = "edgetest-conda" __description__ = "Conda edgetest plugin" diff --git a/edgetest_conda/plugin.py b/edgetest_conda/plugin.py index 5f02ec2..73bcb29 100644 --- a/edgetest_conda/plugin.py +++ b/edgetest_conda/plugin.py @@ -161,7 +161,7 @@ def run_update(basedir: Path, envname: str, upgrade: List, conf: Dict): RuntimeError Error raised if the packages cannot be updated. """ - if conf["update_with_conda"] is False: + if conf.get("update_with_conda", False) is False: return None env_manager = "mamba" if _check_mamba() else "conda" diff --git a/requirements.txt b/requirements.txt index 52c98c2..5a2cd92 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,7 +16,7 @@ pluggy==1.0.0 # via edgetest pyparsing==3.0.9 # via packaging -tabulate==0.8.9 +tabulate==0.8.10 # via edgetest # The following packages are considered to be unsafe in a requirements file: diff --git a/setup.cfg b/setup.cfg index 73757df..160f398 100644 --- a/setup.cfg +++ b/setup.cfg @@ -83,7 +83,7 @@ edgetest = conda = edgetest_conda.plugin [bumpver] -current_version = "2022.7.0" +current_version = "2022.7.1" version_pattern = "YYYY.MM.INC0" commit_message = "Bump {old_version} to {new_version}" commit = True diff --git a/tests/test_hook.py b/tests/test_hook.py index 63c4c84..5532e03 100644 --- a/tests/test_hook.py +++ b/tests/test_hook.py @@ -36,6 +36,17 @@ pytest tests -m 'not integration' """ +CFG_UPDATE_PIP_DEFAULT = """ +[edgetest.envs.myenv] +conda_install = + graphviz +python_version = 3.8 +upgrade = + myupgrade +command = + pytest tests -m 'not integration' +""" + CFG_NOCONDA = """ [edgetest.envs.myenv] @@ -174,9 +185,10 @@ def test_conda_create(mock_popen, mock_cpopen): assert result.output == TABLE_OUTPUT +@pytest.mark.parametrize("CFG", [CFG_UPDATE_PIP, CFG_UPDATE_PIP_DEFAULT]) @patch("edgetest.core.Popen", autospec=True) @patch("edgetest.utils.Popen", autospec=True) -def test_conda_create_update_pip(mock_popen, mock_cpopen): +def test_conda_create_update_pip(mock_popen, mock_cpopen, CFG): """Test creating a basic conda environment.""" mock_popen.return_value.communicate.return_value = (PIP_LIST, "error") type(mock_popen.return_value).returncode = PropertyMock(return_value=0) @@ -187,7 +199,7 @@ def test_conda_create_update_pip(mock_popen, mock_cpopen): with runner.isolated_filesystem() as loc: with open("config.ini", "w") as outfile: - outfile.write(CFG_UPDATE_PIP) + outfile.write(CFG) result = runner.invoke(cli, ["--config=config.ini"]) @@ -313,9 +325,10 @@ def test_mamba_create(mock_popen, mock_cpopen): assert result.output == TABLE_OUTPUT +@pytest.mark.parametrize("CFG", [CFG_UPDATE_PIP, CFG_UPDATE_PIP_DEFAULT]) @patch("edgetest.core.Popen", autospec=True) @patch("edgetest.utils.Popen", autospec=True) -def test_mamba_create_update_pip(mock_popen, mock_cpopen): +def test_mamba_create_update_pip(mock_popen, mock_cpopen, CFG): """Test running ``edgetest`` with ``mamba``.""" mock_popen.return_value.communicate.return_value = (PIP_LIST_MAMBA, "error") type(mock_popen.return_value).returncode = PropertyMock(return_value=0) @@ -326,7 +339,7 @@ def test_mamba_create_update_pip(mock_popen, mock_cpopen): with runner.isolated_filesystem() as loc: with open("config.ini", "w") as outfile: - outfile.write(CFG_UPDATE_PIP) + outfile.write(CFG) result = runner.invoke(cli, ["--config=config.ini"])