diff --git a/.github/workflows/pip-checks.yml b/.github/workflows/pip-checks.yml index 5e134d3f..557c4d7f 100644 --- a/.github/workflows/pip-checks.yml +++ b/.github/workflows/pip-checks.yml @@ -26,7 +26,7 @@ jobs: steps: - uses: actions/checkout@v4 - # We initiate the environment empty, and check if a key for this environment doesn't already exist in the cache + # We initiate the environment empty - name: Initiate empty environment uses: conda-incubator/setup-miniconda@v3 with: @@ -38,15 +38,12 @@ jobs: activate-environment: xdem-pip python-version: + # Use pip install - name: Install project run: | mamba install pip pip install -e . - # This steps allows us to check the "import xdem" with the base environment provided to users, before adding - # development-specific dependencies by differencing the env and dev-env yml files + # Check import works - name: Check import works with base environment - run: | - # We unset the PROJ_DATA environment variable to make PROJ work on Windows - unset PROJ_DATA - python -c "import xdem" \ No newline at end of file + run: python -c "import xdem" \ No newline at end of file diff --git a/tests/test_misc.py b/tests/test_misc.py index fc87a314..8c990fdd 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -118,8 +118,8 @@ def useless_func() -> int: def test_diff_environment_yml(self, capsys) -> None: # type: ignore # Test with synthetic environment - env = {"dependencies": ["python==3.9", "numpy", "fiona"]} - devenv = {"dependencies": ["python==3.9", "numpy", "fiona", "opencv"]} + env = {"dependencies": ["python==3.9", "numpy", "pandas"]} + devenv = {"dependencies": ["python==3.9", "numpy", "pandas", "opencv"]} # This should print the difference between the two xdem.misc.diff_environment_yml(env, devenv, input_dict=True, print_dep="conda") @@ -134,8 +134,8 @@ def test_diff_environment_yml(self, capsys) -> None: # type: ignore captured = capsys.readouterr().out assert captured == "opencv\nNone\n" - env2 = {"dependencies": ["python==3.9", "numpy", "fiona"]} - devenv2 = {"dependencies": ["python==3.9", "numpy", "fiona", "opencv", {"pip": ["geoutils", "-e ./"]}]} + env2 = {"dependencies": ["python==3.9", "numpy", "pandas"]} + devenv2 = {"dependencies": ["python==3.9", "numpy", "pandas", "opencv", {"pip": ["geoutils", "-e ./"]}]} # The diff function should not account for -e ./ that is the local install for developers xdem.misc.diff_environment_yml(env2, devenv2, input_dict=True, print_dep="both") @@ -155,13 +155,13 @@ def test_diff_environment_yml(self, capsys) -> None: # type: ignore # When the dependencies are not defined in dev-env but in env, it should raise an error # For normal dependencies - env3 = {"dependencies": ["python==3.9", "numpy", "fiona", "lol"]} - devenv3 = {"dependencies": ["python==3.9", "numpy", "fiona", "opencv", {"pip": ["geoutils"]}]} + env3 = {"dependencies": ["python==3.9", "numpy", "pandas", "lol"]} + devenv3 = {"dependencies": ["python==3.9", "numpy", "pandas", "opencv", {"pip": ["geoutils"]}]} with pytest.raises(ValueError, match="The following dependencies are listed in env but not dev-env: lol"): xdem.misc.diff_environment_yml(env3, devenv3, input_dict=True, print_dep="pip") # For pip dependencies - env4 = {"dependencies": ["python==3.9", "numpy", "fiona", {"pip": ["lol"]}]} - devenv4 = {"dependencies": ["python==3.9", "numpy", "fiona", "opencv", {"pip": ["geoutils"]}]} + env4 = {"dependencies": ["python==3.9", "numpy", "pandas", {"pip": ["lol"]}]} + devenv4 = {"dependencies": ["python==3.9", "numpy", "pandas", "opencv", {"pip": ["geoutils"]}]} with pytest.raises(ValueError, match="The following pip dependencies are listed in env but not dev-env: lol"): xdem.misc.diff_environment_yml(env4, devenv4, input_dict=True, print_dep="pip")