/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-03 03:10:29 UTC
  • mfrom: (7312 work)
  • mto: This revision was merged to the branch mainline in revision 7318.
  • Revision ID: jelmer@jelmer.uk-20190603031029-b34je03bjulxxdwj
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
    sys.stderr.write("[ERROR] Not a supported Python version. Need 2.7+\n")
17
17
    sys.exit(1)
18
18
 
 
19
 
 
20
try:
 
21
    import setuptools
 
22
except ImportError:
 
23
    sys.stderr.write("[ERROR] Please install setuptools\n")
 
24
    sys.exit(1)
 
25
 
 
26
 
19
27
# NOTE: The directory containing setup.py, whether run by 'python setup.py' or
20
28
# './setup.py' or the equivalent with another path, should always be at the
21
29
# start of the path, so this should find the right one...
57
65
    'install_requires': [
58
66
        'configobj',
59
67
        'six>=1.9.0',
 
68
        'patiencediff',
60
69
        # Technically, Breezy works without these two dependencies too. But there's
61
70
        # no way to enable them by default and let users opt out.
62
71
        'fastimport>=0.9.8',
118
127
BREEZY['packages'] = get_breezy_packages()
119
128
 
120
129
 
121
 
from distutils import log
122
 
from distutils.core import setup
 
130
from setuptools import setup
123
131
from distutils.version import LooseVersion
124
132
from distutils.command.install_scripts import install_scripts
125
133
from distutils.command.install_data import install_data
142
150
                script_path = self._quoted_path(os.path.join(scripts_dir,
143
151
                                                             "brz"))
144
152
                python_exe = self._quoted_path(sys.executable)
145
 
                args = self._win_batch_args()
146
 
                batch_str = "@%s %s %s" % (python_exe, script_path, args)
 
153
                batch_str = "@%s %s %%*" % (python_exe, script_path)
147
154
                batch_path = os.path.join(self.install_dir, "brz.bat")
148
155
                with open(batch_path, "w") as f:
149
156
                    f.write(batch_str)
157
164
            return '"' + path + '"'
158
165
        else:
159
166
            return path
160
 
 
161
 
    def _win_batch_args(self):
162
 
        from breezy.win32utils import winver
163
 
        if winver == 'Windows NT':
164
 
            return '%*'
165
 
        else:
166
 
            return '%1 %2 %3 %4 %5 %6 %7 %8 %9'
167
167
#/class my_install_scripts
168
168
 
169
169
 
211
211
    print("")
212
212
    from distutils.command.build_ext import build_ext
213
213
else:
214
 
    have_cython = True
 
214
    minimum_cython_version = '0.29'
215
215
    cython_version_info = LooseVersion(cython_version)
 
216
    if cython_version_info < LooseVersion(minimum_cython_version):
 
217
        print("Version of Cython is too old. "
 
218
              "Current is %s, need at least %s."
 
219
              % (cython_version, minimum_cython_version))
 
220
        print("If the .c files are available, they will be built,"
 
221
              " but modifying the .pyx files will not rebuild them.")
 
222
        have_cython = False
 
223
    else:
 
224
        have_cython = True
216
225
 
217
226
 
218
227
class build_ext_if_possible(build_ext):
318
327
    add_cython_extension('breezy.bzr._dirstate_helpers_pyx')
319
328
    add_cython_extension('breezy._readdir_pyx')
320
329
add_cython_extension('breezy.bzr._chk_map_pyx')
321
 
ext_modules.append(Extension('breezy._patiencediff_c',
322
 
                             ['breezy/_patiencediff_c.c']))
323
330
add_cython_extension('breezy.bzr._btree_serializer_pyx')
324
331
 
325
332