coiled 1.100.1.dev3__tar.gz → 1.100.1.dev4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/PKG-INFO +1 -1
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/software_utils.py +128 -3
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/.gitignore +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/LICENSE +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/README.md +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/__main__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/analytics.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/auth.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/batch.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/capture_environment.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/batch/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/batch/list.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/batch/run.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/batch/status.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/batch/wait.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/cluster/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/cluster/azure_logs.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/cluster/better_logs.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/cluster/crud.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/cluster/get_address.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/cluster/list.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/cluster/logs.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/cluster/metrics.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/cluster/ssh.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/cluster/utils.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/config.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/core.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/curl.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/diagnostics.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/env.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/examples/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/examples/exit.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/examples/hello_world.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/examples/nyc_parquet.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/examples/pytorch.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/examples/xarray_nwm.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/hello.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/scripts/fill_ipython.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/scripts/nyc_parquet.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/scripts/pytorch.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/scripts/xarray_nwm.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/hello/utils.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/login.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/notebook/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/notebook/notebook.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/package_sync.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/prefect.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/prefect_serve.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/run.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/setup/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/setup/amp.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/setup/aws.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/setup/azure.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/setup/entry.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/setup/gcp.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/setup/prometheus.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/setup/util.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/sync.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cli/utils.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/cluster.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/coiled.yaml +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/compatibility.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/config.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/context.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/core.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/credentials/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/credentials/aws.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/credentials/google.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/errors.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/exceptions.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/extensions/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/extensions/prefect/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/extensions/prefect/runners.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/extensions/prefect/workers.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/function.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/plugins.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/prefect.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/pypi_conda_map.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/scan.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/software.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/spans.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/spark.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/types.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/utils.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/v2/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/v2/cluster.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/v2/core.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/v2/cwi_log_link.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/v2/states.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/v2/widgets/__init__.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/v2/widgets/interface.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/v2/widgets/rich.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/v2/widgets/util.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/coiled/websockets.py +0 -0
- {coiled-1.100.1.dev3 → coiled-1.100.1.dev4}/pyproject.toml +0 -0
|
@@ -592,6 +592,128 @@ def get_mamba_auth(netloc: str) -> tuple[str, str] | None:
|
|
|
592
592
|
return get_mamba_auth_dict().get(netloc, None)
|
|
593
593
|
|
|
594
594
|
|
|
595
|
+
@functools.lru_cache
|
|
596
|
+
def get_conda_config() -> dict:
|
|
597
|
+
"""Returns the current conda config as dictionary"""
|
|
598
|
+
encoding = get_encoding()
|
|
599
|
+
conda_config = {}
|
|
600
|
+
try:
|
|
601
|
+
config_output = subprocess.check_output(
|
|
602
|
+
[
|
|
603
|
+
"conda",
|
|
604
|
+
"config",
|
|
605
|
+
"--show",
|
|
606
|
+
"--json",
|
|
607
|
+
],
|
|
608
|
+
encoding=encoding,
|
|
609
|
+
)
|
|
610
|
+
conda_config = json.loads(config_output)
|
|
611
|
+
except (subprocess.CalledProcessError, FileNotFoundError, json.JSONDecodeError, ValueError):
|
|
612
|
+
logger.debug("Encountered error when loading conda config", exc_info=True)
|
|
613
|
+
|
|
614
|
+
return conda_config
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
def get_conda_python_path() -> Path | None:
|
|
618
|
+
"""Returns the path the conda base environment python executable"""
|
|
619
|
+
# Try using config first, since that's probably the most cross-platform way
|
|
620
|
+
conda_config = get_conda_config()
|
|
621
|
+
root_prefix = conda_config.get("root_prefix")
|
|
622
|
+
if root_prefix:
|
|
623
|
+
conda_python = Path(root_prefix) / "bin" / "python"
|
|
624
|
+
if conda_python.exists():
|
|
625
|
+
return conda_python
|
|
626
|
+
# Fallback to the conda executable
|
|
627
|
+
conda_executable = shutil.which("conda")
|
|
628
|
+
if conda_executable:
|
|
629
|
+
conda_executable = Path(conda_executable)
|
|
630
|
+
conda_python = conda_executable.parent / "python"
|
|
631
|
+
if conda_python.exists():
|
|
632
|
+
return conda_python
|
|
633
|
+
return None
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
def get_conda_auth(no_auth_url: str) -> tuple[str, str] | None:
|
|
637
|
+
"""Returns the Requests tuple auth for a given domain from its conda-auth values."""
|
|
638
|
+
conda_config = get_conda_config()
|
|
639
|
+
channel_settings = conda_config.get("channel_settings", [])
|
|
640
|
+
auth_type = None
|
|
641
|
+
username = None
|
|
642
|
+
password = None
|
|
643
|
+
for channel in channel_settings:
|
|
644
|
+
if channel.get("channel") != no_auth_url:
|
|
645
|
+
continue
|
|
646
|
+
auth_type = channel.get("auth")
|
|
647
|
+
if not auth_type:
|
|
648
|
+
continue
|
|
649
|
+
if auth_type == "http-basic":
|
|
650
|
+
username = channel.get("username")
|
|
651
|
+
password = channel.get("password")
|
|
652
|
+
elif auth_type == "token":
|
|
653
|
+
username = "token"
|
|
654
|
+
password = channel.get("token")
|
|
655
|
+
|
|
656
|
+
if not auth_type or not username:
|
|
657
|
+
return None
|
|
658
|
+
if not password:
|
|
659
|
+
# Use base environment python to get the keyring,
|
|
660
|
+
# so we don't prompt for a password and know keyring is available
|
|
661
|
+
conda_python = get_conda_python_path()
|
|
662
|
+
if conda_python:
|
|
663
|
+
# This is kind of a hack, but using multiprocessing with a
|
|
664
|
+
# different python executable lends itself to pickling issues
|
|
665
|
+
python_code = f"""
|
|
666
|
+
import json
|
|
667
|
+
import sys
|
|
668
|
+
try:
|
|
669
|
+
import keyring
|
|
670
|
+
except Exception as e:
|
|
671
|
+
sys.exit(0)
|
|
672
|
+
|
|
673
|
+
username = {username!r}
|
|
674
|
+
url = "conda-auth::{auth_type}::{no_auth_url}"
|
|
675
|
+
auth_parts = None
|
|
676
|
+
|
|
677
|
+
if hasattr(keyring, "get_credential"):
|
|
678
|
+
cred = keyring.get_credential(url, username)
|
|
679
|
+
if cred is not None:
|
|
680
|
+
auth_parts = cred.username, cred.password
|
|
681
|
+
|
|
682
|
+
if username is not None:
|
|
683
|
+
password = keyring.get_password(url, username)
|
|
684
|
+
if password:
|
|
685
|
+
auth_parts = username, password
|
|
686
|
+
|
|
687
|
+
print(json.dumps(auth_parts))
|
|
688
|
+
"""
|
|
689
|
+
try:
|
|
690
|
+
auth_parts_str = subprocess.check_output(
|
|
691
|
+
[str(conda_python), "-c", python_code],
|
|
692
|
+
encoding=get_encoding(),
|
|
693
|
+
timeout=5,
|
|
694
|
+
).strip()
|
|
695
|
+
if auth_parts_str and auth_parts_str != "null":
|
|
696
|
+
auth_parts = json.loads(auth_parts_str)
|
|
697
|
+
if auth_parts:
|
|
698
|
+
username, password = auth_parts
|
|
699
|
+
else:
|
|
700
|
+
logger.debug(f"Keyring returned no credentials for conda-auth::{auth_type}::{no_auth_url}")
|
|
701
|
+
except subprocess.TimeoutExpired:
|
|
702
|
+
logger.warning("Timed out getting conda-auth keyring creds")
|
|
703
|
+
return None
|
|
704
|
+
except Exception as e:
|
|
705
|
+
logger.warning(f"Unexpected error getting keyring auth: {e}", exc_info=True)
|
|
706
|
+
return None
|
|
707
|
+
|
|
708
|
+
if auth_type == "token":
|
|
709
|
+
username = AUTH_BEARER_USERNAME
|
|
710
|
+
|
|
711
|
+
if not username and not password:
|
|
712
|
+
return None
|
|
713
|
+
|
|
714
|
+
return (username or "", password or "")
|
|
715
|
+
|
|
716
|
+
|
|
595
717
|
@functools.lru_cache
|
|
596
718
|
def set_auth_for_url(url: Url | str) -> str:
|
|
597
719
|
"""Returns a url string with the user and password set from netrc, keyring, mamba, or the URL itself."""
|
|
@@ -617,12 +739,15 @@ def set_auth_for_url(url: Url | str) -> str:
|
|
|
617
739
|
netloc = parsed_url.netloc or ""
|
|
618
740
|
|
|
619
741
|
if not password:
|
|
742
|
+
no_auth_url = parsed_url._replace(auth=None).url
|
|
620
743
|
auth_parts = (
|
|
621
|
-
#
|
|
622
|
-
get_netrc_auth(
|
|
744
|
+
# get_netrc_auth takes a URL, but only uses the netloc part
|
|
745
|
+
get_netrc_auth(no_auth_url)
|
|
623
746
|
# keyring could have URL stored by full URL or netloc
|
|
624
|
-
or get_keyring_auth(
|
|
747
|
+
or get_keyring_auth(no_auth_url, username)
|
|
625
748
|
or get_keyring_auth(netloc, username)
|
|
749
|
+
# conda-auth stores things in keyring in its own format
|
|
750
|
+
or get_conda_auth(no_auth_url)
|
|
626
751
|
# mamba could have URL stored by netloc/path or netloc
|
|
627
752
|
or get_mamba_auth(f"{netloc}{path}")
|
|
628
753
|
or get_mamba_auth(netloc)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|