This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

tags2sdists

Tags2sdists creates python sdists from tags into a structure that can serve as a company-internal pypi (python package index).

Basic operation

Tags2sdists looks at two directories:

  • A source directory (“CHECKOUTDIR”) with checkouts. Every checkout (svn trunk checkout, git/hg clone) is examined for tags according to that version control system.
  • A target directory (“SDISTDIR”) where per-package directories are made with sdists named like PACKAGENAME-1.2.tar.gz in it.

Those two directories are kept in sync by checking for packages/tags that are available in the version control system but that are missing in the target directory. If missing, an “sdist” (.tar.gz source distribution) is generated and placed in the target directory.

Usage

Tags2sdists provides the tags2sdists command:

Usage: tags2sdists CHECKOUTDIR SDISTDIR
    CHECKOUTDIR: directory with checkouts
    SDISTDIR: directory with sdist package directories

Options:
  -h, --help     show this help message and exit
  -v, --verbose  Show debug output
  -q, --quiet    Show minimal output

Setup

Installing tags2sdists itself is as simple as pip install tags2sdists or easy_install tags2sdists or including it in your buildout in the regular manner.

Next you need the CHECKOUTDIR and SDISTDIR directories.

CHECKOUTDIR: you need a directory with checkouts. So doing it by hand is fine. But when you use svn, a directory with svn:externals is probably handiest. For everything else (and also for svn), checkoutmanager is the thing I’d use. Make a config file (checkoutmanager.cfg) looking like this:

[internalprojects]
vcs = git
basedir = /srv/packages/var/checkouts/
checkouts =
    git@github.com:lizardsystem/nensskel.git
    git@github.com:lizardsystem/lizard-ui.git
    git@github.com:lizardsystem/tags2sdists.git

And set up a cron job that runs checkoutmanager --configfile=YOURCONFIGFILE, it’ll update the checkouts in the base dir you configured. (In that same cronjob, fire up tags2sdists afterwards).

SDISTDIR: just a directory somewhere will do. You’ll get a pypi-like directory structure in there.

A structure like generated with tags2sdists 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 ^/([^/]+)/?$ http://pypi.python.org/pypi/$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 ^/([^/]+)/([^/]+)$ http://pypi.python.org/pypi/$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 http://packages.my.server/ zest.releaser

In buildout, you can set it like this:

[buildout]
index = http://packages.my.server/
parts =
    ...

Development

Credits

Changelog of tags2sdists

1.2 (2015-05-26)

  • Compensating for newer setuptools versions.

1.1 (2013-07-12)

  • New way of searching for missing tags: we leave old unneeded/wrong/renamed ones alone.
  • Removing tags with ‘dev’ in their name from the list of missing tags.

1.0 (2013-01-15)

  • Fixed the temp dir cleanup: under certain circumstances it left an empty directory.

0.7.1 (2011-12-08)

  • Switching back to the correct directory after 0.7’s temp dir cleanup.

0.7 (2011-12-08)

  • Added more logging related to 0.6’s corner case.
  • Cleaning up the temp dir after a run.

0.6 (2011-12-07)

  • Compensating for a corner case where a package was renamed.

0.5 (2011-10-17)

  • Fix for faulty setup.py’s in checkout directories. An error in there would generate a directory named Traceback\ (most\ recent\ call\ last): in the sdist directory…

0.4 (2011-10-12)

  • Internally, the directories passed on the commandline are made absolute. Necessary as there’s quite some os.chdir() going around.

0.3 (2011-10-12)

  • Added documentation.
  • Renamed script from make_sdists to tags2sdists.

0.2 (2011-10-11)

  • Added script that combines the sdist tarball creation with the target directory parsing and that generates all the necessary tarballs.
  • Added creation (via zest.releaser) of a single sdist tarball.

0.1 (2011-10-10)

  • Added parsing of a target directory with sdists.
  • Initial library skeleton created by nensskel.
Release History

Release History

1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.7.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
tags2sdists-1.2.tar.gz (23.4 kB) Copy SHA256 Checksum SHA256 Source May 26, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting