Python - Source Distribution (sdists)

> Procedural Languages > Python > Python - (Shipping|Packaging)

1 - About

Code Shipping - Source (Distribution|Archive) in Python.

Source distributions are also known as sdists for short.

Advertising

3 - Management

3.1 - Create

With Python 3 - SetupTools and its's Python - setup.py script.

cd /project
python setup.py sdist

3.2 - Root

Some projects use a src or lib subdirectory as the source root

# for src
package_dir={'': 'src'},  # tell distutils packages are under src
packages=find_packages('src'),
# or for lib
package_dir={'': 'lib'},
packages=find_packages('lib'),
setup.cfg
[options]
package_dir=
    =src
packages=find:
 
[options.packages.find]
where=src
  • On the command line
--egg-base=SOURCEDIR, -e SOURCEDIR