]>
jfr.im git - dlqueue.git/blob - venv/lib/python3.11/site-packages/setuptools/_distutils/command/install_scripts.py
1 """distutils.command.install_scripts
3 Implements the Distutils 'install_scripts' command, for installing
6 # contributed by Bastian Kleineidam
9 from ..core
import Command
10 from distutils
._log
import log
11 from stat
import ST_MODE
14 class install_scripts(Command
):
15 description
= "install scripts (Python or otherwise)"
18 ('install-dir=', 'd', "directory to install scripts to"),
19 ('build-dir=', 'b', "build directory (where to install from)"),
20 ('force', 'f', "force installation (overwrite existing files)"),
21 ('skip-build', None, "skip the build steps"),
24 boolean_options
= ['force', 'skip-build']
26 def initialize_options(self
):
27 self
.install_dir
= None
30 self
.skip_build
= None
32 def finalize_options(self
):
33 self
.set_undefined_options('build', ('build_scripts', 'build_dir'))
34 self
.set_undefined_options(
36 ('install_scripts', 'install_dir'),
38 ('skip_build', 'skip_build'),
42 if not self
.skip_build
:
43 self
.run_command('build_scripts')
44 self
.outfiles
= self
.copy_tree(self
.build_dir
, self
.install_dir
)
45 if os
.name
== 'posix':
46 # Set the executable bits (owner, group, and world) on
47 # all the scripts we just installed.
48 for file in self
.get_outputs():
50 log
.info("changing mode of %s", file)
52 mode
= ((os
.stat(file)[ST_MODE
]) |
0o555) & 0o7777
53 log
.info("changing mode of %s to %o", file, mode
)
57 return self
.distribution
.scripts
or []
59 def get_outputs(self
):
60 return self
.outfiles
or []