(self)
| 255 | easily launch them from a command line. |
| 256 | """ |
| 257 | def run(self): |
| 258 | self.mkpath(self.build_dir) |
| 259 | outfiles = [] |
| 260 | for script in find_entry_points(): |
| 261 | name, entrypt = script.split('=') |
| 262 | name = name.strip() |
| 263 | entrypt = entrypt.strip() |
| 264 | outfile = os.path.join(self.build_dir, name) |
| 265 | outfiles.append(outfile) |
| 266 | print('Writing script to', outfile) |
| 267 | |
| 268 | mod, func = entrypt.split(':') |
| 269 | with open(outfile, 'w') as f: |
| 270 | f.write(script_src.format(executable=sys.executable, |
| 271 | mod=mod, func=func)) |
| 272 | |
| 273 | if sys.platform == 'win32': |
| 274 | # Write .cmd wrappers for Windows so 'ipython' etc. work at the |
| 275 | # command line |
| 276 | cmd_file = os.path.join(self.build_dir, name + '.cmd') |
| 277 | cmd = r'@"{python}" "%~dp0\{script}" %*\r\n'.format( |
| 278 | python=sys.executable, script=name) |
| 279 | log.info("Writing %s wrapper script" % cmd_file) |
| 280 | with open(cmd_file, 'w') as f: |
| 281 | f.write(cmd) |
| 282 | |
| 283 | return outfiles, outfiles |
| 284 | |
| 285 | class install_lib_symlink(Command): |
| 286 | user_options = [ |
nothing calls this directly
no test coverage detected