Home

sdist

sdist, short for source distribution, is a distribution archive that contains the source code and metadata needed to build a Python project from source. It is designed to be portable across systems so that users can build and install the package on platforms where pre-built binaries are not available.

sdists are created by packaging tools such as setuptools via the sdist command or other modern build

A source distribution usually contains the project’s source code alongside metadata files such as setup.cfg, pyproject.toml,

In the distribution ecosystem, sdists are one way to distribute Python packages, complementing built distributions like

tools
that
produce
a
source
distribution,
often
invoked
as
python
setup.py
sdist
or
with
commands
provided
by
pyproject-based
workflows.
The
resulting
archive
is
typically
a
tar.gz
on
Unix-like
systems
or
a
zip
file
on
Windows.
The
contents
are
assembled
according
to
configuration
files
like
MANIFEST.in
and
the
project’s
metadata,
including
source
files,
the
setup
script
or
build
configuration,
and
necessary
documentation
or
licenses.
and
a
METADATA
or
PKG-INFO
file,
plus
README,
LICENSE,
and
package
directories.
It
may
also
include
tests
and
additional
data
needed
for
building,
depending
on
the
configuration
and
exclusions
defined
in
MANIFEST.in
or
version
control
ignore
rules.
The
exact
contents
are
controlled
to
ensure
that
a
consumer
can
reproduce
a
build
from
source.
wheels.
Pip
can
install
from
an
sdist
URL
or
local
file,
and
PyPI
hosts
both
sdists
and
wheels.
Sdists
enable
platform-independent
source
builds
and
reproducible
installations
when
a
suitable
build
environment
is
available.