Tarek Ziade explained this, and related software packaging tools, in this article (broken original link) called Writing a Package in Python.

Basically, it creates a simple package by creating a release tree where everything needed to run the package is copied. This tree is then archived in one or many archived files (often, it just creates one tar ball). The archive is basically a copy of the source tree.

Answer from Michael Dillon on Stack Overflow
🌐
Python
docs.python.org › 3.10 › distutils › sourcedist.html
4. Creating a Source Distribution — Python 3.10.22 documentation
The meanings should be fairly clear: include all files in the distribution root matching *.txt, all files anywhere under the examples directory matching *.txt or *.py, and exclude all directories matching examples/sample?/build. All of this is done after the standard include set, so you can exclude files from the standard set with explicit instructions in the manifest template. (Or, you can use the --no-defaults option to disable the standard set entirely.) There are several other commands available in the manifest template mini-language; see section Creating a source distribution: the sdist command.
🌐
Python Packaging
packaging.python.org › specifications › source-distribution-format
Source distribution format - Python Packaging User Guide
There is also the legacy source distribution format, implicitly defined by the behaviour of distutils module in the standard library, when executing setup.py sdist.
🌐
Python
wiki.python.org › moin › Distutils › Tutorial
Distutils/Tutorial - Python Wiki
distutils:$ python setup.py sdist running sdist reading manifest file 'MANIFEST' creating appname-100 creating appname-100/package creating appname-100/package/things making hard links in appname-100...
🌐
Medium
medium.com › jacklee26 › how-to-create-the-first-python-package-de6464799bc3
How to create the first python package | by CC(ChenChih) | Chen-Chih’s Portfolio Page | Medium
December 22, 2021 - After changing the name from pkgtest to pkgtests, we have to rebuild it again using python setup.py sdist bdist_wheel .
🌐
Medium
medium.com › ochrona › understanding-python-package-distribution-types-25d53308a9a
Understanding Python Package Distribution Types | by Andrew Scott | Ochrona Security | Medium
August 6, 2020 - A source distribution, or more commonly sdist, is a distribution that contains all of the python source code (i.e. .py files), any data files that the library requires, and a setup.py file which describes to the setuptools module how your python code should be packaged...
🌐
Tudelft
kbs.twi.tudelft.nl › Documentation › Programming › python-2.1 › dist › source-dist.html
5 Creating a Source Distribution
Following the Distutils' own manifest template, let's trace how the sdist command builds the list of files to include in the Distutils source distribution: include all Python source files in the distutils and distutils/command subdirectories (because packages corresponding to those two directories were mentioned in the · packages option in the setup script--see section 3) include README.txt, setup.py, and setup.cfg (standard files)
🌐
GeeksforGeeks
geeksforgeeks.org › source-distribution-and-built-distribution-in-python
Source distribution and built distribution in python - GeeksforGeeks
March 9, 2023 - Lastly type setup.py sdist. This will make a source distribution. After the execution of the following command, a dist folder which will contain a nester1-1.1.0.tar file in it and a MANIFEST FILE which contains the list of python(.py) files ...
🌐
PyPA
setuptools.pypa.io › en › latest › deprecated › commands.html
Running setuptools commands - setuptools 84.0.0 documentation
While it is perfectly fine that users write setup.py files to configure a package build (e.g. to specify binary extensions or customize commands), on recent versions of setuptools, running python setup.py directly as a script is considered deprecated. This also means that users should avoid running commands directly via python setup.py <command>. If you want to create sdist or wheel distributions the recommendation is to use the command line tool provided by build:
Find elsewhere
🌐
GitHub
github.com › pytest-dev › pytest › issues › 9225
Don't use `python setup.py sdist bdist_wheel` in release CI workflow · Issue #9225 · pytest-dev/pytest
October 21, 2021 - Currently our release CI workflow uses python setup.py sdist bdist_wheel to create the sdist and wheel artifacts which are uploaded to PyPI during a release: pytest/.github/workflows/main.yml Lines 227 to 229 in 4a38341 - name: Build pac...
Author: pytest-dev
🌐
Grimoire
grimoire.carcano.ch › the grimoire of a modern linux professional › blog › scripting › python setup tools
Python Setup Tools - sdist bdist and wheel and push toPyPI
June 28, 2026 - @(cd src; python3 setup.py nosetests >/dev/null) sdist: release clean $(info -> Makefile: building the sdist distribution package ...) @(cd src; python3 setup.py sdist) bdist: release clean $(info -> Makefile: building the bdist distribution package ...) @(cd src; python3 setup.py bdist) wheel: release clean $(info -> Makefile: building the wheel distribution package ...)
🌐
Python
docs.python.org › 2.3 › dist › source-dist.html
5 Creating a Source Distribution
The manifest template is just a ... list of files to include in your source distribution. The sdist command processes this template and generates a manifest based on its instructions and what it finds in the filesystem....
🌐
pytz
pythonhosted.org › an_example_pypi_project › setuptools.html
Getting Started With setuptools and setup.py — an_example_pypi_project v0.0.5 documentation
This is what is necessary so someone can use easy_install your_project. bdist_wininst: This will create an .exe that will install your project on a windows machine. sdist: This create a raw source distribution which someone can download and run python setup.py directly.
🌐
Python
docs.python.org › 2 › distutils › sourcedist.html
4. Creating a Source Distribution — Python 2.7.18 documentation
July 1, 2020 - ... As shown in section A Simple Example, you use the sdist command to create a source distribution. In the simplest case, ... (assuming you haven’t specified any sdist options in the setup script or config file), sdist creates the archive of the default format for the current platform.
🌐
GitHub
github.com › pypa › setuptools › blob › main › setuptools › command › sdist.py
setuptools/setuptools/command/sdist.py at main · pypa/setuptools
for ep in metadata.entry_points(group='setuptools.file_finders'): yield from ep.load()(dirname) · · class sdist(orig.sdist): """Smart sdist that finds anything supported by revision control""" · # Match the (narrower) type of the distutils sdist base rather than the · # Command base union, which mypy rejects as an incompatible override when · # distutils stubs are present (Python < 3.12).
Author: pypa
🌐
GitHub
github.com › pypa › setuptools-scm › issues › 487
python setup.py sdist only works with `pyproject.toml` when package is pre-installed in venv · Issue #487 · pypa/setuptools-scm
October 30, 2020 - I am hitting what seems to be an edge when combining python setup.py sdist, setup.py, and pyproject.toml. Here is my pyproject.toml: [build-system] requires = ["setuptools", "wheel", "setuptools_scm[toml]"] [tool.setuptools_scm] write_to...
Author: pypa
🌐
Python Packaging
packaging.python.org › guides › distributing-packages-using-setuptools
Packaging and distributing projects - Python Packaging User Guide
You’ll need this to upload your project distributions to PyPI (see below). The most important file is setup.py which exists at the root of your project directory.
🌐
Python
docs.python.org › 3.6 › distutils › introduction.html
1. An Introduction to Distutils — Python 3.6.15 documentation
To create a source distribution ... and run this command from a terminal: ... sdist will create an archive file (e.g., tarball on Unix, ZIP file on Windows) containing your setup script setup.py, and your module foo.py....