From 9894c843a8e883827652e40bbb9ddaa0b1199de5 Mon Sep 17 00:00:00 2001 From: Adam Lewis <23342526+Adam-D-Lewis@users.noreply.github.com> Date: Tue, 11 Mar 2025 11:38:22 -0500 Subject: [PATCH] loosen dependency requirement pins for nebari (#2984) --- .github/workflows/test_conda_build.yaml | 20 ++++++++++++++++---- pyproject.toml | 7 +++---- tests/tests_unit/test_stages.py | 6 +----- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test_conda_build.yaml b/.github/workflows/test_conda_build.yaml index 53c51d8c64..74584ee620 100644 --- a/.github/workflows/test_conda_build.yaml +++ b/.github/workflows/test_conda_build.yaml @@ -35,10 +35,16 @@ jobs: python-version: "3.10" channels: conda-forge activate-environment: nebari-dev + conda-remove-defaults: true - name: Install dependencies run: | - conda install build grayskull conda-build conda-verify + conda install grayskull conda-build conda-verify + pip install build + + - name: Conda list + run: | + conda list - name: Generate sdist run: | @@ -50,9 +56,15 @@ jobs: - name: Build conda package run: | - conda build nebari + conda build . --output-folder conda-bld + + # Store the path for the next step + echo "CONDA_BLD_PATH=$(pwd)/conda-bld" >> $GITHUB_ENV - name: Test conda package run: | - conda install --use-local nebari - nebari --version + NEBARI_VERSION=$(conda search -c local --override-channels nebari --json | jq -r '.nebari[0].version') + + conda create -n test-env -c file://${{ env.CONDA_BLD_PATH }} "nebari=$NEBARI_VERSION" + + conda run -n test-env --live-stream nebari --version diff --git a/pyproject.toml b/pyproject.toml index a9a9b6d668..177df4dfce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,7 +62,7 @@ dependencies = [ "bcrypt==4.0.1", "boto3==1.34.63", "cloudflare==2.11.7", - "google-auth==2.31.0", + "google-auth>=2.31.0,<3.0.0", "google-cloud-compute==1.19.1", "google-cloud-container==2.49.0", "google-cloud-iam==2.15.1", @@ -72,12 +72,12 @@ dependencies = [ "kubernetes==27.2.0", "pluggy==1.3.0", "prompt-toolkit==3.0.36", - "pydantic==2.9.2", + "pydantic>=2.9.2,<3.0.0", "pynacl==1.5.0", "python-keycloak>=3.9.0,<4.0.0", "questionary==2.0.0", "requests-toolbelt==1.0.0", - "rich==13.5.1", + "rich>=13.5.1,<14", "ruamel.yaml==0.18.6", "typer==0.9.0", "packaging==23.2", @@ -90,7 +90,6 @@ dev = [ "coverage[toml]", "dask-gateway", "escapism", - "importlib-metadata<5.0", "mypy==1.6.1", "paramiko", "pre-commit", diff --git a/tests/tests_unit/test_stages.py b/tests/tests_unit/test_stages.py index c15aa6d9fc..025ec1cbaa 100644 --- a/tests/tests_unit/test_stages.py +++ b/tests/tests_unit/test_stages.py @@ -48,18 +48,14 @@ def test_check_immutable_fields_mutable_change( @patch.object(TerraformStateStage, "get_nebari_config_state") -@patch.object(schema.Main, "model_fields") def test_check_immutable_fields_immutable_change( - mock_model_fields, mock_get_state, terraform_state_stage, mock_config + mock_get_state, terraform_state_stage, mock_config ): old_config = mock_config.model_copy(deep=True) old_config.local = None old_config.provider = schema.ProviderEnum.gcp mock_get_state.return_value = old_config.model_dump() - # Mock the provider field to be immutable - mock_model_fields.__getitem__.return_value.json_schema_extra = {"immutable": True} - with pytest.raises(ValueError) as exc_info: terraform_state_stage.check_immutable_fields()