Commit Graph

175 Commits

Author SHA1 Message Date
Kent Frazier
ddcb0f363a setup.py: fix C extension compilation issue with OS X 10.9 and Xcode 5.1 2014-04-15 16:27:12 -04:00
Augie Fackler
2029c18034 setup.py: fix 2.4 breakage in 77ab0abb 2014-03-12 18:28:57 -04:00
Augie Fackler
6e7749ad7e setup: handle more invalid python3 syntax
This should keep the file portable to both python2 and python3.
2013-09-19 15:38:42 -04:00
Augie Fackler
428555deb5 setup.py: move from dict() construction to {} literals
The latter are both faster and more consistent across Python 2 and 3.
2014-03-12 13:29:29 -04:00
Matt Mackall
eb09e501b5 tests: fix unused imports from inotify removal caught by pyflakes 2014-03-04 09:56:59 -06:00
Matt Mackall
66c8bd54e8 extensions: remove the inotify extension (BC)
This extension has always had correctness issues and has been
unmaintained for years. It is now removed in favor of the third-party
hgwatchman which is maintained and appears to be correct.

Users with inotify enabled in their config files will fall back to
standard status performance.
2014-03-01 16:20:15 -06:00
Wei, Elson
2a24db69d7 setup: check if mercurial/util.h has been modified
Before, if mercurial/util.h was modified but *.c wasn't, no extension
was rebuilt.
2013-09-13 10:00:57 +08:00
Mads Kiilerich
af3a71e28b setup: make error message for missing Python headers more helpful 2013-04-12 16:55:34 -04:00
Bryan O'Sullivan
8f78d582d5 scmutil: rewrite dirs in C, use if available
This is over twice as fast as the Python dirs code. Upcoming changes
will nearly double its speed again.

perfdirs results for a working dir with 170,000 files:
  Python     638 msec
  C          244
2013-04-10 15:08:27 -07:00
Isaac Jurado
5c5aad9d45 setup.py: properly discard trust warning.
This modification was missing from the 4a4aff3d70bd changeset.
2013-04-02 16:03:10 +02:00
Benoit Boissinot
0d369ef57d setup.py: ignore warnings from obsolete
Fix version detection with recent hg versions.
2013-03-04 10:05:52 +01:00
Benoit Boissinot
ba8b143893 setup.py: add metadata to register package to PyPI
This allows updating PyPI with just 'setup.py register' (assuming the user is
an owner or maintainer of the PyPI package).
2013-03-04 10:13:28 +01:00
Bryan O'Sullivan
af56dbda30 setup: print subprocess stderr if there is any
I just spent 1.5 days trying to debug a failing buildbot because
setup.py was silently dropping the errors that were being printed
by in-place hg.
2012-11-13 09:55:26 -08:00
Adrian Buehlmann
d768b47592 exewrapper: adapt for legacy HackableMercurial
We give up using CPython's PythonXX.lib import libraries (and Python.h), and
now "manually" call the LoadLibrary() / GetProcAddress() Windows API's instead.

