Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For most new Python packages, put project metadata in pyproject.toml, choose a build backend that fits the project, and use a frontend such as build to create the distributions. The frontend runs the build; the backend decides how the package is assembled. The right backend depends on your package layout, compatibility needs, and whether you build native extensions.

What Python build tools do

Building a Python package means producing files that users or package indexes can install and distribute. The two main artifacts are a source distribution (sdist), which contains source files and packaging metadata, and a wheel, which is a built distribution. A wheel may be pure Python or specific to a platform and Python implementation, as with many compiled extensions.

The backend controls package-specific work: discovering files, deciding what goes into the artifacts, generating metadata, and creating the distributions. Because inclusion rules and metadata can differ, inspect the resulting artifacts rather than assuming that a successful build contains exactly what you intended. The PyPA packaging tutorial shows a common starter layout with a license, pyproject.toml, README, src/ package, and tests.

Frontend vs. backend: what is the difference?

A build frontend reads project configuration and invokes standardized build hooks. A backend implements those hooks and performs the actual package build. For example, build is a frontend commonly run as python -m build; it can work with different backends. This separation lets the same frontend build packages configured for different backend systems.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

With an isolated build, the frontend can install the requirements listed for the build in a temporary environment before invoking the backend. This helps separate build-time dependencies from the project environment. The build frontend documentation explains that process, and its backend guide describes the division of responsibility.

Which Python build backend should you use?

Choose based on the package and the workflow you need, not on an unsupported assumption that one backend is universally fastest or most popular. The distinctions below reflect documented use cases, not a comparative performance test. Check each project’s current documentation before migrating or relying on a particular feature.

Project or workflow Candidate backend Why it may fit
Straightforward pure-Python package Flit-core or Hatchling Both are options for relatively simple packages. Hatchling also offers plugins and common layout conventions.
Broad compatibility or substantial customization, including C extensions, namespace packages, or entry points Setuptools It is mature and capable, while carrying more legacy concepts and configuration complexity.
C or C++ extension built with CMake scikit-build-core It integrates package building with CMake and modern package metadata.
Extension project already using Meson meson-python It integrates the package build with Meson.
Existing Poetry-centered workflow poetry-core / Poetry It can keep packaging aligned with that ecosystem. Custom [tool.poetry] metadata may be less interoperable in some contexts.
PDM workflow or a need for dynamic metadata or build hooks pdm-backend It supports standard metadata along with backend-specific features.

These choices are not mutually exclusive recommendations for every project. In particular, native extensions make the build system and compiler workflow important: select a backend that fits the native build system already used by the project, or plan the migration deliberately.

What belongs in pyproject.toml?

pyproject.toml is the central modern configuration file, but its tables have different jobs. The PyPA guide to writing pyproject.toml recommends [project] metadata for new projects and explains backend declarations. The formal specification defines the file’s standard fields.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
  • [build-system] declares the packages needed to build and the backend import path.
  • [project] holds standard project metadata understood by most backends, such as the name, version, and dependencies.
  • [tool] contains tool-specific configuration, including backend-specific settings when necessary.

Backend declarations should follow that backend’s documentation. The current PyPA guide provides examples for Hatchling, setuptools, Flit, PDM, and uv-build. Their import paths include hatchling.build, setuptools.build_meta, flit_core.buildapi, pdm.backend, and uv_build. Treat version examples in a guide as time-sensitive: check the backend documentation for the version you intend to install.

License metadata and backend versions

The current PyPA guide lists these minimum backend versions for PEP 639 license metadata support: Hatchling 1.27.0, setuptools 77.0.3, flit-core 3.12, pdm-backend 2.4.0, poetry-core 2.2.0, and uv-build 0.7.19. These are version-specific support thresholds, not a promise that older releases support the same fields. The specification defines license as an SPDX license expression and license-files as paths or glob patterns for legal notices included in distribution archives.

Do you still need setup.py?

Not necessarily. For a new project, the PyPA guidance recommends standard metadata in [project] in pyproject.toml. Setuptools still supports legacy setup.py and setup.cfg configuration; those formats remain valid for compatibility and special cases. You do not need to replace a working legacy project solely because the modern configuration format exists, but new work can generally start with pyproject.toml.

