@@ -62,21 +62,26 @@ jobs:
6262 - name : Configure Poetry
6363 run : |
6464 echo "=== Configuring Poetry ==="
65+ echo "Current directory: $(pwd)"
6566 echo "Python executable: $(which python)"
6667 echo "Python version: $(python --version)"
67- echo "Poetry version: $(poetry --version || echo 'Not available')"
6868
69- # Set Poetry to use in-project virtualenvs
70- echo "\n=== Configuring Poetry ==="
71- poetry config virtualenvs.create true || \
72- { echo "Failed to set virtualenvs.create"; exit 1; }
73- poetry config virtualenvs.in-project true || \
74- { echo "Failed to set virtualenvs.in-project"; exit 1; }
69+ # Verify Python installation
70+ python -c "import sys; print(f'Python {sys.version}')" || \
71+ { echo "Python verification failed"; exit 1; }
72+
73+ # Verify Poetry is installed and in PATH
74+ which poetry || { echo "Poetry not found in PATH"; exit 1; }
75+ poetry --version || { echo "Poetry version check failed"; exit 1; }
7576
7677 # Create a minimal pyproject.toml if it doesn't exist
7778 if [ ! -f pyproject.toml ]; then
7879 echo "\n=== Creating minimal pyproject.toml ==="
7980 cat > pyproject.toml <<EOL
81+ [build-system]
82+ requires = ["poetry-core>=1.0.0"]
83+ build-backend = "poetry.core.masonry.api"
84+
8085[tool.poetry]
8186name = "dialogchain"
8287version = "0.1.0"
@@ -85,24 +90,27 @@ authors = ["Your Name <your.email@example.com>"]
8590
8691[tool.poetry.dependencies]
8792python = "^3.8"
88-
89- [build-system]
90- requires = ["poetry-core>=1.0.0"]
91- build-backend = "poetry.core.masonry.api"
9293EOL
9394 fi
9495
95- # Verify configuration
96- echo "\n=== Current Poetry Configuration ==="
97- poetry config --list || \
98- { echo "Failed to list Poetry configuration"; exit 1; }
96+ # Configure Poetry using environment variables
97+ export POETRY_VIRTUALENVS_CREATE=true
98+ export POETRY_VIRTUALENVS_IN_PROJECT=true
99+
100+ # Verify pyproject.toml exists
101+ if [ ! -f pyproject.toml ]; then
102+ echo "Error : pyproject.toml not found after creation attempt"
103+ exit 1
104+ fi
99105
100- echo "\n=== Poetry Environment ==="
101- poetry env info || \
102- { echo "Failed to get Poetry environment info"; exit 1; }
106+ # Basic Poetry commands with full path
107+ echo "\n=== Running Poetry commands ==="
108+ /opt/hostedtoolcache/Python/3.11.12/x64/bin/poetry config --list || \
109+ { echo "Poetry config command failed"; exit 1; }
103110
104- echo "\n=== Python Path ==="
105- python -c "import sys; print('\n'.join(sys.path))"
111+ echo "\n=== Poetry environment info ==="
112+ /opt/hostedtoolcache/Python/3.11.12/x64/bin/poetry env info || \
113+ { echo "Poetry env info failed"; exit 1; }
106114
107115 - name : Install dependencies
108116 run : |
0 commit comments