Mercurial > p > roundup > code
comparison roundup/dist/command/build.py @ 6647:42bf0a707763
issue2551183 - Replace references to distutils in roundup/dist/command
First pass at fixing this. Seems to work in:
native install
virtual env
python 2.7 and 3.6. Also docker python 3. Could use more testing
though.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 28 Apr 2022 18:10:10 -0400 |
| parents | f2fade4552c5 |
| children | 1acdc651133b |
comparison
equal
deleted
inserted
replaced
| 6646:98a9df71e24c | 6647:42bf0a707763 |
|---|---|
| 3 # All rights reserved. | 3 # All rights reserved. |
| 4 # For license terms see the file COPYING.txt. | 4 # For license terms see the file COPYING.txt. |
| 5 # | 5 # |
| 6 from __future__ import print_function | 6 from __future__ import print_function |
| 7 from roundup import msgfmt | 7 from roundup import msgfmt |
| 8 from distutils.command.build import build as base | 8 try: |
| 9 from setuptool.command.install import install as base | |
| 10 raise ImportError | |
| 11 except ImportError: | |
| 12 from distutils.command.build import build as base | |
| 9 import os | 13 import os |
| 10 from glob import glob | 14 from glob import glob |
| 11 | 15 |
| 12 def list_message_files(suffix=".po"): | 16 def list_message_files(suffix=".po"): |
| 13 """Return list of all found message files and their intallation paths""" | 17 """Return list of all found message files and their intallation paths""" |
| 22 | 26 |
| 23 def check_manifest(): | 27 def check_manifest(): |
| 24 """Check that the files listed in the MANIFEST are present when the | 28 """Check that the files listed in the MANIFEST are present when the |
| 25 source is unpacked. | 29 source is unpacked. |
| 26 """ | 30 """ |
| 31 manifest_file = 'roundup.egg-info/SOURCES.txt' | |
| 27 try: | 32 try: |
| 28 f = open('MANIFEST') | 33 f=open(manifest_file) |
| 29 except: | 34 except: |
| 30 print('\n*** SOURCE WARNING: The MANIFEST file is missing!') | 35 print('\n*** SOURCE WARNING: The MANIFEST file "%s" is missing!' % manifest_file) |
| 31 return | 36 return |
| 32 try: | 37 try: |
| 33 manifest = [l.strip() for l in f.readlines()] | 38 manifest = [l.strip() for l in f.readlines()] |
| 34 finally: | 39 finally: |
| 35 f.close() | 40 f.close() |
