From 5aa598b436061ff5cb12521447b0df880ea96df2 Mon Sep 17 00:00:00 2001 From: Tamar Lavee Date: Mon, 14 Aug 2023 17:48:28 -0400 Subject: [PATCH 1/3] use test dir from environment if exists, for package testing --- .ruff.toml | 1 + tests/test_wandb.py | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.ruff.toml b/.ruff.toml index 799bcab6..b2b81885 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -1,3 +1,4 @@ +fix = true select = ["D", "E", "F", "I"] ignore = ["D212"] line-length = 100 diff --git a/tests/test_wandb.py b/tests/test_wandb.py index 5151878f..8cd26c6b 100644 --- a/tests/test_wandb.py +++ b/tests/test_wandb.py @@ -1,3 +1,4 @@ +import os import unittest from os.path import join from unittest.mock import Mock, patch @@ -5,7 +6,6 @@ import pandas as pd from rsmtool.configuration_parser import Configuration -from rsmtool.test_utils import rsmtool_test_dir from rsmtool.utils.wandb import ( init_wandb_run, log_configuration_to_wandb, @@ -13,6 +13,14 @@ log_report_to_wandb, ) +# allow test directory to be set via an environment variable +# which is needed for package testing +TEST_DIR = os.environ.get("TESTDIR", None) +if TEST_DIR: + rsmtool_test_dir = TEST_DIR +else: + from rsmtool.test_utils import rsmtool_test_dir + class TestWandb(unittest.TestCase): def test_init_wandb_run_wandb_enabled(self): From 6e941a9f86aa7458df8e74b9e98b4e4e603ef5c3 Mon Sep 17 00:00:00 2001 From: Tamar Lavee Date: Mon, 14 Aug 2023 19:17:10 -0400 Subject: [PATCH 2/3] clean up requirement and use mambafirge in gitlab ci --- .gitlab-ci.yml | 4 ++-- requirements.txt | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6adc1dee..9ae8dbf6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: continuumio/miniconda3:latest +image: condaforge/mambaforge:latest stages: - test @@ -11,7 +11,7 @@ variables: # set up basic job .runtests: before_script: - - "conda create --prefix /root/rsmenv -c conda-forge -c ets --file requirements.txt python=${PYVERSION} --yes --quiet" + - "mamba create --prefix /root/rsmenv -c conda-forge -c ets --file requirements.txt python=${PYVERSION} --yes --quiet" - /root/rsmenv/bin/pip install -e . - echo "import os" > sitecustomize.py - echo "try:" >> sitecustomize.py diff --git a/requirements.txt b/requirements.txt index 2a249d07..bdf8b9cb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -coverage codecov doc2dash ipython @@ -8,7 +7,6 @@ notebook numpy openpyxl pandas -parameterized pre-commit seaborn shap==0.42.1 From 0bac771b85409d1f875f4080adfa12e989c8ac3c Mon Sep 17 00:00:00 2001 From: Nitin Madnani Date: Mon, 14 Aug 2023 19:45:39 -0400 Subject: [PATCH 3/3] chore: do not use quiet mode for mamba --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ae8dbf6..0e642c7e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ variables: # set up basic job .runtests: before_script: - - "mamba create --prefix /root/rsmenv -c conda-forge -c ets --file requirements.txt python=${PYVERSION} --yes --quiet" + - "mamba create --prefix /root/rsmenv -c conda-forge -c ets --file requirements.txt python=${PYVERSION} --yes" - /root/rsmenv/bin/pip install -e . - echo "import os" > sitecustomize.py - echo "try:" >> sitecustomize.py