/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: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/env python
 
1
#! /usr/bin/env python3
2
2
 
3
3
"""Installation script for brz.
4
4
Run it with
12
12
import copy
13
13
import glob
14
14
 
15
 
if sys.version_info < (2, 7):
16
 
    sys.stderr.write("[ERROR] Not a supported Python version. Need 2.7+\n")
17
 
    sys.exit(1)
 
15
if sys.version_info < (3, 5):
 
16
    sys.stderr.write("[ERROR] Not a supported Python version. Need 3.5+\n")
 
17
    sys.exit(1)
 
18
 
 
19
 
 
20
try:
 
21
    import setuptools
 
22
except ImportError as e:
 
23
    sys.stderr.write("[ERROR] Please install setuptools (%s)\n" % e)
 
24
    sys.exit(1)
 
25
 
18
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
56
64
        ],
57
65
    'install_requires': [
58
66
        'configobj',
59
 
        'six>=1.9.0',
 
67
        'patiencediff',
60
68
        # Technically, Breezy works without these two dependencies too. But there's
61
69
        # no way to enable them by default and let users opt out.
62
 
        'fastimport>=0.9.8',
63
 
        'dulwich>=0.19.1',
 
70
        'dulwich>=0.19.12;python_version>="3.5"',
 
71
        'dulwich<0.20,>=0.19.12;python_version<"3.0"',
64
72
        ],
65
73
    'extras_require': {
66
74
        'fastimport': [],
67
75
        'git': [],
 
76
        'launchpad': ['launchpadlib>=1.6.3'],
 
77
        'workspace': ['pyinotify'],
68
78
        },
69
79
    'tests_require': [
70
80
        'testtools',
 
81
        'testtools<=2.4.0;python_version<"3.0"',
 
82
        'python-subunit',
71
83
    ],
72
84
}
73
85
 
117
129
BREEZY['packages'] = get_breezy_packages()
118
130
 
119
131
 
120
 
from distutils import log
121
 
from distutils.core import setup
 
132
from setuptools import setup
122
133
from distutils.version import LooseVersion
123
134
from distutils.command.install_scripts import install_scripts
124
135
from distutils.command.install_data import install_data
141
152
                script_path = self._quoted_path(os.path.join(scripts_dir,
142
153
                                                             "brz"))
143
154
                python_exe = self._quoted_path(sys.executable)
144
 
                args = self._win_batch_args()
145
 
                batch_str = "@%s %s %s" % (python_exe, script_path, args)
 
155
                batch_str = "@%s %s %%*" % (python_exe, script_path)
146
156
                batch_path = os.path.join(self.install_dir, "brz.bat")
147
157
                with open(batch_path, "w") as f:
148
158
                    f.write(batch_str)
156
166
            return '"' + path + '"'
157
167
        else:
158
168
            return path
159
 
 
160
 
    def _win_batch_args(self):
161
 
        from breezy.win32utils import winver
162
 
        if winver == 'Windows NT':
163
 
            return '%*'
164
 
        else:
165
 
            return '%1 %2 %3 %4 %5 %6 %7 %8 %9'
166
169
#/class my_install_scripts
167
170
 
168
171
 
210
213
    print("")
211
214
    from distutils.command.build_ext import build_ext
212
215
else:
213
 
    have_cython = True
 
216
    minimum_cython_version = '0.29'
214
217
    cython_version_info = LooseVersion(cython_version)
 
218
    if cython_version_info < LooseVersion(minimum_cython_version):
 
219
        print("Version of Cython is too old. "
 
220
              "Current is %s, need at least %s."
 
221
              % (cython_version, minimum_cython_version))
 
222
        print("If the .c files are available, they will be built,"
 
223
              " but modifying the .pyx files will not rebuild them.")
 
224
        have_cython = False
 
225
    else:
 
226
        have_cython = True
215
227
 
216
228
 
217
229
class build_ext_if_possible(build_ext):
317
329
    add_cython_extension('breezy.bzr._dirstate_helpers_pyx')
318
330
    add_cython_extension('breezy._readdir_pyx')
319
331
add_cython_extension('breezy.bzr._chk_map_pyx')
320
 
ext_modules.append(Extension('breezy._patiencediff_c',
321
 
                             ['breezy/_patiencediff_c.c']))
322
332
add_cython_extension('breezy.bzr._btree_serializer_pyx')
323
333
 
324
334
 
587
597
        includes.append(module)
588
598
 
589
599
    additional_packages = set()
590
 
    if sys.version.startswith('2.7'):
591
 
        additional_packages.add('xml.etree')
592
 
    else:
593
 
        import warnings
594
 
        warnings.warn('Unknown Python version.\n'
595
 
                      'Please check setup.py script for compatibility.')
596
600
 
597
601
    # Although we currently can't enforce it, we consider it an error for
598
602
    # py2exe to report any files are "missing".  Such modules we know aren't