fastapi
fastapi copied to clipboard
Update package metadata
Background
Hello there! The Python packaging ecosystem has standardized on the interface for build backends (PEP 517/PEP 660) and the format for metadata declaration (PEP 621/PEP 631).
So, I'm spending my free time updating important projects so that they are modernized and set an example for others π
The is a follow-up to https://github.com/samuelcolvin/pydantic/pull/4282
Summary of changes
Metadata
This implements PEP 621 and removes Flit as a development dependency, allowing pip
to be used directly which simplifies the contributing workflow and CI/CD. The build backend hatchling
(of which I am a maintainer in the PyPA) is now used as that is the default in the official Python packaging tutorial. Hatchling is available on all the major distribution channels such as Debian, Fedora, Arch Linux, conda-forge, Nixpkgs, Alpine Linux, FreeBSD, Gentoo Linux, MacPorts, OpenEmbedded, Spack, etc.
Python support
The earliest supported Python 3 version of Hatchling is 3.7, therefore I've also set that as the minimum here. Python 3.6 is EOL and other build backends like flit-core
and setuptools
also dropped support. Python 3.6 accounts for 3-4% of downloads in the last month: https://pypistats.org/packages/fastapi
If support is still desired for some reason, I can keep the existing cap and only require 3.7+ in CI/CD.
Documentation
I updated the contributing docs, which accounts for most of the diff. Luckily, they were written in such a way that going from flit
to pip
didn't alter semantics for any language!
Future
- We now have the ability to ship optional wheels compiled with Mypyc, as Black recently did, to be even faster in benchmarks. Though as @tiangolo mentioned offline, it may be best to wait for the great work @samuelcolvin is doing on Pydantic v2 to be over to be sure we don't cause any disruptions in their test suite.
- We could source the version from Git
Codecov Report
Merging #5240 (90950e3) into master (b2aa359) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #5240 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 540 540
Lines 13951 13947 -4
=========================================
- Hits 13951 13947 -4
Impacted Files | Coverage Ξ | |
---|---|---|
fastapi/encoders.py | 100.00% <ΓΈ> (ΓΈ) |
|
fastapi/concurrency.py | 100.00% <100.00%> (ΓΈ) |
|
fastapi/dependencies/utils.py | 100.00% <100.00%> (ΓΈ) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
π Docs preview for commit 0c10260b238311fa23206bf81946ab2b38c43119 at: https://62ef63a1ba5a2255983c34e7--fastapi.netlify.app
Ah looks like the 3.6 job is hard coded in this repo's GitHub settings as required.
π Docs preview for commit 8ed4d8a1f3da32f78b8142b8e2d0b184e9b186d8 at: https://62fdccd962cae252d9a65fc8--fastapi.netlify.app
π Docs preview for commit ab290a9237660af406f530edb995b751dda2b6fb at: https://62fdd03bc009ce60bf4787ee--fastapi.netlify.app
π Docs preview for commit 8ee7c5e3d5a3b42a0e5d09dd677d50d49cc46d61 at: https://632218ad6f7e673abce043d5--fastapi.netlify.app
π Docs preview for commit c52e2ee5e39e77914daf62f8688a0a6fcac5d120 at: https://63221a832b16da3418038c4d--fastapi.netlify.app
π Docs preview for commit 90950e312f6d29a1a6d367b09e092c9b341337c5 at: https://63221be7afbe8635f3f1102d--fastapi.netlify.app
Awesome job, thanks a lot @ofek! FastAPI is now built with Hatch. :egg: :snake: :sunglasses:
Also, Python 3.6 is now officially NOT supported. :fire: