Search code examples
pythonpippip-toolspip-compile

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_sdist


I was creating a Python library, I needed to compile the pyproject.toml file.

I runned this command:

pip-compile pyproject.toml --resolver=backtracking

I got:

Backend subprocess exited when trying to invoke get_requires_for_build_wheel Failed to parse .\pyproject.toml

My pyproject.toml:

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "filedump"
version = "1.0.0"
description = "Save multiple values to a .svf file (not encrypted)"
readme = "README.md"
authors = [{ name = "------", email = "-------------------" }]
license = { file = "LICENSE" }
classifiers = [
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python",
    "Programming Language :: Python :: 3",
]
keywords = ["file", "encoding"]
requires-python = ">=3.9"

[project.optional-dependencies]
dev = ["pip-tools"]

[project.urls]
Homepage = "https://github.com/-----------------------"

[project.scripts]
file = "filedump.FileOperation()"

My project root:

filedump\
|-- src\
|-- |___ __init__.py
|-- LICENSE
|-- MANIFEST.in
|-- pyproject.toml
|-- README.md

Solution

  • Try adding

    [tools.setuptools]
    packages = ["src"]
    

    to your pyproject.toml
    See the following page for details, major thanks to Keith R. Petersen on this one :)