fastapi icon indicating copy to clipboard operation
fastapi copied to clipboard

Building `FastAPI` with `buildroot` `2022.05` (with `flit`support) fails

Open maovidal opened this issue 1 year ago • 0 comments

First Check

  • [X] I added a very descriptive title to this issue.
  • [X] I used the GitHub search to find a similar issue and didn't find it.
  • [X] I searched the FastAPI documentation, with the integrated search.
  • [X] I already searched in Google "How to X in FastAPI" and didn't find any information.
  • [X] I already read and followed all the tutorial in the docs and didn't find an answer.
  • [X] I already checked if it is not related to FastAPI but to Pydantic.
  • [X] I already checked if it is not related to FastAPI but to Swagger UI.
  • [X] I already checked if it is not related to FastAPI but to ReDoc.

Commit to Help

  • [X] I commit to help with one of those options 👆

Example Code

Here are my two `Buildroot's` files for a package named `python-fastapi`:

[Config.in]
config BR2_PACKAGE_PYTHON_FASTAPI
	bool "python-fastapi"
	help
	  FastAPI framework, high performance, easy to learn, fast to code, ready for production

	  https://github.com/tiangolo/fastapi

[python-fastapi.mk]
################################################################################
#
# python-fastapi
#
################################################################################

PYTHON_FASTAPI_VERSION = 0.79.0
PYTHON_FASTAPI_SOURCE = fastapi-$(PYTHON_FASTAPI_VERSION).tar.gz
PYTHON_FASTAPI_SITE = https://files.pythonhosted.org/packages/ae/ed/ea37410618f1c206ba857d391d7b2de6de7a758ea586662aef77c945d3b4
PYTHON_FASTAPI_LICENSE = MIT
PYTHON_FASTAPI_LICENSE_FILES = LICENSE
PYTHON_FASTAPI_SETUP_TYPE = flit

$(eval $(python-package))

Description

The last 2022.05 version of buildroot has support to build python packages that use flit.

I don't know much about the details of how a python is packaged (and less about flit), but I understand that FastAPI provides a pyproject.toml file where the package details are contained.

I was able to successfully build the package once I changed this part of that file:

[build-system]
 requires = ["flit"]
 build-backend = "flit.buildapi"

To this one:

[build-system]
 requires = ["flit"]
 build-backend = "flit_core.buildapi"

But I'm not sure if that breaks it for someone else.

Operating System

Linux

Operating System Details

No response

FastAPI Version

0.79.0

Python Version

3.10.4

Additional Context

No response

maovidal avatar Aug 04 '22 01:08 maovidal