Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended parser to support pyct commands #176

Merged
merged 3 commits into from
Dec 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions panel/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def transform_cmds(argv):
"""
Allows usage with anaconda-project by remapping the argv list provided
Allows usage with anaconda-project by remapping the argv list provided
into arguments accepted by Bokeh 0.12.7 or later.
"""
replacements = {'--anaconda-project-host':'--allow-websocket-origin',
Expand All @@ -33,6 +33,18 @@ def transform_cmds(argv):
return transformed


def main():
sys.argv = transform_cmds(sys.argv)
bokeh_entry_point()
def main(args=None):
jlstevens marked this conversation as resolved.
Show resolved Hide resolved
"""Special case: Allow Bokeh to handle the `serve` command; rest is handled by pyct."""
if len(sys.argv) > 1 and 'serve' == sys.argv[1]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 'serve' the only bokeh command we are supporting?

sys.argv = transform_cmds(sys.argv)
bokeh_entry_point()
else:
try:
import pyct.cmd
except ImportError:
print("install pyct to enable this command (e.g. `conda install -c pyviz pyct` or `pip install pyct[cmd]`)")
sys.exit(1)
pyct.cmd.substitute_main('panel',args=args)

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def run(self):
except ImportError as e:
print("Custom model compilation failed with: %s" % e)
install.run(self)

extras_require['all'] = sorted(set(sum(extras_require.values(), [])))

# until pyproject.toml/equivalent is widely supported (setup_requires
Expand Down