# setuptools — card for AI agents

Extensible Python build backend with C/C++ extension module and packaging support.

Category: Build tools and bundlers · PyPI package `setuptools` · latest version 84.2.1 (checked 2026-11-01)
Install: `pip install setuptools`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Numbers (AgentGid data)
- Gid Score: 69.7 (#401 of all tools, 21 of 185 in its category)
- Used in 45 public projects set up for AI coding agents (0.7%)
- Downloads last week: 263,892,674 (as of 2026-11-24), +10.1% over 4 weeks
- GitHub stars: 2,872 (as of 2026-11-24)
- Last push: 2026-10-29

## Often used with
Requests 60.0%, NumPy 53.3%, Uvicorn 53.3%, python-dotenv 48.9%, FastAPI 46.7%, Pydantic 46.7%

## Checked alternatives (same job)
- build: https://agentgid.com/tools/build/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/setuptools/
- Repository: https://github.com/pypa/setuptools


## setuptools: turn Python code into installable packages

setuptools is the free, long-standing tool that packs Python code into files others can install with pip or upload to PyPI. You describe the package in one pyproject.toml file, and a build command makes the installable files. It can also compile C or C++ parts for speed.

### Where to use it
- Share your code as a package: Your helper code is used in several projects; you pack it once and install it everywhere instead of copying files around.
- Give your tool a command name: After install, people type tipcalc 48.30 in the terminal instead of python -m tipcalc.cli.
- Speed up a hot spot with C: One slow function is rewritten in C, and setuptools compiles it into the package during the build.
- Ship data files with the code: A file of rates or a template travels inside the package, and the code reads it wherever the package is installed.
- Edit code without reinstalling: While you work on the package, changes show up right away in the environment where it is installed.
- One private package for many services: Several small backend services share models and helpers; a versioned internal package keeps them in step. (idea, not from the official pages)

### How to start
- Put a build-system section in pyproject.toml at the root of your project.

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

- Add the project name, version and dependencies in a [project] table in the same file.

```
[project]
name = "mypackage"
version = "0.0.1"
dependencies = [
    "requests",
]
```

- Build the package files with the build tool.

```
pip install --upgrade build
python -m build
```


### License
Free to use in paid and closed products under the MIT license. Keep the license notice if you ship setuptools' own files.

### Good to know
- You rarely install it by hand; the build tool downloads it when it builds your package.
- Version 84 needs Python 3.10 or newer.
- Running python setup.py yourself is discouraged; most of those commands are or will be removed.
- C parts need a compiler and any outside libraries on the machine that builds the package.
- The project is active; version 84.2.1 came out on 20 October 2026.

Checked 2026-11-11 against: https://setuptools.pypa.io/en/latest/, https://setuptools.pypa.io/en/latest/userguide/quickstart.html, https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html, https://setuptools.pypa.io/en/latest/userguide/ext_modules.html, https://setuptools.pypa.io/en/latest/history.html, https://github.com/pypa/setuptools/blob/main/LICENSE, https://pypi.org/pypi/setuptools/84.2.1/json, https://pypi.org/pypi/setuptools/json, https://github.com/pypa/setuptools/blob/main/README.rst

### Mistakes to avoid
- Don't: import pkg_resources  (versions, entry points or data files) → Do: from importlib.metadata import version, entry_points  /  from importlib.resources import files (pkg_resources was removed in setuptools 82.0.0; in our run with 84.2.1 the import raised ModuleNotFoundError.)
- Don't: python setup.py sdist bdist_wheel  or  python setup.py install → Do: python -m build  to make files;  pip install .  to install (Calling setup.py as a script is strongly discouraged and its commands are being removed.)
- Don't: requires = ["setuptools", "wheel"] → Do: requires = ["setuptools"] (Old guides listed wheel; the backend no longer needs it.)
- Don't: license = {text = "MIT"}  plus License :: classifiers → Do: license = "MIT"  (an SPDX string) and license-files = ["LICENSE"] (Since 77.0.0 the table form is deprecated and license classifiers raise a warning or an error.)
- Don't: requires = ["setuptools[core]"] → Do: requires = ["setuptools"] (The core extra is internal and may go away; the docs ask package authors not to use it.)

### Questions
- Do I still need a setup.py file? Usually not. All settings can live in pyproject.toml; a small setup.py is only needed for dynamic parts such as C extensions.
- Should I list wheel in build-system requires? No. The backend no longer needs it, and listing it adds a needless requirement for source builds.
- Where did pkg_resources go? It was removed in setuptools 82.0.0; use importlib.metadata and importlib.resources from the standard library.
- How do I upload the package to PyPI? setuptools only builds the files; the docs point to twine for the upload.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
