Repository: xonsh/xonsh

Issue:
Pip install on conda 3.5 env fails
System: OSX 10.10.5, conda Python 3.5, all updates

I see that it asks for `ply` but your docs say `ply` is optional, so it shouldn't fail to install without it. And if it's really not optional, why wouldn't it pull `ply` from Pypi?

``` bash
(stable)└─❱❱❱ pip install xonsh                                                      +5749 15:12 ❰─┘
Collecting xonsh
  Downloading xonsh-0.3.0.tar.gz (257kB)
    100% |████████████████████████████████| 266kB 3.2MB/s
Building wheels for collected packages: xonsh
  Running setup.py bdist_wheel for xonsh ... error
  Complete output from command /Users/klay6683/miniconda3/envs/stable/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/tmp543nqyqbpip-wheel- --python-tag cp35:
                             ╓██▄
                            ╙██▀██╕
                           ▐██4Φ█▀█▌
                         ²██▄███▀██^██
                       -███╩▀ " ╒▄█████▀█
                        ║██▀▀W╤▄▀ ▐║█╘ ╝█
                   ▄m▀%Φ▀▀  ╝*"    ,α█████▓▄,▄▀Γ"▀╕
                   "▀██¼"     ▄═╦█╟║█▀ ╓ `^`   ,▄ ╢╕
                    ,▀╫M█▐j╓╟▀ ╔▓▄█▀  '║ ╔    ╣║▌  ▀▄
                 ▄m▀▀███╬█╝▀  █▀^      "ÜM  j▐╟╫╨▒   ╙▀≡═╤═m▀╗
                 █æsæ╓  ╕, ,▄Ä   ▐'╕H   LU  ║║╠╫Å^2=⌐         █
              ▄æ%Å███╠█ª╙▄█▀      $1╙       ║║╟╫╩*T▄           ▌
             ╙╗%▄,╦██▌█▌█╢M         ╕      M║║║║█═⌐ⁿ"^         ╫
               ╙╣▀████@█░█    ▌╕╕   `      ▌║▐▐║█D═≈⌐¬ⁿ      s ║⌐
                 ╙╬███▓║█`     ▌╚     ╕   ╕▌║▐▐╣▌⌐*▒▒Dù`       ▐▌
                  ╙╬██╨U█      ╟      $ ▌ ▌▌▐▐▐M█▄═≤⌐%       ╓⌐ ▌
                   ║║█▄▌║             ╟ ▌ ▌M▐▐▐M█▀▒▒▒22,       ▐▌
                    ███╙^▌            ║ ▌ ⌐M▐▐▐M█≤⌐⌐¬──        ▐M
                    ║██ ▌╙   ╓       H║ ▌╒ M║▐▐M█"^^^^^"ⁿ      ║
                     ██╕╙@▓   ╕      ▌║ H'  ║▐▐▐█══=.,,,       █
                     ╙█▓╔╚╚█     ╠   ▌└╒ ▌▐ ╚║║║▀****ⁿ -      ╓▌
                      ╙█▌¼V╚▌   ▌  ╕ ▌ ║╒ ║ ▌▒╠█▀≤≤≤≤≤⌐       █
                       ╙█▌╔█╚▌     ┘ M ▌║ ╫ UUM██J^^"        ▐▌
                        ╙██╙█╙▌  ╕$j  ▐⌐▌ ▌║╝╟█Å%%%≈═        █
                         ╙╣█╣█^▌ ╠║▐  ║ ▌▐.DU██^[""ⁿ       -╒▌
                           ▀█▄█`▌ ░M▀ ▌▐ Å£╝╝█╜%≈═╓""w   ⁿ⌐ █
                            `▀▄▀`▌ ▌█▐⌐║▐UW╖██%≤═░*─    =z ▄Γ
                              ╙██╙▄▌█  ▌Å╛╣██╨%╤ƒⁿ=    -` ▄┘
                                █▌╢▓▌▌ W £6█╤,"ⁿ `   ▄≡▀▀▀
                                 █"█▌▌╟Å╓█╓█▀%`    ▄▀
                                 ╙▌██`▒U▓U█%╗*     █
                                  ▌╫║ ▌ÅÅ║▀╛¬`      `"█
                                  ▌╫  ╫╟ █▄     ~╦%▒╥4^
                                  ▌▌  "M█ `▀╕ X╕"╗▄▀^
                                  █▌   ╓M   ╙▀e▀▀^
                                  ╙██▄▄▀
                                    ^^

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/xonsh
  copying xonsh/__init__.py -> build/lib/xonsh
  copying xonsh/aliases.py -> build/lib/xonsh
  copying xonsh/ansi_colors.py -> build/lib/xonsh
  copying xonsh/ast.py -> build/lib/xonsh
  copying xonsh/base_shell.py -> build/lib/xonsh
  copying xonsh/built_ins.py -> build/lib/xonsh
  copying xonsh/codecache.py -> build/lib/xonsh
  copying xonsh/completer.py -> build/lib/xonsh
  copying xonsh/diff_history.py -> build/lib/xonsh
  copying xonsh/dirstack.py -> build/lib/xonsh
  copying xonsh/environ.py -> build/lib/xonsh
  copying xonsh/execer.py -> build/lib/xonsh
  copying xonsh/foreign_shells.py -> build/lib/xonsh
  copying xonsh/history.py -> build/lib/xonsh
  copying xonsh/imphooks.py -> build/lib/xonsh
  copying xonsh/inspectors.py -> build/lib/xonsh
  copying xonsh/jobs.py -> build/lib/xonsh
  copying xonsh/jupyter_kernel.py -> build/lib/xonsh
  copying xonsh/lazyjson.py -> build/lib/xonsh
  copying xonsh/lexer.py -> build/lib/xonsh
  copying xonsh/main.py -> build/lib/xonsh
  copying xonsh/openpy.py -> build/lib/xonsh
  copying xonsh/parser.py -> build/lib/xonsh
  copying xonsh/parser_table.py -> build/lib/xonsh
  copying xonsh/platform.py -> build/lib/xonsh
  copying xonsh/pretty.py -> build/lib/xonsh
  copying xonsh/proc.py -> build/lib/xonsh
  copying xonsh/pyghooks.py -> build/lib/xonsh
  copying xonsh/readline_shell.py -> build/lib/xonsh
  copying xonsh/replay.py -> build/lib/xonsh
  copying xonsh/shell.py -> build/lib/xonsh
  copying xonsh/teepty.py -> build/lib/xonsh
  copying xonsh/timings.py -> build/lib/xonsh
  copying xonsh/tools.py -> build/lib/xonsh
  copying xonsh/tracer.py -> build/lib/xonsh
  copying xonsh/vox.py -> build/lib/xonsh
  copying xonsh/winutils.py -> build/lib/xonsh
  copying xonsh/wizard.py -> build/lib/xonsh
  copying xonsh/xonfig.py -> build/lib/xonsh
  copying xonsh/xontribs.py -> build/lib/xonsh
  creating build/lib/xonsh/ptk
  copying xonsh/ptk/__init__.py -> build/lib/xonsh/ptk
  copying xonsh/ptk/completer.py -> build/lib/xonsh/ptk
  copying xonsh/ptk/history.py -> build/lib/xonsh/ptk
  copying xonsh/ptk/key_bindings.py -> build/lib/xonsh/ptk
  copying xonsh/ptk/shell.py -> build/lib/xonsh/ptk
  copying xonsh/ptk/shortcuts.py -> build/lib/xonsh/ptk
  creating build/lib/xonsh/parsers
  copying xonsh/parsers/__init__.py -> build/lib/xonsh/parsers
  copying xonsh/parsers/base.py -> build/lib/xonsh/parsers
  copying xonsh/parsers/parser_test_table.py -> build/lib/xonsh/parsers
  copying xonsh/parsers/v34.py -> build/lib/xonsh/parsers
  copying xonsh/parsers/v35.py -> build/lib/xonsh/parsers
  creating build/lib/xonsh/xoreutils
  copying xonsh/xoreutils/__init__.py -> build/lib/xonsh/xoreutils
  copying xonsh/xoreutils/_which.py -> build/lib/xonsh/xoreutils
  package init file 'xontrib/__init__.py' not found (or not a regular file)
  creating build/lib/xontrib
  copying xontrib/mpl.py -> build/lib/xontrib
  copying xontrib/mplhooks.py -> build/lib/xontrib
  creating build/lib/xonsh/tokenize
  copying xonsh/tokenize/__init__.py -> build/lib/xonsh/tokenize
  copying xonsh/tokenize/tokenize_34.py -> build/lib/xonsh/tokenize
  copying xonsh/tokenize/tokenize_35.py -> build/lib/xonsh/tokenize
  copying xonsh/xontribs.json -> build/lib/xonsh
  installing to build/bdist.macosx-10.5-x86_64/wheel
  running install
  Remove xonsh/parser_table.py
  Building lexer and parser tables.
  Traceback (most recent call last):
    File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/xonsh/parsers/base.py", line 6, in <module>
      from ply import yacc
  ImportError: No module named 'ply'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/setup.py", line 182, in <module>
      main()
    File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/setup.py", line 178, in main
      setup(**skw)
    File "/Users/klay6683/miniconda3/envs/stable/lib/python3.5/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/Users/klay6683/miniconda3/envs/stable/lib/python3.5/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/Users/klay6683/miniconda3/envs/stable/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/klay6683/miniconda3/envs/stable/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 215, in run
      self.run_command('install')
    File "/Users/klay6683/miniconda3/envs/stable/lib/python3.5/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Users/klay6683/miniconda3/envs/stable/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/setup.py", line 92, in run
      build_tables()
    File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/setup.py", line 53, in build_tables
      from xonsh.parser import Parser
    File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/xonsh/parser.py", line 8, in <module>
      from xonsh.parsers.v35 import Parser
    File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/xonsh/parsers/v35.py", line 4, in <module>
      from xonsh.parsers.base import BaseParser
    File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/xonsh/parsers/base.py", line 8, in <module>
      from xonsh.ply import yacc
  ImportError: No module named 'xonsh.ply'

  ----------------------------------------
  Failed building wheel for xonsh
  Running setup.py clean for xonsh
Failed to build xonsh
Installing collected packages: xonsh
  Running setup.py install for xonsh ... error
    Complete output from command /Users/klay6683/miniconda3/envs/stable/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-iqv1_2t3-record/install-record.txt --single-version-externally-managed --compile:
                               ╓██▄
                              ╙██▀██╕
                             ▐██4Φ█▀█▌
                           ²██▄███▀██^██
                         -███╩▀ " ╒▄█████▀█
                          ║██▀▀W╤▄▀ ▐║█╘ ╝█
                     ▄m▀%Φ▀▀  ╝*"    ,α█████▓▄,▄▀Γ"▀╕
                     "▀██¼"     ▄═╦█╟║█▀ ╓ `^`   ,▄ ╢╕
                      ,▀╫M█▐j╓╟▀ ╔▓▄█▀  '║ ╔    ╣║▌  ▀▄
                   ▄m▀▀███╬█╝▀  █▀^      "ÜM  j▐╟╫╨▒   ╙▀≡═╤═m▀╗
                   █æsæ╓  ╕, ,▄Ä   ▐'╕H   LU  ║║╠╫Å^2=⌐         █
                ▄æ%Å███╠█ª╙▄█▀      $1╙       ║║╟╫╩*T▄           ▌
               ╙╗%▄,╦██▌█▌█╢M         ╕      M║║║║█═⌐ⁿ"^         ╫
                 ╙╣▀████@█░█    ▌╕╕   `      ▌║▐▐║█D═≈⌐¬ⁿ      s ║⌐
                   ╙╬███▓║█`     ▌╚     ╕   ╕▌║▐▐╣▌⌐*▒▒Dù`       ▐▌
                    ╙╬██╨U█      ╟      $ ▌ ▌▌▐▐▐M█▄═≤⌐%       ╓⌐ ▌
                     ║║█▄▌║             ╟ ▌ ▌M▐▐▐M█▀▒▒▒22,       ▐▌
                      ███╙^▌            ║ ▌ ⌐M▐▐▐M█≤⌐⌐¬──        ▐M
                      ║██ ▌╙   ╓       H║ ▌╒ M║▐▐M█"^^^^^"ⁿ      ║
                       ██╕╙@▓   ╕      ▌║ H'  ║▐▐▐█══=.,,,       █
                       ╙█▓╔╚╚█     ╠   ▌└╒ ▌▐ ╚║║║▀****ⁿ -      ╓▌
                        ╙█▌¼V╚▌   ▌  ╕ ▌ ║╒ ║ ▌▒╠█▀≤≤≤≤≤⌐       █
                         ╙█▌╔█╚▌     ┘ M ▌║ ╫ UUM██J^^"        ▐▌
                          ╙██╙█╙▌  ╕$j  ▐⌐▌ ▌║╝╟█Å%%%≈═        █
                           ╙╣█╣█^▌ ╠║▐  ║ ▌▐.DU██^[""ⁿ       -╒▌
                             ▀█▄█`▌ ░M▀ ▌▐ Å£╝╝█╜%≈═╓""w   ⁿ⌐ █
                              `▀▄▀`▌ ▌█▐⌐║▐UW╖██%≤═░*─    =z ▄Γ
                                ╙██╙▄▌█  ▌Å╛╣██╨%╤ƒⁿ=    -` ▄┘
                                  █▌╢▓▌▌ W £6█╤,"ⁿ `   ▄≡▀▀▀
                                   █"█▌▌╟Å╓█╓█▀%`    ▄▀
                                   ╙▌██`▒U▓U█%╗*     █
                                    ▌╫║ ▌ÅÅ║▀╛¬`      `"█
                                    ▌╫  ╫╟ █▄     ~╦%▒╥4^
                                    ▌▌  "M█ `▀╕ X╕"╗▄▀^
                                    █▌   ╓M   ╙▀e▀▀^
                                    ╙██▄▄▀
                                      ^^

    running install
    Building lexer and parser tables.
    Traceback (most recent call last):
      File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/xonsh/parsers/base.py", line 6, in <module>
        from ply import yacc
    ImportError: No module named 'ply'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/setup.py", line 182, in <module>
        main()
      File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/setup.py", line 178, in main
        setup(**skw)
      File "/Users/klay6683/miniconda3/envs/stable/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/Users/klay6683/miniconda3/envs/stable/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/Users/klay6683/miniconda3/envs/stable/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/setup.py", line 92, in run
        build_tables()
      File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/setup.py", line 53, in build_tables
        from xonsh.parser import Parser
      File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/xonsh/parser.py", line 8, in <module>
        from xonsh.parsers.v35 import Parser
      File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/xonsh/parsers/v35.py", line 4, in <module>
        from xonsh.parsers.base import BaseParser
      File "/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/xonsh/parsers/base.py", line 8, in <module>
        from xonsh.ply import yacc
    ImportError: No module named 'xonsh.ply'

    ----------------------------------------
Command "/Users/klay6683/miniconda3/envs/stable/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-iqv1_2t3-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/tt/k11390b92vl_dygt4m0s7gjsb_844d/T/pip-build-ma0rr8_8/xonsh/
```



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -171,7 +171,8 @@ def main():
         url='https://github.com/scopatz/xonsh',
         platforms='Cross Platform',
         classifiers=['Programming Language :: Python :: 3'],
-        packages=['xonsh', 'xonsh.ptk', 'xonsh.parsers', 'xonsh.xoreutils', 'xontrib'],
+        packages=['xonsh', 'xonsh.ply', 'xonsh.ptk', 'xonsh.parsers',
+                  'xonsh.xoreutils', 'xontrib'],
         package_dir={'xonsh': 'xonsh', 'xontrib': 'xontrib'},
         package_data={'xonsh': ['*.json'], 'xontrib': ['*.xsh']},
         cmdclass=cmdclass


Test patch: