setuptools patch

James Mills prologic at shortcircuit.net.au
Fri Oct 26 04:46:57 CDT 2007


Hi all,

Please review and comment (again). I'd like to see
this patch in Mercurial as it'll help with development
for those that like to use setuptools and we'll (I can)
be able to provide EGG distributions of Mercurial
in future releases.

cheers
James

<patch>
# HG changeset patch
# User James Mills
# Date 1192946791 -36000
# Node ID cc1b17c7863f06abccd2651fefea21adc376f47a
# Parent  3b204881f95927d1522484e67dbd9f947c46ba29
Adds setuptools support for easier development and building egg dists

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -16,6 +16,7 @@ build
 build
 contrib/hgsh/hgsh
 dist
+mercurial.egg-info
 doc/*.[0-9]
 doc/*.[0-9].gendoc.txt
 doc/*.[0-9].{x,ht}ml
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -10,12 +10,22 @@ if not hasattr(sys, 'version_info') or s
     raise SystemExit, "Mercurial requires python 2.3 or later."
 
 import os
-from distutils.core import setup, Extension
+
+extra = {}
+
+try:
+	from setuptools import setup, Extension
+	extra["entry_points"] = """
+[console_scripts]
+hg = mercurial.dispatch:run
+"""
+except ImportError:
+	from distutils.core import setup, Extension
+
 from distutils.command.install_data import install_data
 
 import mercurial.version
 
-extra = {}
 
 # py2exe needs to be installed to work
 try:
</patch>

-- 
--
-"Problems are Solved by Method"
-
- James Mills <prologic at shortcircuit.net.au>
- HomePage: http://shortcircuit.net.au/~prologic/
- IRC: irc://shortcircuit.net.au#se

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


More information about the Mercurial-devel mailing list