Merge branch 'main' into conda-channels

This commit is contained in:
Erik Sundell
2024-09-04 13:16:58 +02:00
42 changed files with 351 additions and 113 deletions

View File

@@ -1,4 +1,5 @@
"""pytest fixtures"""
import os
import types
from importlib import reload

View File

@@ -1,6 +1,7 @@
"""
Test conda commandline wrappers
"""
import os
import subprocess
import tempfile
@@ -13,9 +14,9 @@ from tljh import conda, installer
@pytest.fixture(scope="module")
def prefix():
"""
Provide a temporary directory with a mambaforge conda environment
Provide a temporary directory with a conda environment
"""
installer_url, checksum = installer._mambaforge_url()
installer_url, checksum = installer._miniforge_url()
with tempfile.TemporaryDirectory() as tmpdir:
with conda.download_miniconda_installer(
installer_url, checksum

View File

@@ -1,6 +1,7 @@
"""
Unit test functions in installer.py
"""
import json
import os
from subprocess import PIPE, run
@@ -45,12 +46,12 @@ def test_ensure_admins(tljh_dir, admins, expected_config):
def setup_conda(distro, version, prefix):
"""Install mambaforge or miniconda in a prefix"""
"""Install miniforge or miniconda in a prefix"""
if distro == "mambaforge":
installer_url, _ = installer._mambaforge_url(version)
installer_url, _ = installer._miniforge_url(version)
installer_url = installer_url.replace("Miniforge3", "Mambaforge")
elif distro == "miniforge":
installer_url, _ = installer._mambaforge_url(version)
installer_url = installer_url.replace("Mambaforge", "Miniforge3")
installer_url, _ = installer._miniforge_url(version)
elif distro == "miniconda":
arch = os.uname().machine
installer_url = (
@@ -123,9 +124,9 @@ def _specifier(version):
None,
None,
{
"python": "3.10.*",
"conda": "23.1.0",
"mamba": "1.4.1",
"python": "3.12.*",
"conda": "24.7.1",
"mamba": "1.5.9",
},
),
# previous install, 1.0

View File

@@ -1,6 +1,7 @@
"""
Unit test functions in installer.py
"""
import os
from datetime import date

View File

@@ -1,6 +1,7 @@
"""
Test functions for normalizing various kinds of values
"""
from tljh.normalize import generate_system_username

View File

@@ -1,4 +1,5 @@
"""Test traefik configuration"""
import os
import pytest

View File

@@ -1,6 +1,7 @@
"""
Test wrappers in tljw.user module
"""
import grp
import os
import os.path