If there is a "hg-python" subdirectory (the canonical directory name for
HackableMercurial's private Python copy) next to the hg.exe, we load the
pythonXX.dll from there (feeding an absolute path to LoadLibrary) and we set
Py_SetPythonHome() to that directory, so that the Python libraries are used
from there as well.

If there is no "hg-python" subdir found next to the hg.exe, we do not feed an
absolute path to LoadLibrary. This continues to allow to find a globally
installed Python DLL, as before this change - that is, without having to edit,
delete, rename, or configure anything.

Note that the hg.exe built is still bound to a *specific* major version of the
pythonXX.dll (e.g. python27.dll). What version it is, is inferred from the
version of the python interpreter that was used when calling setup.py. For
example

  C:\python27_x86\python.exe setup.py build_hgexe -i --compiler=mingw32

builds a hg.exe (using the mingw32 tool chain) bound to (x86) Python 2.7. And

  C:\python27_x86\python.exe setup.py build_hgexe -i

builds the same using the Microsoft C compiler/linker. (Note that the Microsoft
toolchain combined with x64 CPython can be used to build an x64 hg.exe.)

setup.py is changed to write the name of the pythonlib into the generated header
file "mercurial/hgpythonlib.h", which is #included by exewrapper.c. For a Python
2.7 build, it for example contains:

  #define HGPYTHONLIB "python27"

exewrapper.c then uses HGPYTHONLIB for the name of the Python dll to load.

We don't want to track mercurial/hgpythonlib.h, so we add it to .hgignore.
2012-08-07 11:04:41 +02:00
Bryan O'Sullivan
6c7ac8b7de setup: calculate version more correctly
The old calculation code failed to properly identify revs that
weren't tagged, leaving us with a version of "unknown" most of the
time during development.
2012-10-05 13:44:52 -05:00
Adrian Buehlmann
fd6785ba1c pathencode: new C module with fast encodedir() function
Not yet used (will be enabled in a later patch).

This patch is a stripped down version of patches originally created by
Bryan O'Sullivan <bryano@fb.com>
2012-09-18 11:43:30 +02:00
Adrian Buehlmann
b303a00fae setup: fix build_hgexe for mingw32 compiler
Fixes

  python setup.py build_hgexe -i --compiler=mingw32
2012-07-25 16:50:22 +02:00
Bryan O'Sullivan
ea2526a3d4 setup: disable -mno-cygwin if building under mingw32
This gcc option has been deprecated since at least 2009 (gcc 4.4),
and it causes compilations to fail entirely with gcc 4.6.x.

Upstream distutils bug: http://bugs.python.org/issue12641
2012-07-06 20:19:55 -07:00
Adrian Buehlmann
7e44d18d42 setup: compile hg.exe
This implements a new command

  $ python setup.py build_hgexe -i

which places the hg.exe in the root of the source tree.
2012-06-29 13:10:48 +02:00
Augie Fackler
c0cf243849 httpclient: omit tests for the client since we don't run them anyway 2012-05-19 09:34:25 -05:00
Brodie Rao
a706d64a2c cleanup: replace naked excepts with except Exception: ... 2012-05-12 16:02:46 +02:00
Brodie Rao
c577fac135 cleanup: replace naked excepts with more specific ones 2012-05-12 16:02:45 +02:00
Brodie Rao
d6a6abf2b0 cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
Steven Stallion
d79ff306e5 plan9: initial support for plan 9 from bell labs
This patch contains support for Plan 9 from Bell Labs. A README is
provided in contrib/plan9 which describes the port in greater detail.
A new extension is also provided named factotum which permits the
factotum(4) authentication agent to provide credentials for HTTP
repositories. This extension is also applicable to other POSIX
platforms which make use of Plan 9 from User Space (aka plan9ports).
2012-04-08 12:43:41 -07:00
Brendan Cully
19039ca025 setup.py: don't call splitlines twice on the output of xcodebuild (issue3277) 2012-03-02 10:42:12 -08:00
Greg Ward
86216402d9 setup: handle output from Apple's Xcode 4.3 better (issue3277)
Apparently, it prints nothing at all if the user installed only the
command-line tools. In that case, don't try to parse the empty output
-- just assume they have Xcode >= 4.
2012-02-27 08:54:26 -05:00
Pascal Quantin
fe27d67b3c setup: fix py2exe generation broken by c7ccdf21c98c (issue3116)
Py2exe is patching default distutils Distribution class. This patch ensures
that the right one is taken when calling hgdist class.
2011-11-20 19:14:36 +01:00
Matt Mackall
8ff3689535 setup: backout 4c2574ae2b6b
Change wasn't compatible with Python 2.x
2011-11-17 23:01:58 -06:00
Simon Heimberg
77b258d449 setup: raise when executing with python3 without c2to3 argument 2011-11-12 02:08:01 +01:00
Simon Heimberg
302466e126 setup: support executing with python3 including 2to3
Merge the code from contrib/setup3.py in setup.
The argument for executing is marked as experimental.

Reason: The file in contrib was outdated (packages, cmdclass, ...)
2011-08-21 15:23:43 +02:00
Simon Heimberg
316a653bf9 setup: hgbuildmo inherits from Command
hgbuildmo does not need anything provided by the build class.
2011-11-01 20:13:53 +01:00
Simon Heimberg
2378dbf777 setup: make script executable with python3
Replace the incompatible print statement. Writing a warning to stderr is a good
idea anyway.
2011-11-12 02:07:55 +01:00
Simon Heimberg
203f43b760 setup: subclass build command 2011-11-01 20:13:53 +01:00
Simon Heimberg
44d04f155e setup: has_ext_modules always returns false when pure is specified
When pure is specified ext_modules is emptied in hgbuildpy.finalize_options.
Before this happens has_ext_modules returned True.
2011-11-01 20:13:52 +01:00
Simon Heimberg
50a770852b setup: subclass distribution instead of overwriting original 2011-07-23 05:57:39 +02:00
Yuya Nishihara
0a388fca31 setup: set whole env for running hg even if .hg doesn't exist (issue3073)
The issue was partially fixed by 4576ace762a0, but there were missing
variables to run build_hgextindex.
2011-10-31 00:42:32 +09:00
Matt Mackall
36e0650c7d setup: set env global earlier (3073) 2011-10-26 12:56:27 -05:00
Na'Tosha Bard
b3b49a3b91 setup: add largefiles to list of packages 2011-10-10 17:33:17 +02:00
Nikolaj Sjujskij
7548a4a762 building: build inotify for sys.platform='linux*'
If Python interpreter was built under Linux 3.x kernel, it reports
sys.platform to be 'linux3' (it is fixed for Python 3, but not for 2.x).
This cancels building inotify extension, which was built only for 'linux2'
platform. Improved test checks if sys.platform begins with 'linux', and together
with test for kernel version to be greater than 2.6 it seems to cover all known
cases.
2011-09-20 15:21:27 +03:00
Augie Fackler
4fdf4ee021 setup.py: use getattr instead of hasdattr 2011-07-25 16:08:57 -05:00
Yuya Nishihara
64bae20381 setup: add command to generate index of extensions
It generates prebuilt index of all extensions, which will be used by
frozen exe when running 'hg help extensions'.

Now py2exe invokes this command automatically.
2011-06-04 20:11:10 +09:00
Brendan Cully
6879cbeb5e Hardcoding ARCHFLAGS breaks the build against fink's python
Fink's python is either i386 or amd64, but not universal. Setting ARCHFLAGS to the
empty string produces a successful build against both OS X python and fink python.
The modules will no longer be universal -- if that is an issue, we can change the
test to extract ARCHFLAGS from distutils.sysconfig and remove ppc if necessary.
2011-05-14 22:07:58 -07:00
Zachary Gramana
eaa0630670 setup.py: workaround for missing bz2 module in IronPython
IronPython does not provide the bz2 module on its own.  This patch skips
importing it to allow setup to continue.

(minor tweaks by mpm)
2011-05-09 15:16:56 -04:00
Augie Fackler
1753857f5b Import new http library as mercurial.httpclient.
This is revision a4229f13c374 of
http://py-nonblocking-http.googlecode.com/ with a no-check-code
comment added to the end of each file using `for fi in $(hg manifest |
grep mercurial/httpclient/) ; echo '# no-check-code' >> $fi`.
2011-05-06 09:57:55 -05:00
Dan Villiom Podlaski Christiansen
9dfabab3ba util: add Mac-specific check whether we're in a GUI session (issue2553)
The previous test assumed that 'os.name' was "mac" on Mac OS X. This
is not the case; 'mac' was classic Mac OS, whereas Mac OS X has 'os.name'
be 'posix'.

Please note that this change will break Mercurial on hypothetical
non-Mac OS X deployments of Darwin.

Credit to Brodie Rao for thinking of CGSessionCopyCurrentDictionary()
and Kevin Bullock for testing.
2011-03-23 09:43:34 +01:00
Martin Geisler
47a3f1a049 merge with stable 2011-03-14 14:05:19 +01:00
Jon M. Dugan
83ac2d7b6b setup: fix mac build broken by 1564bc7b747b
Sometimes xcodebuild prints warnings to stderr, but runcmd() assumes anything
printed to stderr implies failure.  Since runcmd() was originally only
intended to run hg, this was fine until it was pressed into service for
running xcodebuild.  Thus: split runcmd() into two parts: runcmd(), which does
the minimal amount of work to run a subprocess, and runhg(), which calls
runcmd().
2011-03-13 17:39:33 -05:00
Steve Borho
d00322059c setup: remove unnecessary code for win32com (pywin32) 2011-03-13 08:50:06 -05:00
Dirkjan Ochtman
613f24735d setup.py: use StrictVersion instead of manual comparison 2011-03-12 13:02:03 +01:00
Alexander Solovyov
b3d02e2113 fix compiling of extensions for OS X and XCode 4.0 2011-03-12 12:42:20 +01:00