Mercurial > p > roundup > code
comparison roundup/dist/command/build_doc.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 | 7612b86bec69 |
| children | 4ff18b1cd9bf |
comparison
equal
deleted
inserted
replaced
| 6646:98a9df71e24c | 6647:42bf0a707763 |
|---|---|
| 6 | 6 |
| 7 import os, sys | 7 import os, sys |
| 8 import os.path | 8 import os.path |
| 9 import glob | 9 import glob |
| 10 | 10 |
| 11 from distutils.command import build | 11 try: |
| 12 from distutils.spawn import spawn, find_executable | 12 from setuptools.command.install import install as _build_py |
| 13 from distutils.dep_util import newer, newer_group | 13 raise ImportError |
| 14 from distutils.dir_util import copy_tree, remove_tree, mkpath | 14 except ImportError: |
| 15 from distutils.file_util import copy_file | 15 from distutils.command.build import build as _build_py # try/except clause |
| 16 from distutils import sysconfig | 16 orig_build = _build_py |
| 17 | 17 |
| 18 class build_doc(build.build): | 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): | |
| 19 """Defines the specific procedure to build roundup's documentation.""" | 31 """Defines the specific procedure to build roundup's documentation.""" |
| 20 | 32 |
| 21 description = "build documentation" | 33 description = "build documentation" |
| 22 | 34 |
| 23 def run(self): | 35 def run(self): |
