author | Stuart W Marks <smarks@smarks.org> |
Thu, 17 Sep 2009 22:39:38 -0700 | |
changeset 9468 | b2310903c462 |
parent 9142 | 63cfacb7917e |
child 9539 | c904e76e3834 |
permissions | -rw-r--r-- |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
1 |
#!/usr/bin/env python |
575 | 2 |
# |
3 |
# This is the mercurial setup script. |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
4 |
# |
4816
c10d3bc05a8d
setup.py not executable: change instructions at beginning of file
Christian Ebert <blacktrash@gmx.net>
parents:
4628
diff
changeset
|
5 |
# 'python setup.py install', or |
c10d3bc05a8d
setup.py not executable: change instructions at beginning of file
Christian Ebert <blacktrash@gmx.net>
parents:
4628
diff
changeset
|
6 |
# 'python setup.py --help' for more options |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
7 |
|
1873
205f04b04ec6
Added check for minimal python version to setup.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1777
diff
changeset
|
8 |
import sys |
8286
707bc82ba0d7
setup: require Python 2.4
Martin Geisler <mg@lazybytes.net>
parents:
8283
diff
changeset
|
9 |
if not hasattr(sys, 'version_info') or sys.version_info < (2, 4, 0, 'final'): |
707bc82ba0d7
setup: require Python 2.4
Martin Geisler <mg@lazybytes.net>
parents:
8283
diff
changeset
|
10 |
raise SystemExit("Mercurial requires Python 2.4 or later.") |
1873
205f04b04ec6
Added check for minimal python version to setup.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1777
diff
changeset
|
11 |
|
7558
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
12 |
# Solaris Python packaging brain damage |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
13 |
try: |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
14 |
import hashlib |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
15 |
sha = hashlib.sha1() |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
16 |
except: |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
17 |
try: |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
18 |
import sha |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
19 |
except: |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
20 |
raise SystemExit( |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
21 |
"Couldn't import standard hashlib (incomplete Python install).") |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
22 |
|
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
23 |
try: |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
24 |
import zlib |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
25 |
except: |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
26 |
raise SystemExit( |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
27 |
"Couldn't import standard zlib (incomplete Python install).") |
dc211ad8d681
setup: warn about missing standard Python components
Matt Mackall <mpm@selenic.com>
parents:
7081
diff
changeset
|
28 |
|
8547
548fd7a05373
setup.py: subprocess instead of os.popen, sys.stderr.write instead of print
Christian Ebert <blacktrash@gmx.net>
parents:
8494
diff
changeset
|
29 |
import os, subprocess, time |
6251
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
30 |
import shutil |
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
31 |
import tempfile |
72 | 32 |
from distutils.core import setup, Extension |
7722
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
33 |
from distutils.dist import Distribution |
157
2653740d8118
Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents:
155
diff
changeset
|
34 |
from distutils.command.install_data import install_data |
7649
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
35 |
from distutils.command.build import build |
7722
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
36 |
from distutils.command.build_py import build_py |
7649
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
37 |
from distutils.spawn import spawn, find_executable |
6245
0d0939b2d272
setup.py: skip inotify if there's no inotify_add_watch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6241
diff
changeset
|
38 |
from distutils.ccompiler import new_compiler |
157
2653740d8118
Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents:
155
diff
changeset
|
39 |
|
3893 | 40 |
extra = {} |
6513
66e87c11447d
Add a batch file driver for Windows
Paul Moore <p.f.moore@gmail.com>
parents:
6389
diff
changeset
|
41 |
scripts = ['hg'] |
66e87c11447d
Add a batch file driver for Windows
Paul Moore <p.f.moore@gmail.com>
parents:
6389
diff
changeset
|
42 |
if os.name == 'nt': |
66e87c11447d
Add a batch file driver for Windows
Paul Moore <p.f.moore@gmail.com>
parents:
6389
diff
changeset
|
43 |
scripts.append('contrib/win32/hg.bat') |
3893 | 44 |
|
6251
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
45 |
# simplified version of distutils.ccompiler.CCompiler.has_function |
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
46 |
# that actually removes its temporary files. |
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
47 |
def has_function(cc, funcname): |
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
48 |
tmpdir = tempfile.mkdtemp(prefix='hg-install-') |
6373
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
49 |
devnull = oldstderr = None |
6251
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
50 |
try: |
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
51 |
try: |
6373
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
52 |
fname = os.path.join(tmpdir, 'funcname.c') |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
53 |
f = open(fname, 'w') |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
54 |
f.write('int main(void) {\n') |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
55 |
f.write(' %s();\n' % funcname) |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
56 |
f.write('}\n') |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
57 |
f.close() |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
58 |
# Redirect stderr to /dev/null to hide any error messages |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
59 |
# from the compiler. |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
60 |
# This will have to be changed if we ever have to check |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
61 |
# for a function on Windows. |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
62 |
devnull = open('/dev/null', 'w') |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
63 |
oldstderr = os.dup(sys.stderr.fileno()) |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
64 |
os.dup2(devnull.fileno(), sys.stderr.fileno()) |
9124
632df73485ae
setup.py: don't pollute the current directory with temporary files
Bryan O'Sullivan <bos@serpentine.com>
parents:
8936
diff
changeset
|
65 |
objects = cc.compile([fname], output_dir=tmpdir) |
6251
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
66 |
cc.link_executable(objects, os.path.join(tmpdir, "a.out")) |
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
67 |
except: |
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
68 |
return False |
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
69 |
return True |
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
70 |
finally: |
6373
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
71 |
if oldstderr is not None: |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
72 |
os.dup2(oldstderr, sys.stderr.fileno()) |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
73 |
if devnull is not None: |
7010e4557963
setup.py: hide compiler error messages while searching for inotify
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6251
diff
changeset
|
74 |
devnull.close() |
6251
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
75 |
shutil.rmtree(tmpdir) |
87053f0b0fad
setup.py: use a simplified custom version of CCompiler.has_function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6245
diff
changeset
|
76 |
|
1283
f5faab34f32e
Support for the distutils extention 'py2exe' added.
Volker.Kleinfeld@gmx.de
parents:
575
diff
changeset
|
77 |
# py2exe needs to be installed to work |
f5faab34f32e
Support for the distutils extention 'py2exe' added.
Volker.Kleinfeld@gmx.de
parents:
575
diff
changeset
|
78 |
try: |
1294
372971e1c40d
Clean up whitespace damage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
1284
diff
changeset
|
79 |
import py2exe |
1283
f5faab34f32e
Support for the distutils extention 'py2exe' added.
Volker.Kleinfeld@gmx.de
parents:
575
diff
changeset
|
80 |
|
1422
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
81 |
# Help py2exe to find win32com.shell |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
82 |
try: |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
83 |
import modulefinder |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
84 |
import win32com |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
85 |
for p in win32com.__path__[1:]: # Take the path to win32comext |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
86 |
modulefinder.AddPackagePath("win32com", p) |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
87 |
pn = "win32com.shell" |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
88 |
__import__(pn) |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
89 |
m = sys.modules[pn] |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
90 |
for p in m.__path__[1:]: |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
91 |
modulefinder.AddPackagePath(pn, p) |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
92 |
except ImportError: |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
93 |
pass |
a7e8408ac79c
py2exe is not able to handle win32com.shell
Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
parents:
1421
diff
changeset
|
94 |
|
3893 | 95 |
extra['console'] = ['hg'] |
96 |
||
1284
59d07a6bd513
Fix Volker's modifications to setup.py for non-Windows systems.
Bryan O'Sullivan <bos@serpentine.com>
parents:
1283
diff
changeset
|
97 |
except ImportError: |
3890
2eec996f2fb9
Fix demandload bits of setup.py py2exe support
Matt Mackall <mpm@selenic.com>
parents:
3887
diff
changeset
|
98 |
pass |
1283
f5faab34f32e
Support for the distutils extention 'py2exe' added.
Volker.Kleinfeld@gmx.de
parents:
575
diff
changeset
|
99 |
|
8548
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
100 |
version = None |
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
101 |
|
8547
548fd7a05373
setup.py: subprocess instead of os.popen, sys.stderr.write instead of print
Christian Ebert <blacktrash@gmx.net>
parents:
8494
diff
changeset
|
102 |
if os.path.isdir('.hg'): |
8629
8e69a22f6792
setup: execute hg in C locale
Martin Geisler <mg@lazybytes.net>
parents:
8628
diff
changeset
|
103 |
# Execute hg out of this directory with a custom environment which |
8e69a22f6792
setup: execute hg in C locale
Martin Geisler <mg@lazybytes.net>
parents:
8628
diff
changeset
|
104 |
# includes the pure Python modules in mercurial/pure. We also take |
8e69a22f6792
setup: execute hg in C locale
Martin Geisler <mg@lazybytes.net>
parents:
8628
diff
changeset
|
105 |
# care to not use any hgrc files and do no localization. |
8e69a22f6792
setup: execute hg in C locale
Martin Geisler <mg@lazybytes.net>
parents:
8628
diff
changeset
|
106 |
pypath = ['mercurial', os.path.join('mercurial', 'pure')] |
8e69a22f6792
setup: execute hg in C locale
Martin Geisler <mg@lazybytes.net>
parents:
8628
diff
changeset
|
107 |
env = {'PYTHONPATH': os.pathsep.join(pypath), |
8e69a22f6792
setup: execute hg in C locale
Martin Geisler <mg@lazybytes.net>
parents:
8628
diff
changeset
|
108 |
'HGRCPATH': '', |
8e69a22f6792
setup: execute hg in C locale
Martin Geisler <mg@lazybytes.net>
parents:
8628
diff
changeset
|
109 |
'LANGUAGE': 'C'} |
8648
ca443bac7ed4
fixed 0xc0150004 error building Mercurial under Python 2.6 for Windows
Garth Roxburgh-Kidd <garth@deadlybloodyserious.com>
parents:
8629
diff
changeset
|
110 |
if 'SystemRoot' in os.environ: |
ca443bac7ed4
fixed 0xc0150004 error building Mercurial under Python 2.6 for Windows
Garth Roxburgh-Kidd <garth@deadlybloodyserious.com>
parents:
8629
diff
changeset
|
111 |
# Copy SystemRoot into the custom environment for Python 2.6 |
ca443bac7ed4
fixed 0xc0150004 error building Mercurial under Python 2.6 for Windows
Garth Roxburgh-Kidd <garth@deadlybloodyserious.com>
parents:
8629
diff
changeset
|
112 |
# under Windows. Otherwise, the subprocess will fail with |
ca443bac7ed4
fixed 0xc0150004 error building Mercurial under Python 2.6 for Windows
Garth Roxburgh-Kidd <garth@deadlybloodyserious.com>
parents:
8629
diff
changeset
|
113 |
# error 0xc0150004. See: http://bugs.python.org/issue3440 |
ca443bac7ed4
fixed 0xc0150004 error building Mercurial under Python 2.6 for Windows
Garth Roxburgh-Kidd <garth@deadlybloodyserious.com>
parents:
8629
diff
changeset
|
114 |
env['SystemRoot'] = os.environ['SystemRoot'] |
8547
548fd7a05373
setup.py: subprocess instead of os.popen, sys.stderr.write instead of print
Christian Ebert <blacktrash@gmx.net>
parents:
8494
diff
changeset
|
115 |
cmd = [sys.executable, 'hg', 'id', '-i', '-t'] |
7826
f0a7accf1d68
setup.py: fix version detection for tarball
Matt Mackall <mpm@selenic.com>
parents:
7801
diff
changeset
|
116 |
|
8629
8e69a22f6792
setup: execute hg in C locale
Martin Geisler <mg@lazybytes.net>
parents:
8628
diff
changeset
|
117 |
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, |
8e69a22f6792
setup: execute hg in C locale
Martin Geisler <mg@lazybytes.net>
parents:
8628
diff
changeset
|
118 |
stderr=subprocess.PIPE, env=env) |
8e69a22f6792
setup: execute hg in C locale
Martin Geisler <mg@lazybytes.net>
parents:
8628
diff
changeset
|
119 |
out, err = p.communicate() |
7826
f0a7accf1d68
setup.py: fix version detection for tarball
Matt Mackall <mpm@selenic.com>
parents:
7801
diff
changeset
|
120 |
|
8628
4dd06ab9217c
setup: handle trust warnings when determining version
Martin Geisler <mg@lazybytes.net>
parents:
8627
diff
changeset
|
121 |
# If root is executing setup.py, but the repository is owned by |
4dd06ab9217c
setup: handle trust warnings when determining version
Martin Geisler <mg@lazybytes.net>
parents:
8627
diff
changeset
|
122 |
# another user (as in "sudo python setup.py install") we will get |
4dd06ab9217c
setup: handle trust warnings when determining version
Martin Geisler <mg@lazybytes.net>
parents:
8627
diff
changeset
|
123 |
# trust warnings since the .hg/hgrc file is untrusted. That is |
4dd06ab9217c
setup: handle trust warnings when determining version
Martin Geisler <mg@lazybytes.net>
parents:
8627
diff
changeset
|
124 |
# fine, we don't want to load it anyway. |
4dd06ab9217c
setup: handle trust warnings when determining version
Martin Geisler <mg@lazybytes.net>
parents:
8627
diff
changeset
|
125 |
err = [e for e in err.splitlines() |
4dd06ab9217c
setup: handle trust warnings when determining version
Martin Geisler <mg@lazybytes.net>
parents:
8627
diff
changeset
|
126 |
if not e.startswith('Not trusting file')] |
8627
4c5b46f736f1
setup: renamed l, e vars to out, err
Martin Geisler <mg@lazybytes.net>
parents:
8550
diff
changeset
|
127 |
if err: |
8549
9f85da260508
setup: add missing newline in warning
Martin Geisler <mg@lazybytes.net>
parents:
8548
diff
changeset
|
128 |
sys.stderr.write('warning: could not establish Mercurial ' |
8628
4dd06ab9217c
setup: handle trust warnings when determining version
Martin Geisler <mg@lazybytes.net>
parents:
8627
diff
changeset
|
129 |
'version:\n%s\n' % '\n'.join(err)) |
8547
548fd7a05373
setup.py: subprocess instead of os.popen, sys.stderr.write instead of print
Christian Ebert <blacktrash@gmx.net>
parents:
8494
diff
changeset
|
130 |
else: |
8627
4c5b46f736f1
setup: renamed l, e vars to out, err
Martin Geisler <mg@lazybytes.net>
parents:
8550
diff
changeset
|
131 |
l = out.split() |
8547
548fd7a05373
setup.py: subprocess instead of os.popen, sys.stderr.write instead of print
Christian Ebert <blacktrash@gmx.net>
parents:
8494
diff
changeset
|
132 |
while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags |
548fd7a05373
setup.py: subprocess instead of os.popen, sys.stderr.write instead of print
Christian Ebert <blacktrash@gmx.net>
parents:
8494
diff
changeset
|
133 |
l.pop() |
548fd7a05373
setup.py: subprocess instead of os.popen, sys.stderr.write instead of print
Christian Ebert <blacktrash@gmx.net>
parents:
8494
diff
changeset
|
134 |
if l: |
548fd7a05373
setup.py: subprocess instead of os.popen, sys.stderr.write instead of print
Christian Ebert <blacktrash@gmx.net>
parents:
8494
diff
changeset
|
135 |
version = l[-1] # latest tag or revision number |
548fd7a05373
setup.py: subprocess instead of os.popen, sys.stderr.write instead of print
Christian Ebert <blacktrash@gmx.net>
parents:
8494
diff
changeset
|
136 |
if version.endswith('+'): |
548fd7a05373
setup.py: subprocess instead of os.popen, sys.stderr.write instead of print
Christian Ebert <blacktrash@gmx.net>
parents:
8494
diff
changeset
|
137 |
version += time.strftime('%Y%m%d') |
8548
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
138 |
elif os.path.exists('.hg_archival.txt'): |
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
139 |
hgarchival = open('.hg_archival.txt') |
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
140 |
for line in hgarchival: |
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
141 |
if line.startswith('node:'): |
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
142 |
version = line.split(':')[1].strip()[:12] |
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
143 |
break |
7632 | 144 |
|
8548
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
145 |
if version: |
9031
3b76321aa0de
compat: use open() instead of file() everywhere
Alejandro Santos <alejolp@alejolp.com>
parents:
8936
diff
changeset
|
146 |
f = open("mercurial/__version__.py", "w") |
8548
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
147 |
f.write('# this file is autogenerated by setup.py\n') |
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
148 |
f.write('version = "%s"\n' % version) |
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
149 |
f.close() |
3ccbe42ff72f
setup: read .hg_archival.txt for version info (issue1670)
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
8547
diff
changeset
|
150 |
|
8493
4c030ada58d2
Fix how setup.py identifies the Mercurial version.
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
7826
diff
changeset
|
151 |
|
4c030ada58d2
Fix how setup.py identifies the Mercurial version.
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
7826
diff
changeset
|
152 |
try: |
4c030ada58d2
Fix how setup.py identifies the Mercurial version.
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
7826
diff
changeset
|
153 |
from mercurial import __version__ |
4c030ada58d2
Fix how setup.py identifies the Mercurial version.
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
7826
diff
changeset
|
154 |
version = __version__.version |
4c030ada58d2
Fix how setup.py identifies the Mercurial version.
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
7826
diff
changeset
|
155 |
except ImportError: |
4c030ada58d2
Fix how setup.py identifies the Mercurial version.
Jeremy Whitlock <jcscoobyrs@gmail.com>
parents:
7826
diff
changeset
|
156 |
version = 'unknown' |
7632 | 157 |
|
157
2653740d8118
Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents:
155
diff
changeset
|
158 |
class install_package_data(install_data): |
2653740d8118
Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents:
155
diff
changeset
|
159 |
def finalize_options(self): |
2653740d8118
Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents:
155
diff
changeset
|
160 |
self.set_undefined_options('install', |
2653740d8118
Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents:
155
diff
changeset
|
161 |
('install_lib', 'install_dir')) |
2653740d8118
Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents:
155
diff
changeset
|
162 |
install_data.finalize_options(self) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
163 |
|
7649
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
164 |
class build_mo(build): |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
165 |
|
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
166 |
description = "build translations (.mo files)" |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
167 |
|
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
168 |
def run(self): |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
169 |
if not find_executable('msgfmt'): |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
170 |
self.warn("could not find msgfmt executable, no translations " |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
171 |
"will be built") |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
172 |
return |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
173 |
|
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
174 |
podir = 'i18n' |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
175 |
if not os.path.isdir(podir): |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
176 |
self.warn("could not find %s/ directory" % podir) |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
177 |
return |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
178 |
|
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
179 |
join = os.path.join |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
180 |
for po in os.listdir(podir): |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
181 |
if not po.endswith('.po'): |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
182 |
continue |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
183 |
pofile = join(podir, po) |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
184 |
modir = join('locale', po[:-3], 'LC_MESSAGES') |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
185 |
mofile = join(modir, 'hg.mo') |
7720
b6c2cb40e664
setup: do not use -c with msgfmt on Solaris (issue1489)
Martin Geisler <mg@daimi.au.dk>
parents:
7712
diff
changeset
|
186 |
cmd = ['msgfmt', '-v', '-o', mofile, pofile] |
b6c2cb40e664
setup: do not use -c with msgfmt on Solaris (issue1489)
Martin Geisler <mg@daimi.au.dk>
parents:
7712
diff
changeset
|
187 |
if sys.platform != 'sunos5': |
b6c2cb40e664
setup: do not use -c with msgfmt on Solaris (issue1489)
Martin Geisler <mg@daimi.au.dk>
parents:
7712
diff
changeset
|
188 |
# msgfmt on Solaris does not know about -c |
b6c2cb40e664
setup: do not use -c with msgfmt on Solaris (issue1489)
Martin Geisler <mg@daimi.au.dk>
parents:
7712
diff
changeset
|
189 |
cmd.append('-c') |
7649
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
190 |
self.mkpath(modir) |
7720
b6c2cb40e664
setup: do not use -c with msgfmt on Solaris (issue1489)
Martin Geisler <mg@daimi.au.dk>
parents:
7712
diff
changeset
|
191 |
self.make_file([pofile], mofile, spawn, (cmd,)) |
7649
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
192 |
self.distribution.data_files.append((join('mercurial', modir), |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
193 |
[mofile])) |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
194 |
|
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
195 |
build.sub_commands.append(('build_mo', None)) |
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
196 |
|
7722
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
197 |
Distribution.pure = 0 |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
198 |
Distribution.global_options.append(('pure', None, "use pure (slow) Python " |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
199 |
"code instead of C extensions")) |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
200 |
|
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
201 |
class hg_build_py(build_py): |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
202 |
|
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
203 |
def finalize_options(self): |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
204 |
build_py.finalize_options(self) |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
205 |
|
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
206 |
if self.distribution.pure: |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
207 |
if self.py_modules is None: |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
208 |
self.py_modules = [] |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
209 |
for ext in self.distribution.ext_modules: |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
210 |
if ext.name.startswith("mercurial."): |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
211 |
self.py_modules.append("mercurial.pure.%s" % ext.name[10:]) |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
212 |
self.distribution.ext_modules = [] |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
213 |
|
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
214 |
def find_modules(self): |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
215 |
modules = build_py.find_modules(self) |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
216 |
for module in modules: |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
217 |
if module[0] == "mercurial.pure": |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
218 |
if module[1] != "__init__": |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
219 |
yield ("mercurial", module[1], module[2]) |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
220 |
else: |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
221 |
yield module |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
222 |
|
7649
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
223 |
cmdclass = {'install_data': install_package_data, |
7722
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
224 |
'build_mo': build_mo, |
103127a8cbdb
add --pure flag to setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7721
diff
changeset
|
225 |
'build_py': hg_build_py} |
3238
3dba9ec89164
Applied coding style to setup.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2402
diff
changeset
|
226 |
|
5396
5105b119edd2
Add osutil module, containing a listdir function.
Bryan O'Sullivan <bos@serpentine.com>
parents:
5197
diff
changeset
|
227 |
ext_modules=[ |
6389
0231f763ebc8
manifest: improve parsing performance by 8x via a new C extension
Bryan O'Sullivan <bos@serpentine.com>
parents:
6373
diff
changeset
|
228 |
Extension('mercurial.base85', ['mercurial/base85.c']), |
5396
5105b119edd2
Add osutil module, containing a listdir function.
Bryan O'Sullivan <bos@serpentine.com>
parents:
5197
diff
changeset
|
229 |
Extension('mercurial.bdiff', ['mercurial/bdiff.c']), |
6389
0231f763ebc8
manifest: improve parsing performance by 8x via a new C extension
Bryan O'Sullivan <bos@serpentine.com>
parents:
6373
diff
changeset
|
230 |
Extension('mercurial.diffhelpers', ['mercurial/diffhelpers.c']), |
0231f763ebc8
manifest: improve parsing performance by 8x via a new C extension
Bryan O'Sullivan <bos@serpentine.com>
parents:
6373
diff
changeset
|
231 |
Extension('mercurial.mpatch', ['mercurial/mpatch.c']), |
0231f763ebc8
manifest: improve parsing performance by 8x via a new C extension
Bryan O'Sullivan <bos@serpentine.com>
parents:
6373
diff
changeset
|
232 |
Extension('mercurial.parsers', ['mercurial/parsers.c']), |
8283
d6134b800797
setup: cleanup old left-over code
Martin Geisler <mg@lazybytes.net>
parents:
7958
diff
changeset
|
233 |
Extension('mercurial.osutil', ['mercurial/osutil.c']), |
5396
5105b119edd2
Add osutil module, containing a listdir function.
Bryan O'Sullivan <bos@serpentine.com>
parents:
5197
diff
changeset
|
234 |
] |
5105b119edd2
Add osutil module, containing a listdir function.
Bryan O'Sullivan <bos@serpentine.com>
parents:
5197
diff
changeset
|
235 |
|
6948
359e93ceee3a
fix double indentation and trailing whitespace
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6938
diff
changeset
|
236 |
packages = ['mercurial', 'mercurial.hgweb', 'hgext', 'hgext.convert', |
7081
2fdbf2ccd03a
Add hgext.zeroconf to the package list so it gets installed by setup.py.
Augie Fackler <durin42@gmail.com>
parents:
7056
diff
changeset
|
237 |
'hgext.highlight', 'hgext.zeroconf', ] |
6239
39cfcef4f463
Add inotify extension
Bryan O'Sullivan <bos@serpentine.com>
parents:
6009
diff
changeset
|
238 |
|
8283
d6134b800797
setup: cleanup old left-over code
Martin Geisler <mg@lazybytes.net>
parents:
7958
diff
changeset
|
239 |
if sys.platform == 'linux2' and os.uname()[2] > '2.6': |
d6134b800797
setup: cleanup old left-over code
Martin Geisler <mg@lazybytes.net>
parents:
7958
diff
changeset
|
240 |
# The inotify extension is only usable with Linux 2.6 kernels. |
d6134b800797
setup: cleanup old left-over code
Martin Geisler <mg@lazybytes.net>
parents:
7958
diff
changeset
|
241 |
# You also need a reasonably recent C library. |
d6134b800797
setup: cleanup old left-over code
Martin Geisler <mg@lazybytes.net>
parents:
7958
diff
changeset
|
242 |
cc = new_compiler() |
d6134b800797
setup: cleanup old left-over code
Martin Geisler <mg@lazybytes.net>
parents:
7958
diff
changeset
|
243 |
if has_function(cc, 'inotify_add_watch'): |
d6134b800797
setup: cleanup old left-over code
Martin Geisler <mg@lazybytes.net>
parents:
7958
diff
changeset
|
244 |
ext_modules.append(Extension('hgext.inotify.linux._inotify', |
d6134b800797
setup: cleanup old left-over code
Martin Geisler <mg@lazybytes.net>
parents:
7958
diff
changeset
|
245 |
['hgext/inotify/linux/_inotify.c'])) |
d6134b800797
setup: cleanup old left-over code
Martin Geisler <mg@lazybytes.net>
parents:
7958
diff
changeset
|
246 |
packages.extend(['hgext.inotify', 'hgext.inotify.linux']) |
5396
5105b119edd2
Add osutil module, containing a listdir function.
Bryan O'Sullivan <bos@serpentine.com>
parents:
5197
diff
changeset
|
247 |
|
7648
02e358a3a8a7
i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents:
7647
diff
changeset
|
248 |
datafiles = [] |
02e358a3a8a7
i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents:
7647
diff
changeset
|
249 |
for root in ('templates', 'i18n'): |
02e358a3a8a7
i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents:
7647
diff
changeset
|
250 |
for dir, dirs, files in os.walk(root): |
9129
395b0e132836
Don't copy hidden files/directories during `setup.py install`
James Abbatiello <abbeyj at gmail.com>
parents:
9124
diff
changeset
|
251 |
dirs[:] = [x for x in dirs if not x.startswith('.')] |
395b0e132836
Don't copy hidden files/directories during `setup.py install`
James Abbatiello <abbeyj at gmail.com>
parents:
9124
diff
changeset
|
252 |
files = [x for x in files if not x.startswith('.')] |
7648
02e358a3a8a7
i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents:
7647
diff
changeset
|
253 |
datafiles.append((os.path.join('mercurial', dir), |
02e358a3a8a7
i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents:
7647
diff
changeset
|
254 |
[os.path.join(dir, file_) for file_ in files])) |
02e358a3a8a7
i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents:
7647
diff
changeset
|
255 |
|
1977
7eb694a1c1af
Don't forget version at the end of setup.py, write it only if changed.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1873
diff
changeset
|
256 |
setup(name='mercurial', |
7632 | 257 |
version=version, |
3238
3dba9ec89164
Applied coding style to setup.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2402
diff
changeset
|
258 |
author='Matt Mackall', |
3dba9ec89164
Applied coding style to setup.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2402
diff
changeset
|
259 |
author_email='mpm@selenic.com', |
8936
1de6e7e1bb9f
change wiki/bts URLs to point to new hostname
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8648
diff
changeset
|
260 |
url='http://mercurial.selenic.com/', |
3238
3dba9ec89164
Applied coding style to setup.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2402
diff
changeset
|
261 |
description='Scalable distributed SCM', |
3dba9ec89164
Applied coding style to setup.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2402
diff
changeset
|
262 |
license='GNU GPL', |
6513
66e87c11447d
Add a batch file driver for Windows
Paul Moore <p.f.moore@gmail.com>
parents:
6389
diff
changeset
|
263 |
scripts=scripts, |
6239
39cfcef4f463
Add inotify extension
Bryan O'Sullivan <bos@serpentine.com>
parents:
6009
diff
changeset
|
264 |
packages=packages, |
5396
5105b119edd2
Add osutil module, containing a listdir function.
Bryan O'Sullivan <bos@serpentine.com>
parents:
5197
diff
changeset
|
265 |
ext_modules=ext_modules, |
7648
02e358a3a8a7
i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents:
7647
diff
changeset
|
266 |
data_files=datafiles, |
3238
3dba9ec89164
Applied coding style to setup.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2402
diff
changeset
|
267 |
cmdclass=cmdclass, |
6789
c1c202e2d45d
Force email package to be loaded in py2exe
Paul Moore <p.f.moore@gmail.com>
parents:
6373
diff
changeset
|
268 |
options=dict(py2exe=dict(packages=['hgext', 'email']), |
4628
02956be66a58
Fix for including hgext in Windows compiled version.
Lee Cantey <lcantey@gmail.com>
parents:
4519
diff
changeset
|
269 |
bdist_mpkg=dict(zipdist=True, |
3238
3dba9ec89164
Applied coding style to setup.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2402
diff
changeset
|
270 |
license='COPYING', |
3dba9ec89164
Applied coding style to setup.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2402
diff
changeset
|
271 |
readme='contrib/macosx/Readme.html', |
3dba9ec89164
Applied coding style to setup.py
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2402
diff
changeset
|
272 |
welcome='contrib/macosx/Welcome.html')), |
3893 | 273 |
**extra) |