Skip to content

Commit 2cc75e2

Browse files
committed
Enhance install_dev_deps.py and CI workflow with detailed logging
- Add print statements to install_dev_deps.py for better visibility during dependency installation, including counts of main, dev, and spice dependencies. - Update GitHub Actions workflow to include logging for core dependency installation and script execution, improving clarity on the installation process.
1 parent aa6adcb commit 2cc75e2

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

.github/workflows/test.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,21 @@ jobs:
4747
- name: Install dependencies
4848
shell: bash -l {0}
4949
run: |
50-
# Install core dependencies via mamba first
50+
echo "=== Starting dependency installation ==="
51+
echo "Installing core dependencies via mamba..."
5152
mamba install -y -c conda-forge tomlkit sh gdal
53+
echo "Core dependencies installed successfully"
5254
53-
# Run the installation script
55+
echo "Running install_dev_deps.py script..."
5456
python install_dev_deps.py
57+
echo "=== Dependency installation completed ==="
5558
5659
- name: Install package
5760
shell: bash -l {0}
5861
run: |
62+
echo "=== Installing package with spice extras ==="
5963
pip install -e ".[spice]"
64+
echo "Package installation completed"
6065
6166
- name: Run tests
6267
shell: bash -l {0}

install_dev_deps.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,43 @@
1313

1414

1515
def install_deps():
16+
print("\n=== Starting install_dev_deps.py ===")
17+
1618
# Read pyproject.toml
19+
print("\nReading pyproject.toml...")
1720
pyproject_path = Path("pyproject.toml")
1821
with open(pyproject_path) as f:
1922
pyproject = tomlkit.load(f)
2023

2124
# Get main, spice, and dev dependencies
25+
print("\nCollecting dependencies from pyproject.toml...")
2226
main_deps = pyproject["project"]["dependencies"]
2327
dev_deps = pyproject["project"]["optional-dependencies"]["dev"]
2428
spice_deps = pyproject["project"]["optional-dependencies"]["spice"]
2529
all_deps = main_deps + dev_deps + spice_deps
2630

31+
print(f"Found {len(main_deps)} main dependencies")
32+
print(f"Found {len(dev_deps)} dev dependencies")
33+
print(f"Found {len(spice_deps)} spice dependencies")
34+
print(f"Total dependencies to process: {len(all_deps)}")
35+
2736
# Split dependencies into conda and pip packages
37+
print("\nSplitting dependencies between conda and pip...")
2838
conda_deps = [dep for dep in all_deps if dep not in PIP_PACKAGES]
2939
pip_deps = [
3040
dep
3141
for dep in all_deps
3242
if dep in PIP_PACKAGES and dep.lower() not in CONDA_ONLY_PACKAGES
3343
]
3444

45+
print(f"Packages to install via conda: {len(conda_deps)}")
46+
print(f"Packages to install via pip: {len(pip_deps)}")
47+
3548
# Install conda packages
3649
if conda_deps:
3750
try:
38-
print("Installing with mamba:", " ".join(conda_deps))
51+
print("\nInstalling conda packages...")
52+
print("Packages:", " ".join(conda_deps))
3953
sh.mamba(
4054
"install",
4155
"-y",
@@ -56,7 +70,8 @@ def install_deps():
5670
# Install pip packages
5771
if pip_deps:
5872
try:
59-
print("\nInstalling with pip:", " ".join(pip_deps))
73+
print("\nInstalling pip packages...")
74+
print("Packages:", " ".join(pip_deps))
6075
sh.pip("install", *pip_deps, _err=sys.stderr, _out=sys.stdout)
6176
print("Pip installation completed successfully!")
6277
except sh.ErrorReturnCode as e:
@@ -66,6 +81,8 @@ def install_deps():
6681
print("Stderr:", e.stderr.decode() if e.stderr else "No stderr")
6782
sys.exit(1)
6883

84+
print("\n=== install_dev_deps.py completed successfully ===")
85+
6986

7087
if __name__ == "__main__":
7188
install_deps()

0 commit comments

Comments
 (0)