File tree Expand file tree Collapse file tree 4 files changed +43
-14
lines changed
Expand file tree Collapse file tree 4 files changed +43
-14
lines changed Original file line number Diff line number Diff line change 33# All rights reserved.
44# For license terms see the file COPYING.txt.
55#
6- from distutils . command . bdist_rpm import bdist_rpm as base
7- from distutils . file_util import write_file
6+ # converted to not use distutils 2021
7+ from setuptools . command . bdist_rpm import bdist_rpm as base
88import os
99
10+ # cribbed from 2.7 distutils
11+ def write_file (filename , contents ):
12+ """Create a file with the specified name and write 'contents' (a
13+ sequence of strings without line terminators) to it.
14+ """
15+ f = open (filename , "w" )
16+ try :
17+ for line in contents :
18+ f .write (line + "\n " )
19+ finally :
20+ f .close ()
21+
1022class bdist_rpm (base ):
1123
1224 def finalize_options (self ):
Original file line number Diff line number Diff line change 55#
66from __future__ import print_function
77from 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
913import os
1014from glob import glob
1115
@@ -24,10 +28,11 @@ def check_manifest():
2428 """Check that the files listed in the MANIFEST are present when the
2529 source is unpacked.
2630 """
31+ manifest_file = 'roundup.egg-info/SOURCES.txt'
2732 try :
28- f = open ('MANIFEST' )
33+ f = open (manifest_file )
2934 except :
30- print ('\n *** SOURCE WARNING: The MANIFEST file is missing!' )
35+ print ('\n *** SOURCE WARNING: The MANIFEST file "%s" is missing!' % manifest_file )
3136 return
3237 try :
3338 manifest = [l .strip () for l in f .readlines ()]
Original file line number Diff line number Diff line change 88import os .path
99import glob
1010
11- from distutils .command import build
12- from distutils .spawn import spawn , find_executable
13- from distutils .dep_util import newer , newer_group
14- from distutils .dir_util import copy_tree , remove_tree , mkpath
15- from distutils .file_util import copy_file
16- from distutils import sysconfig
17-
18- class build_doc (build .build ):
11+ try :
12+ from setuptools .command .install import install as _build_py
13+ raise ImportError
14+ except ImportError :
15+ from distutils .command .build import build as _build_py # try/except clause
16+ orig_build = _build_py
17+
18+ try :
19+ # would be nice to use setuptools.Command.spawn() as it
20+ # obeys the dry-run flag.
21+ from subprocess import run as spawn
22+ except ImportError :
23+ from distutils .spawn import spawn # try/except: in except for subprocess
24+
25+ try :
26+ from distutils .spawn import find_executable # try/except: in try local find
27+ except ImportError :
28+ from roundup .dist .command import find_executable
29+
30+ class build_doc (_build_py ):
1931 """Defines the specific procedure to build roundup's documentation."""
2032
2133 description = "build documentation"
Original file line number Diff line number Diff line change 11from roundup .dist .command .build import build_message_files , check_manifest
2- from distutils .command .install_lib import install_lib as base
2+ from setuptools .command .install_lib import install_lib as base
33
44class install_lib (base ):
55
You can’t perform that action at this time.
0 commit comments