def check(dirname): # create a command that isn't in the Project project = project_no_dedicated_env(dirname) command = ProjectCommand( name="foo", attributes=dict(bokeh_app="foo.py", env_spec=project.default_env_spec_name)) environ = minimal_environ() result = prepare_without_interaction(project, environ=environ, command=command) assert result.errors == [] assert result assert os.path.join(project.directory_path, 'foo.py') in result.command_exec_info.args
def _command_from_name(project, command_name): command = project.command_for_name(command_name) if command is None and command_name is not None: # if the command name isn't a configured command name, # interpret the command as a notebook or executable. attrs = dict(env_spec=project.default_env_spec_name) if command_name.lower().endswith(".ipynb"): attrs['notebook'] = command_name else: attrs['args'] = [command_name] command = ProjectCommand(name=command_name, attributes=attrs) return command