question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

First Check

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

Commit to Help

  • 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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
maovidalcommented, Sep 5, 2022

It seems buildroot currently does not have support for Hatch. But I noted that pypa is on its way to embrace it, so that’s something to work on the buildroot side. Thank you for the heads up @iudeen

0reactions
iudeencommented, Sep 4, 2022

Once FastAPI drops support for python 3.6, it’d most likely move away from flit towards Hatch. Will it solve your problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · tiangolo/fastapi · GitHub
FastAPI framework, high performance, easy to learn, fast to code, ... Building FastAPI with buildroot 2022.05 (with flit support) fails question Further ...
Read more >
response cookie values need use 'utf-8' encode,about tiangolo/fastapi
I searched the FastAPI documentation, with the integrated search. ... Building `FastAPI` with `buildroot` `2022.05` (with `flit`support) fails ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found