setuptools_hg /

Filename Size Date modified Message
101 B
853 B
225 B
17.6 KB
1.8 KB
1.5 KB
3.8 KB


setuptools_hg is a plugin for setuptools/distribute to enable it to find files under the Mercurial version control system.

It uses the Mercurial Python library by default and falls back to use the command line programm hg(1). That's especially useful inside virtualenvs that don't have access to the system wide installed Mercurial lib (e.g. when created with --no-site-packages).


The setuptools feature

You can read about the hooks used by setuptool_hg in the setuptools or distribute documentation. It basically returns a list of files that are under Mercurial version control when running the setup function, e.g. if you create a source and binary distribution. It's a simple yet effective way of not having to define package data (non-Python files) manually in MANIFEST templates (


Here's an example of a that uses setuptools_hg:

from setuptools import setup, find_packages


If you run this setuptools will automatically download setuptools_hg to the directory where the is located at (and won't install it anywhere else) to get all package data files from the Mercurial repository.


Set the HG_SETUPTOOLS_FORCE_CMD environment variable before running if you want to enforce the use of the hg command. """

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.