Mercurial > p > roundup > code
comparison setup.py @ 6638:e1588ae185dc issue2550923_computed_property
merge from default branch. Fix travis.ci so CI builds don't error out
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 21 Apr 2022 16:54:17 -0400 |
| parents | 4b627102b344 |
| children | b3ba03d2b214 |
comparison
equal
deleted
inserted
replaced
| 6508:85db90cc1705 | 6638:e1588ae185dc |
|---|---|
| 85 # strip '--prefix=' | 85 # strip '--prefix=' |
| 86 prefix=a[9:] | 86 prefix=a[9:] |
| 87 if prefix: | 87 if prefix: |
| 88 return prefix | 88 return prefix |
| 89 else: | 89 else: |
| 90 # get the platform lib path. | 90 # get the platform lib path. Must start with / else infinite loop. |
| 91 plp = get_path('platlib') | 91 plp = get_path('platlib') |
| 92 # nuke suffix that matches lib/* and return prefix | 92 # nuke suffix that matches lib/* and return prefix |
| 93 head, tail = os.path.split(plp) | 93 head, tail = os.path.split(plp) |
| 94 while tail != 'lib' and head != '': | 94 while tail not in ['lib', 'lib64' ] and head != '/': |
| 95 head, tail = os.path.split(head) | 95 head, tail = os.path.split(head) |
| 96 if not head: | 96 if head == '/': |
| 97 head = sys.prefix | 97 head = sys.prefix |
| 98 return head | 98 return head |
| 99 | 99 |
| 100 | 100 |
| 101 def main(): | 101 def main(): |
| 140 data_files.append(include('share/doc/roundup/html/_images', '*')) | 140 data_files.append(include('share/doc/roundup/html/_images', '*')) |
| 141 data_files.append(include('share/doc/roundup/html/_sources', '*')) | 141 data_files.append(include('share/doc/roundup/html/_sources', '*')) |
| 142 data_files.append(include('share/doc/roundup/html/_static', '*')) | 142 data_files.append(include('share/doc/roundup/html/_static', '*')) |
| 143 | 143 |
| 144 data_files = make_data_files_absolute(data_files, get_prefix()) | 144 data_files = make_data_files_absolute(data_files, get_prefix()) |
| 145 | |
| 146 # when running under python2, even if called from setup, it tries | |
| 147 # and fails to perform an egg easy install even though it shouldn't: | |
| 148 # https://issues.roundup-tracker.org/issue2551185 | |
| 149 # Add this argument if we are an install to prevent this. | |
| 150 # This works right under python3. | |
| 151 # FIXME there has to be a better way than this | |
| 152 # https://issues.roundup-tracker.org/issue2551185 | |
| 153 | |
| 154 if sys.version_info[0] < 3: | |
| 155 for arg in sys.argv: | |
| 156 if arg == 'install': | |
| 157 sys.argv.append('--old-and-unmanageable') | |
| 145 | 158 |
| 146 # perform the setup action | 159 # perform the setup action |
| 147 from roundup import __version__ | 160 from roundup import __version__ |
| 148 | 161 |
| 149 # long_description may not contain non-ascii characters. Distutils | 162 # long_description may not contain non-ascii characters. Distutils |
| 214 'console_scripts': scripts | 227 'console_scripts': scripts |
| 215 }, | 228 }, |
| 216 data_files=data_files) | 229 data_files=data_files) |
| 217 | 230 |
| 218 if __name__ == '__main__': | 231 if __name__ == '__main__': |
| 232 | |
| 233 # Prevent `pip install roundup` from building bdist_wheel. | |
| 234 # Man pages, templates, locales installed under site-packages not | |
| 235 # in normal system locations. | |
| 236 # https://stackoverflow.com/questions/36846260/can-python-setuptools-install-files-outside-dist-packages | |
| 237 ''' | |
| 238 if 'bdist_wheel' in sys.argv: | |
| 239 raise RuntimeError("This setup.py does not support wheels") | |
| 240 ''' | |
| 241 | |
| 219 os.chdir(os.path.dirname(__file__) or '.') | 242 os.chdir(os.path.dirname(__file__) or '.') |
| 220 main() | 243 main() |
| 221 | 244 |
| 222 # vim: set filetype=python sts=4 sw=4 et si : | 245 # vim: set filetype=python sts=4 sw=4 et si : |
