skip to navigation
skip to content

sdistmaker 1.4

Make sdists tarballs for projects in svn tree


Create sdist tarballs from svn tags, intended for use with a company-internal svn repository. Creates sdist tarballs into a directory you can then serve with apache.

sdistmaker used to be called tha.sdistmaker before version 1.2.

Installation and basic usage

A simple easy_install sdistmaker is enough. This gives you two scripts:

  • make_sdist, mainly for test purposes. Pass it an svn tag url and a destination dir and it will make a release.
  • sdists_from_tags is the main script. It searches an svn structure for suitable tags and makes releases of them.

For starters, just run sdists_from_tags. It will create a var/private directory and fill it with (as an example!) all zest.releaser releases.

Both scripts have a --help option that show all available options and a usage instruction.


Configuration is by means of a python file. Easiest way to get started is by printing sdistmaker’s own base by doing:

$> sdists_from_tags --print-example-defaults

Save the output as a python file (suggestion: You can then adapt it to your liking and use it with sdists_from_tags The defaults file is documented in-line, so it should be easy to adapt.

Usage in a buildout

You can use sdistmaker in a buildout like this:

parts = sdists

recipe = zc.recipe.egg
eggs = sdistmaker
scripts = sdists_from_tags
# arguments =
#     defaults_file='${buildout:directory}/',

The is created in the same way as above.

Using sdistmaker in combination with the real pypi

A structure like generated with sdistmaker is a perfect index for easy_install and buildout if you let apache host it. Only problem: you can only have one index (note: pip apparently supports multiple indexes). You can solve this problem by having apache redirect you to pypi when something is not found.

Here’s an example apache config snippet:

# Allow indexing
Options +Indexes
IndexOptions FancyIndexing VersionSort

# Start of rewriterules to use our own var/private/* packages
# when available and to redirect to pypi if not.
RewriteEngine On
# Use our robots.txt:
RewriteRule ^/robots.txt - [L]
# Use our apache's icons:
RewriteRule ^/icons/.* - [L]
# We want OUR index.  Specified in a weird way as apache
# searches in a weird way for index.htm index.html index.php etc.
RewriteRule ^/index\..* - [L]

# Use our var/private/PROJECTNAME if available,
# redirect to pypi otherwise:
RewriteCond /path/on/server/var/private/$1 !-f
RewriteCond /path/on/server/var/private/$1 !-d
RewriteRule ^/([^/]+)/?$$1/ [P,L]

# Use our var/private/PROJECTNAME/project-0.1.tar.gz if available,
# redirect to pypi otherwise:
RewriteCond /path/on/server/var/private/$1 !-d
RewriteRule ^/([^/]+)/([^/]+)$$1/$2 [P,L]

Using the apache-served index

You can use such a custom apache-served index in two ways. Easy_install has a -i option for passing along an index:

$> easy_install -i zest.releaser

In buildout, you can set it like this:

index =
parts =

Reporting bugs

You can report bugs or feature requests at


Written by Reinout van Rees. Started while at The Health Agency, improved at Nelen & Schuurmans.

Dev-and-revision-marker fix by Wouter Vanden Hove.


  • Nothing specific at the moment.

Changelog of sdistmaker

1.4 (2010-03-19)

  • Don’t crash when setup.cfg contains dev-and-revisionmarkers. [WouterVH]

1.3 (2010-03-01)

  • Added to get reliable releases with mercurial. Sorry for messing up the 1.2 release and thanks to Maurits for pushing out a quick 1.2.2.

1.2.2 (2010-02-26)

  • Fixed broken release with missing TODO.txt.

1.2.1 (2010-02-25)

  • Small documentation fixes.

1.2 (2010-02-25)

  • Renamed from tha.sdistmaker to sdistmaker.
  • Huge documentation improvement.
  • Using optparse for the scripts so that they have a better usage message. This greatly improves documentation.
  • Not showing the doctest from USAGE.txt anymore in the long description. That just wasn’t readable documentation.
  • The output directory is created when missing.

1.1 (2009-12-22)

  • Documentation update.

1.0 (2009-12-21)

  • cleanup.

0.4 (2009-11-09)

  • Replacing base and base_on_server the right way around, now.

0.2 (2009-11-09)

  • Cleaning up the tempdir after we’re finished with it. And cd’ing out of that dir before zapping it.
  • Using buildout’s bin/python so that we get setuptools also when run on the server where there’s no global setuptools. This assumes we’re always run within buildout: fine with me.

0.1 (2009-11-06)

  • Added sdist_from_tags script for creating all tarballs.
  • Added make_sdist script for creating a single sdist.
  • Initial library skeleton created by thaskel.
File Type Py Version Uploaded on Size
sdistmaker-1.4.tar.gz (md5) Source 2010-03-19 10KB