Poetry’s metadata format is also version-sensitive: before Poetry 2.0, released January 5, 2025, it supported only [tool.poetry] metadata; from version 2.0 onward it supports [project] as well. Check the documentation for the installed Poetry version if you are changing metadata layout.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

How to build a wheel and source distribution

The following is a minimal example for a pure-Python project using Hatchling. It assumes a recent Python installation, a project directory with a package under src/, and a README. The example version is a configuration choice, not a universal minimum; consult the backend’s documentation and use compatible versions for your environment.

1. Declare the backend and project metadata

Save a configuration like this as pyproject.toml, adjusting the package name, version, description, and README to your project:

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "example-package"
version = "0.1.0"
description = "An example Python package"
readme = "README.md"
requires-python = ">=3.9"

[tool.hatch.build.targets.wheel]
packages = ["src/example_package"]

Use your actual import package directory in the wheel target. The fields shown are an example; a real project should declare its applicable metadata and dependencies. If the backend needs a particular version or additional build requirements, follow its documentation and specify those requirements in [build-system].requires.

2. Build with the frontend

From the project root, install the frontend and ask it to build the distributions:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
python -m pip install build
python -m build

By default, this builds an sdist and wheel into dist/. The frontend uses the backend declared in pyproject.toml and, by default, builds in an isolated environment using the declared build requirements.

3. Inspect what you are about to publish

Check that the wheel and sdist both exist and contain the intended package files, README, license notices, and metadata. For example, list archive contents with:

python -m zipfile -l dist/example_package-0.1.0-py3-none-any.whl
python -m tarfile -l dist/example_package-0.1.0.tar.gz

Artifact names vary with project version and wheel tags, so replace the example filenames with the files actually present in dist/. If files are missing or extra files appear, check the backend’s file-selection rules and its configuration before publishing. Backend behavior determines artifact contents.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common build problems and fixes

  • Missing build backend or module: The declared backend import path or build requirement may be incorrect, or the required package may not have been installed. Verify build-backend and requires against that backend’s documentation, then rebuild.
  • Build requirement cannot be installed: The isolated environment must be able to resolve the packages named under [build-system].requires. Check spelling, version constraints, and access to the configured package index; avoid relying on a locally installed backend that is not declared.
  • Wheel is missing package files: Review the backend’s package discovery and inclusion settings. With a src/ layout, ensure the configured package path matches the actual directory, then inspect the rebuilt wheel.
  • License or metadata is rejected or absent: Confirm the metadata is expressed using the supported fields and syntax, and that the backend version supports those fields. For PEP 639 license metadata, compare your backend version with the version-specific thresholds listed above.
  • Native extension fails to compile: Confirm the project has the compiler and native build prerequisites required by its chosen toolchain. Match the backend to the project’s CMake, Meson, or other existing build workflow, and consult that backend’s documentation for platform-specific setup.
  • Legacy setup configuration is ignored or conflicts with modern metadata: Identify which source of configuration the backend is using. Move standard metadata to [project] when appropriate, and retain legacy files only where needed for compatibility or documented special behavior.

Build reliability, performance, and cost

Isolated builds make declared build requirements explicit and reduce dependence on incidental packages installed in a developer’s environment. They can require fetching the declared build dependencies, so a build may fail when those dependencies cannot be resolved. Reproducibility still depends on the project’s requirements, tool versions, and native toolchain; the configuration alone does not guarantee identical artifacts on every machine.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

No measured performance comparison among the backends is established here, so choose by supported capabilities and project fit rather than assumed speed. Review the produced artifacts before release, especially after changing backends or build configuration. The referenced packaging documentation does not establish a universal build cost; practical cost depends on the project’s dependencies, native compilation, and build environment.

A separate tool for website screenshots

Python package builders do not capture webpages. If a development workflow also needs website screenshots, ScreenshotNeo is a separate screenshot API and MCP server from Yorker Media. It can return a screenshot or PDF from a URL; its purpose is unrelated to building Python distributions.

Or skip the browser setup

A single GET request can capture a URL. See the ScreenshotNeo documentation for API options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up for ScreenshotNeo and get 1,000 screenshots a month free with no card.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.