Skip to content

Commit 293fd4a

Browse files
author
Tom Softreck
committed
update
1 parent 7b6beef commit 293fd4a

File tree

1 file changed

+46
-26
lines changed

1 file changed

+46
-26
lines changed

.github/workflows/python-package.yml

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,13 @@ jobs:
5959
which poetry || { echo "Poetry not found in PATH"; exit 1; }
6060
poetry --version || { echo "Poetry version check failed"; exit 1; }
6161
62-
- name: Configure Poetry
62+
- name: Verify pyproject.toml
6363
run: |
64-
echo "=== Configuring Poetry ==="
64+
echo "=== Verifying pyproject.toml ==="
6565
echo "Current directory: $(pwd)"
66-
echo "Python executable: $(which python)"
67-
echo "Python version: $(python --version)"
66+
echo "Directory contents:"
67+
ls -la
6868
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; }
76-
77-
# Create a minimal pyproject.toml if it doesn't exist
7869
if [ ! -f pyproject.toml ]; then
7970
echo "\n=== Creating minimal pyproject.toml ==="
8071
cat > pyproject.toml <<EOL
@@ -91,26 +82,55 @@ authors = ["Your Name <your.email@example.com>"]
9182
[tool.poetry.dependencies]
9283
python = "^3.8"
9384
EOL
85+
echo "\nCreated pyproject.toml with minimal configuration"
86+
else
87+
echo "\n=== Existing pyproject.toml ==="
88+
cat pyproject.toml
9489
fi
9590

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
10191
if [ ! -f pyproject.toml ]; then
102-
echo "Error: pyproject.toml not found after creation attempt"
92+
echo "Error: Failed to create pyproject.toml"
10393
exit 1
10494
fi
95+
96+
- name: Configure Poetry
97+
run: |
98+
echo "=== Debugging Poetry Configuration ==="
99+
echo "Current directory: $(pwd)"
100+
echo "Python executable: $(which python)"
101+
echo "Python version: $(python --version)"
102+
103+
# Verify Python installation
104+
python -c "import sys; print(f'Python {sys.version}')" || \
105+
{ echo "Python verification failed"; exit 1; }
106+
107+
# Verify Poetry is installed and in PATH
108+
which poetry || { echo "Poetry not found in PATH"; exit 1; }
109+
echo "Poetry version: $(poetry --version)"
110+
111+
# Set Poetry configuration using environment variables
112+
export POETRY_VIRTUALENVS_CREATE=true
113+
export POETRY_VIRTUALENVS_IN_PROJECT=true
114+
115+
# Debug: Show current directory contents
116+
echo "\n=== Directory Contents ==="
117+
ls -la
118+
119+
# Debug: Show pyproject.toml contents
120+
echo "\n=== pyproject.toml Contents ==="
121+
cat pyproject.toml || { echo "Failed to read pyproject.toml"; exit 1; }
122+
123+
# Configure Poetry
124+
echo "\n=== Configuring Poetry ==="
125+
poetry config virtualenvs.create true
126+
poetry config virtualenvs.in-project true
105127
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; }
128+
# Verify configuration
129+
echo "\n=== Current Poetry Configuration ==="
130+
poetry config --list || { echo "Failed to list Poetry configuration"; exit 1; }
110131
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; }
132+
echo "\n=== Poetry Environment ==="
133+
poetry env info || { echo "Failed to get Poetry environment info"; exit 1; }
114134
115135
- name: Install dependencies
116136
run: |

0 commit comments

Comments
 (0)