Description:
I have a workflow that builds and test my Python project. In poetry installation steps gcc can't find the Python header/s and the build fails. When I checked the /opt/hostedtoolcache/Python/3.8.13/x64/include/python3.8, there is no such directory.
Action version:
4
Platform:
Runner type:
Tools version:
3.7.13
3.8.13
Repro steps:
jobs:
test:
runs-on: [self-hosted, xxxx]strategy:
fail-fast: falsematrix:
python-version: [3.7, 3.8]name: flake8 and pytest on Python ${{ matrix.python-version }}steps:
- uses: actions/checkout@v3with:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}id: setup-pythonuses: actions/setup-python@v4with:
python-version: ${{ matrix.python-version }}-dev # also tried without dev update-environment: true # also tried without this line.
- name: Setup Poetryrun: | curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.1.14 python${{ matrix.python-version }} - name: Load cached poetry packagesid: cached-poetry-dependenciesuses: actions/cache@v2with:
path: .venvkey: poetry-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Poetry install python packagesrun: | CPATH=$pythonLocation/include/python${{ matrix.python-version }}m echo "CPATH=$CPATH" >> $GITHUB_ENV poetry env use ${{ matrix.python-version }} poetry install --no-interactionif: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'Expected behavior:
Installed dependencies.
Actual behavior:
Error:
CPATH=$pythonLocation/include/python3.7
echo"CPATH=$CPATH">>$GITHUB_ENV
poetry install --no-interaction --no-dev
shell: /bin/bash -e {0}
env:
pythonLocation: /home/***/actions-runner/_work/_tool/Python/3.7.13/x64
PKG_CONFIG_PATH: /home/***/actions-runner/_work/_tool/Python/3.7.13/x64/lib/pkgconfig
Python_ROOT_DIR: /home/***/actions-runner/_work/_tool/Python/3.7.13/x64
Python2_ROOT_DIR: /home/***/actions-runner/_work/_tool/Python/3.7.13/x64
Python3_ROOT_DIR: /home/***/actions-runner/_work/_tool/Python/3.7.13/x64
LD_LIBRARY_PATH: /home/***/actions-runner/_work/_tool/Python/3.7.13/x64/lib ...
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-build-env-7iw6i3c7/overlay/lib/python3.8/site-packages/numpy/core/include -I./common -I/home/***/actions-runner/_work/datapipeline/datapipeline/.venv/include -I/opt/hostedtoolcache/Python/3.8.13/x64/include/python3.8 -c ./common/maskApi.c -o build/temp.linux-x86_64-cpython-38/./common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
pycocotools/_mask.c:6:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
...
Description:
I have a workflow that builds and test my Python project. In poetry installation steps
gcccan't find the Python header/s and the build fails. When I checked the/opt/hostedtoolcache/Python/3.8.13/x64/include/python3.8, there is no such directory.Action version:
4
Platform:
Runner type:
Tools version:
3.7.13
3.8.13
Repro steps:
Expected behavior:
Installed dependencies.
Actual behavior:
Error: