From edcf7fae0ea9cd85e0b8ec6e44e18ed2b4b7a1c4 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 2 Apr 2026 18:00:05 -0700 Subject: [PATCH] fix(pet-conda): shorten test fixture path for Windows compatibility (Fixes #171) --- crates/pet-conda/tests/lib_test.rs | 14 +++----------- .../env_python_3/bin/conda | 0 .../env_python_3/bin/python | 0 .../env_python_3/bin/python3 | 0 .../env_python_3/bin/python3.1 | 0 .../env_python_3/bin/python3.12 | 0 .../env_python_3/conda-meta/history | 4 ++-- .../env_python_3/conda-meta/history_template | 0 .../conda-meta/pygments-2.17.2-pyhd8ed1ab_0.json | 0 .../python-3.12.2-hdf0ec26_0_cpython.json | 0 .../python-dateutil-2.8.2-pyhd8ed1ab_0.json | 0 .../conda-meta/python_abi-3.12-4_cp312.json | 0 .../some_other_location/conda_install/bin/conda | 0 .../some_other_location/conda_install/bin/python | 0 .../some_other_location/conda_install/bin/python3 | 0 .../conda_install/bin/python3.1 | 0 .../conda_install/bin/python3.10 | 0 .../conda-meta/conda-23.1.0-py310hca03da5_0.json | 0 .../conda-build-3.23.3-py310hca03da5_0.json | 0 .../conda_install/conda-meta/history | 0 .../conda-meta/pytest-7.1.2-py310hca03da5_0.json | 0 .../conda-meta/python-3.10.9-hc0d8a6c_1.json | 0 .../python-dateutil-2.8.2-pyhd3eb1b0_0.json | 0 ...thon-fastjsonschema-2.16.2-py310hca03da5_0.json | 0 .../conda_install/condabin/conda | 0 .../conda_install/envs/.conda_envs_dir_test | 0 26 files changed, 5 insertions(+), 13 deletions(-) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/env_python_3/bin/conda (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/env_python_3/bin/python (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/env_python_3/bin/python3 (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/env_python_3/bin/python3.1 (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/env_python_3/bin/python3.12 (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/env_python_3/conda-meta/history (90%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/env_python_3/conda-meta/history_template (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/env_python_3/conda-meta/pygments-2.17.2-pyhd8ed1ab_0.json (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/env_python_3/conda-meta/python-3.12.2-hdf0ec26_0_cpython.json (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/env_python_3/conda-meta/python-dateutil-2.8.2-pyhd8ed1ab_0.json (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/env_python_3/conda-meta/python_abi-3.12-4_cp312.json (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/bin/conda (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/bin/python (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/bin/python3 (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/bin/python3.1 (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/bin/python3.10 (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/conda-meta/conda-23.1.0-py310hca03da5_0.json (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/conda-meta/conda-build-3.23.3-py310hca03da5_0.json (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/conda-meta/history (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/conda-meta/pytest-7.1.2-py310hca03da5_0.json (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/conda-meta/python-3.10.9-hc0d8a6c_1.json (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/conda-meta/python-dateutil-2.8.2-pyhd3eb1b0_0.json (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/conda-meta/python-fastjsonschema-2.16.2-py310hca03da5_0.json (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/condabin/conda (100%) rename crates/pet-conda/tests/unix/{conda_env_without_manager_but_found_in_history => conda_hist}/some_other_location/conda_install/envs/.conda_envs_dir_test (100%) diff --git a/crates/pet-conda/tests/lib_test.rs b/crates/pet-conda/tests/lib_test.rs index ff62f5aa..0afb7d7e 100644 --- a/crates/pet-conda/tests/lib_test.rs +++ b/crates/pet-conda/tests/lib_test.rs @@ -51,17 +51,9 @@ fn find_conda_env_without_manager_but_detect_manager_from_history() { let environment = create_test_environment(HashMap::new(), None, vec![], None); let locator = Conda::from(&environment); - let path = resolve_test_path(&[ - "unix", - "conda_env_without_manager_but_found_in_history", - "env_python_3", - ]); - let conda_dir = resolve_test_path(&[ - "unix", - "conda_env_without_manager_but_found_in_history", - "some_other_location", - "conda_install", - ]); + let path = resolve_test_path(&["unix", "conda_hist", "env_python_3"]); + let conda_dir = + resolve_test_path(&["unix", "conda_hist", "some_other_location", "conda_install"]); let history_file = path.join("conda-meta").join("history"); let history_file_template = path.join("conda-meta").join("history_template"); let history_contents = fs::read_to_string(&history_file_template) diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/bin/conda b/crates/pet-conda/tests/unix/conda_hist/env_python_3/bin/conda similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/bin/conda rename to crates/pet-conda/tests/unix/conda_hist/env_python_3/bin/conda diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/bin/python b/crates/pet-conda/tests/unix/conda_hist/env_python_3/bin/python similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/bin/python rename to crates/pet-conda/tests/unix/conda_hist/env_python_3/bin/python diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/bin/python3 b/crates/pet-conda/tests/unix/conda_hist/env_python_3/bin/python3 similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/bin/python3 rename to crates/pet-conda/tests/unix/conda_hist/env_python_3/bin/python3 diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/bin/python3.1 b/crates/pet-conda/tests/unix/conda_hist/env_python_3/bin/python3.1 similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/bin/python3.1 rename to crates/pet-conda/tests/unix/conda_hist/env_python_3/bin/python3.1 diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/bin/python3.12 b/crates/pet-conda/tests/unix/conda_hist/env_python_3/bin/python3.12 similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/bin/python3.12 rename to crates/pet-conda/tests/unix/conda_hist/env_python_3/bin/python3.12 diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/history b/crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/history similarity index 90% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/history rename to crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/history index fc09724d..c506b692 100644 --- a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/history +++ b/crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/history @@ -1,8 +1,8 @@ ==> 2024-02-28 23:05:07 <== -# cmd: /home/runner/work/python-environment-tools/python-environment-tools/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/bin/conda create -n conda1 +# cmd: /home/runner/work/python-environment-tools/python-environment-tools/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/bin/conda create -n conda1 # conda version: 23.11.0 ==> 2024-02-28 23:08:59 <== -# cmd: /home/runner/work/python-environment-tools/python-environment-tools/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/bin/conda install -c conda-forge --name conda1 ipykernel -y +# cmd: /home/runner/work/python-environment-tools/python-environment-tools/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/bin/conda install -c conda-forge --name conda1 ipykernel -y # conda version: 23.11.0 +conda-forge/noarch::appnope-0.1.4-pyhd8ed1ab_0 +conda-forge/noarch::asttokens-2.4.1-pyhd8ed1ab_0 diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/history_template b/crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/history_template similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/history_template rename to crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/history_template diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/pygments-2.17.2-pyhd8ed1ab_0.json b/crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/pygments-2.17.2-pyhd8ed1ab_0.json similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/pygments-2.17.2-pyhd8ed1ab_0.json rename to crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/pygments-2.17.2-pyhd8ed1ab_0.json diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/python-3.12.2-hdf0ec26_0_cpython.json b/crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/python-3.12.2-hdf0ec26_0_cpython.json similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/python-3.12.2-hdf0ec26_0_cpython.json rename to crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/python-3.12.2-hdf0ec26_0_cpython.json diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/python-dateutil-2.8.2-pyhd8ed1ab_0.json b/crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/python-dateutil-2.8.2-pyhd8ed1ab_0.json similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/python-dateutil-2.8.2-pyhd8ed1ab_0.json rename to crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/python-dateutil-2.8.2-pyhd8ed1ab_0.json diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/python_abi-3.12-4_cp312.json b/crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/python_abi-3.12-4_cp312.json similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/env_python_3/conda-meta/python_abi-3.12-4_cp312.json rename to crates/pet-conda/tests/unix/conda_hist/env_python_3/conda-meta/python_abi-3.12-4_cp312.json diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/bin/conda b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/bin/conda similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/bin/conda rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/bin/conda diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/bin/python b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/bin/python similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/bin/python rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/bin/python diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/bin/python3 b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/bin/python3 similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/bin/python3 rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/bin/python3 diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/bin/python3.1 b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/bin/python3.1 similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/bin/python3.1 rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/bin/python3.1 diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/bin/python3.10 b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/bin/python3.10 similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/bin/python3.10 rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/bin/python3.10 diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/conda-23.1.0-py310hca03da5_0.json b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/conda-23.1.0-py310hca03da5_0.json similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/conda-23.1.0-py310hca03da5_0.json rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/conda-23.1.0-py310hca03da5_0.json diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/conda-build-3.23.3-py310hca03da5_0.json b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/conda-build-3.23.3-py310hca03da5_0.json similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/conda-build-3.23.3-py310hca03da5_0.json rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/conda-build-3.23.3-py310hca03da5_0.json diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/history b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/history similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/history rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/history diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/pytest-7.1.2-py310hca03da5_0.json b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/pytest-7.1.2-py310hca03da5_0.json similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/pytest-7.1.2-py310hca03da5_0.json rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/pytest-7.1.2-py310hca03da5_0.json diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/python-3.10.9-hc0d8a6c_1.json b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/python-3.10.9-hc0d8a6c_1.json similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/python-3.10.9-hc0d8a6c_1.json rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/python-3.10.9-hc0d8a6c_1.json diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/python-dateutil-2.8.2-pyhd3eb1b0_0.json b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/python-dateutil-2.8.2-pyhd3eb1b0_0.json similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/python-dateutil-2.8.2-pyhd3eb1b0_0.json rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/python-dateutil-2.8.2-pyhd3eb1b0_0.json diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/python-fastjsonschema-2.16.2-py310hca03da5_0.json b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/python-fastjsonschema-2.16.2-py310hca03da5_0.json similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/conda-meta/python-fastjsonschema-2.16.2-py310hca03da5_0.json rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/conda-meta/python-fastjsonschema-2.16.2-py310hca03da5_0.json diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/condabin/conda b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/condabin/conda similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/condabin/conda rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/condabin/conda diff --git a/crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/envs/.conda_envs_dir_test b/crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/envs/.conda_envs_dir_test similarity index 100% rename from crates/pet-conda/tests/unix/conda_env_without_manager_but_found_in_history/some_other_location/conda_install/envs/.conda_envs_dir_test rename to crates/pet-conda/tests/unix/conda_hist/some_other_location/conda_install/envs/.conda_envs_dir_test