Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8161022

Browse files
committed
Added --compile, --optimize options so users have an easy way to
instruct the "install_lib" command from the command-line.
1 parent cb9c9ae commit 8161022

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lib/distutils/command/install.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ class install (Command):
9090
('install-data=', None,
9191
"installation directory for data files"),
9292

93+
# Byte-compilation options -- see install_lib.py for details, as
94+
# these are duplicated from there (but only install_lib does
95+
# anything with them).
96+
('compile', 'c', "compile .py to .pyc [default]"),
97+
('no-compile', None, "don't compile .py files"),
98+
('optimize=', 'O',
99+
"also compile with optimization: -O1 for \"python -O\", "
100+
"-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
101+
93102
# Miscellaneous control options
94103
('force', 'f',
95104
"force installation (overwrite any existing files)"),
@@ -135,6 +144,9 @@ def initialize_options (self):
135144
self.install_scripts = None
136145
self.install_data = None
137146

147+
self.compile = None
148+
self.optimize = None
149+
138150
# These two are for putting non-packagized distributions into their
139151
# own directory and creating a .pth file if it makes sense.
140152
# 'extra_path' comes from the setup file; 'install_path_file' can

0 commit comments

Comments
 (0)