[Python] python - [tool.poetry] section not found in pyproject.toml when building Singularity...

Discussão em 'Python' iniciado por Stack, Dezembro 1, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to build a Singularity Container to run on HPC environment. I am using poetry to manage python packages.

    The contents of my pyproject.toml file are as follows:

    [tool.poetry]
    name = "haqc"
    version = "0.1.0"
    description = ""
    authors = ["Vivek Katial <vivekkatial@gmail.com>"]

    [tool.poetry.dependencies]
    python = "^3.8"
    ...
    haqc = {path = ".", develop = true}

    [tool.poetry.dev-dependencies]

    [build-system]
    requires = ["poetry-core>=1.0.0"]
    build-backend = "poetry.core.masonry.api"


    Then in my Singularity definition file I have the following to get setup with poetry:

    %post
    pip install --upgrade pip
    git clone https://<REPO>.git
    cd HAQC
    pip install "poetry==$POETRY_VERSION"
    poetry config virtualenvs.create false \
    && poetry install --no-interaction --no-ansi


    Every time I try and build the container I receive the following error, despite the pyproject.toml file being present in the directory at build (I echo'd an ls -lhar to check):

    PyProjectException

    [tool.poetry] section not found in /HAQC/pyproject.toml

    at /usr/local/lib/python3.9/site-packages/poetry/core/pyproject/toml.py:56 in poetry_config
    52│ def poetry_config(self): # type: () -> Optional[TOMLDocument]
    53│ if self._poetry_config is None:
    54│ self._poetry_config = self.data.get("tool", {}).get("poetry")
    55│ if self._poetry_config is None:
    → 56│ raise PyProjectException(
    57│ "[tool.poetry] section not found in {}".format(self._file)
    58│ )
    59│ return self._poetry_config
    60│

    Continue reading...

Compartilhe esta Página