Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ jobs:
run: |
if (! (conda env list | Select-String -Pattern "^$env:CONDA_ENV_NAME ") ) { conda env create -v -n $env:CONDA_ENV_NAME -f conda-envs/$env:CONDA_ENV_YML }
conda env update -v -n $env:CONDA_ENV_NAME -f conda-envs/$env:CONDA_ENV_YML --prune
$TCL_LIBRARY=(Get-ChildItem -Path "$env:CONDA/envs/$env:CONDA_ENV_NAME/Library/lib" -Recurse -Filter 'init.tcl' | Select-Object -First 1 | Select-Object -ExpandProperty Directory | Select-Object -ExpandProperty FullName)
$TK_LIBRARY=(Get-ChildItem -Path "$env:CONDA/envs/$env:CONDA_ENV_NAME/Library/lib" -Recurse -Filter 'pkgIndex.tcl' | Select-Object -ExpandProperty Directory | Where-Object -Property Name -Like 'tk*' | Select-Object -ExpandProperty FullName)
$TIX_LIBRARY=(Get-ChildItem -Path "$env:CONDA/envs/$env:CONDA_ENV_NAME/Library/lib" -Recurse -Filter 'pkgIndex.tcl' | Select-Object -ExpandProperty Directory | Where-Object -Property Name -Like 'tix*' | Select-Object -ExpandProperty FullName)
# Omitted from environment variables for now, but can re-enable if needed.
# See Also: mlos_viz/tests/conftest.py
#"TCL_LIBRARY=$TCL_LIBRARY" >> $env:GITHUB_ENV
#"TK_LIBRARY=$TK_LIBRARY" >> $env:GITHUB_ENV
#"TIX_LIBRARY=$TIX_LIBRARY" >> $env:GITHUB_ENV

- name: Log conda info
run: |
Expand All @@ -109,6 +117,14 @@ jobs:
conda config --show-sources
conda list -n $env:CONDA_ENV_NAME

- name: Log TCL path
run: |
Get-Item -ErrorAction Continue Env:TCL_LIBRARY
Get-Item -ErrorAction Continue Env:TK_LIBRARY
Get-Item -ErrorAction Continue Env:TIX_LIBRARY
Get-ChildItem -ErrorAction Continue -Path ${{ env.CONDA }}/envs/$env:CONDA_ENV_NAME -Recurse -Filter 'init.tcl' | Select-Object -ExpandProperty FullName
Get-ChildItem -ErrorAction Continue -Path ${{ env.CONDA }}/envs/$env:CONDA_ENV_NAME -Recurse -Filter 'pkgIndex.tcl' | Select-Object -ExpandProperty FullName

# This is moreso about code cleanliness, which is a dev thing, not a
# functionality thing, and the rules for that change between python versions,
# so only do this for the default in the devcontainer.
Expand Down
39 changes: 39 additions & 0 deletions mlos_viz/mlos_viz/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#
"""Export test fixtures for mlos_viz."""

import os
import sys
from glob import glob
from logging import warning
from pathlib import Path

from mlos_bench.tests import tunable_groups_fixtures
from mlos_bench.tests.storage.sql import fixtures as sql_storage_fixtures

Expand All @@ -15,3 +21,36 @@

tunable_groups_config = tunable_groups_fixtures.tunable_groups_config
tunable_groups = tunable_groups_fixtures.tunable_groups

# Workaround for #1004
# See Also: https://github.com/python/cpython/issues/111754
if sys.platform == "win32":
# Fix Tcl/Tk folder
tcl_path_info = {
"TCL_LIBRARY": ["tcl*", "init.tcl"],
"TK_LIBRARY": ["tk*", "pkgIndex.tcl"],
"TIX_LIBRARY": ["tix*", "pkgIndex.tcl"],
}
for env_var, (subdir_pattern, file_name) in tcl_path_info.items():
if env_var not in os.environ:
try:
os.environ[env_var] = str(
Path(
next(
iter(
glob(
os.path.join(
sys.base_prefix,
"Library",
"lib",
subdir_pattern,
file_name,
)
)
)
)
).parent
)
warning(f"""Setting {env_var} to {os.environ[env_var]}""")
Comment thread
bpkroth marked this conversation as resolved.
except StopIteration:
warning(f"{env_var} not found, some Tcl/Tk functionality may be limited.")
Comment thread
bpkroth marked this conversation as resolved.
Loading