Browse Source

remove a bunhc of stuff

adam j hartz 2 years ago
parent
commit
8ff4363ea8
70 changed files with 1 additions and 6415 deletions
  1. 1
    0
      .gitignore
  2. 0
    424
      CHANGELOG.rst
  3. 0
    393
      CONTRIBUTING.rst
  4. 0
    1
      MANIFEST.in
  5. 0
    28
      README.rst
  6. 0
    1
      appveyor.yml
  7. 0
    1
      binstar.yml
  8. 0
    9
      codecov.yml
  9. 0
    37
      logo.txt
  10. 0
    68
      news/035.rst
  11. 0
    11
      news/TEMPLATE.rst
  12. 0
    15
      news/adqm-anon_aliases.rst
  13. 0
    15
      news/adqm-more_search.rst
  14. 0
    14
      news/clean-up-premain.rst
  15. 0
    13
      news/completer_list_bugs.rst
  16. 0
    14
      news/fix_pipeline.rst
  17. 0
    13
      news/fix_xonfig.rst
  18. 0
    13
      news/path_tuple.rst
  19. 0
    15
      news/replace_prompt.rst
  20. 0
    22
      news/rmbash.rst
  21. 0
    14
      news/simplify_env_repr.rst
  22. 0
    14
      news/source_cmd_prompt.rst
  23. 0
    14
      news/vi_mode_change.rst
  24. 0
    36
      recipe/meta.yaml
  25. BIN
      recipe/xonsh.ico
  26. 0
    11
      recipe/xonsh_shortcut.json
  27. 0
    159
      release.xsh
  28. 0
    3
      requirements-docs.txt
  29. 0
    6
      requirements-tests.txt
  30. 0
    5
      tests/bashrc.sh
  31. 0
    3
      tests/batch.bat
  32. 0
    12
      tests/histories/echo.json
  33. 0
    16
      tests/histories/simple-python.json
  34. BIN
      tests/man1/yes.1.gz
  35. 0
    5
      tests/sample.xsh
  36. 0
    140
      tests/test_aliases.py
  37. 0
    34
      tests/test_ast.py
  38. 0
    118
      tests/test_builtins.py
  39. 0
    340
      tests/test_contexts.py
  40. 0
    77
      tests/test_dirstack.py
  41. 0
    184
      tests/test_environ.py
  42. 0
    113
      tests/test_execer.py
  43. 0
    80
      tests/test_foreign_shells.py
  44. 0
    226
      tests/test_history.py
  45. 0
    50
      tests/test_imphooks.py
  46. 0
    17
      tests/test_inspectors.py
  47. 0
    184
      tests/test_lazyjson.py
  48. 0
    210
      tests/test_lexer.py
  49. 0
    37
      tests/test_main.py
  50. 0
    41
      tests/test_man.py
  51. 0
    1823
      tests/test_parser.py
  52. 0
    33
      tests/test_ptk_history.py
  53. 0
    117
      tests/test_ptk_multiline.py
  54. 0
    64
      tests/test_replay.py
  55. 0
    703
      tests/test_tools.py
  56. 0
    53
      tests/test_wizard.py
  57. 0
    6
      tests/test_xontribs.py
  58. 0
    135
      tests/tools.py
  59. 0
    0
      tests/xpack/__init__.py
  60. 0
    3
      tests/xpack/relimp.xsh
  61. 0
    5
      tests/xpack/sample.xsh
  62. 0
    0
      tests/xpack/sub/__init__.py
  63. 0
    5
      tests/xpack/sub/sample.xsh
  64. 0
    1
      travis.yml
  65. 0
    55
      xonsh-in-docker.py
  66. 0
    5
      xontrib/README
  67. 0
    73
      xontrib/distributed.py
  68. 0
    12
      xontrib/mpl.py
  69. 0
    65
      xontrib/mplhooks.py
  70. 0
    1
      xontribs.json

+ 1
- 0
.gitignore View File

@@ -2,6 +2,7 @@
2 2
 *.out
3 3
 *.xcf
4 4
 *.egg
5
+*.egg-info
5 6
 .eggs/
6 7
 lexer_table.py
7 8
 parser_table.py

+ 0
- 424
CHANGELOG.rst View File

@@ -1,424 +0,0 @@
1
-====================
2
-Xonsh Change Log
3
-====================
4
-
5
-.. current developments
6
-
7
-v0.3.4
8
-====================
9
-
10
-**Changed:**
11
-
12
-* ``$PROMPT`` from foreign shells is now ignored.
13
-* ``$RC_FILES`` environment variable now stores the run control files we
14
-  attempted to load.
15
-* Only show the prompt for the wizard if we did not attempt to load any run
16
-  control files (as opposed to if none were successfully loaded).
17
-* Git and mercurial branch and dirty function refactor to imporve run times.
18
-
19
-
20
-**Fixed:**
21
-
22
-* Fixed an issue whereby attempting to delete a literal value (e.g., ``del 7``)
23
-  in the prompt_toolkit shell would cause xonsh to crash.
24
-* Fixed broken behavior when using ``cd ..`` to move into a nonexistent
25
-  directory.
26
-* Partial workaround for Cygwin where ``pthread_sigmask`` appears to be missing
27
-  from the ``signal`` module.
28
-* Fixed crash resulting from malformed ``$PROMPT``.
29
-* Fixed regression on Windows with the locate_binary() function.
30
-  The bug prevented `source-cmd` from working correctly and broke the
31
-  ``activate``/``deactivate`` aliases for the conda environements.
32
-* Fixed crash resulting from errors other than syntax errors in run control
33
-  file.
34
-* On Windows if bash is not on the path look in the registry for the defaults
35
-  install directory for GitForWindows.
36
-
37
-
38
-v0.3.3
39
-====================
40
-**Added:**
41
-
42
-* Question mark literals, ``?``, are now allowed as part of
43
-  subprocess argument names.
44
-* IPython style visual pointer to show where syntax error was detected
45
-* Pretty printing of output and syntax highlighting of input and output can now
46
-  be controlled via new environment variables ``$COLOR_INPUT``,
47
-  ``$COLOR_RESULTS``, and ``$PRETTY_PRINT_RESULTS``.
48
-
49
-* In interactive mode, if there are stopped or background jobs, Xonsh prompts
50
-  for confirmations rather than just killing all jobs and exiting.
51
-
52
-**Changed:**
53
-
54
-* ``which`` now gives a better verbose report of where the executables are
55
-  found.
56
-* Tab completion now uses a different interface, which allows new completers
57
-  to be implemented in Python.
58
-* Most functions in the ``Execer`` now take an extra argument
59
-  ``transform``, indicating whether the syntax tree transformations should
60
-  be applied.
61
-* ``prompt_toolkit`` is now loaded lazily, decreasing load times when using
62
-  the ``readline`` shell.
63
-* RC files are now executed directly in the appropriate context.
64
-* ``_`` is now updated by ``![]``, to contain the appropriate
65
-  ``CompletedCommand`` object.
66
-
67
-
68
-
69
-**Removed:**
70
-
71
-* Fixed bug on Windows where ``which`` did not include current directory
72
-
73
-**Fixed:**
74
-
75
-* Fixed crashed bash-completer when bash is not avaiable on Windows
76
-* Fixed bug on Windows where tab-completion for executables would return all files.
77
-* Fixed bug on Windows which caused the bash $PROMPT variable to be used when no
78
-  no $PROMPT variable was set in .xonshrc
79
-* Improved start-up times by caching information about bash completion
80
-  functions
81
-* The --shell-type CLI flag now takes precedence over $SHELL_TYPE specified in
82
-  .xonshrc
83
-* Fixed an issue about ``os.killpg()`` on OS X which caused xonsh crash with
84
-  occasionality
85
-
86
-
87
-
88
-v0.3.2
89
-====================
90
-**Fixed:**
91
-
92
-* Fixed PermissionError when tab completions tries to lookup executables in
93
-  directories without read permissions.
94
-* Fixed incorrect parsing of command line flags
95
-
96
-
97
-
98
-v0.3.1
99
-====================
100
-**Added:**
101
-
102
-* When a subprocess exits with a signal (e.g. SIGSEGV), a message is printed,
103
-  similar to Bash.
104
-* Added comma literals to subproc mode.
105
-* ``@$(cmd)`` has been added as a subprocess-mode operator, which replaces in
106
-  the subprocess command itself with the result of running ``cmd``.
107
-* New ``showcmd`` alias for displaying how xonsh interprets subprocess mode
108
-  commands and arguments.
109
-* Added ``$DYNAMIC_CWD_WIDTH`` to allow the adjusting of the current working
110
-  directory width in the prompt.
111
-* Added ``$XONSH_DEBUG`` environment variable to help with debuging.
112
-* The ``${...}`` shortcut for ``__xonsh_env__`` now returns appropriate
113
-  completion options
114
-
115
-**Changed:**
116
-
117
-* On Windows the default bash completions files ``$BASH_COMPLETIONS`` now points
118
-  to the default location of the completions files used by 'Git for Windows'
119
-* On Cygwin, some tweaks are applied to foreign shell subprocess calls and the
120
-  readline import, in order to avoid hangs on launch.
121
-
122
-
123
-**Removed:**
124
-
125
-* Special cased code for handling version of prompt_toolkit < v1.0.0
126
-
127
-
128
-**Fixed:**
129
-
130
-* Show sorted bash completions suggestions.
131
-* Fix bash completions (e.g git etc.) on windows when completions files have
132
-  spaces in their path names
133
-* Fixed a bug preventing ``source-bash`` from working on Windows
134
-* Numerous improvements to job control via a nearly-complete rewrite.
135
-* Addressed issue with finding the next break in subproc mode in context
136
-  sensitive parsing.
137
-* Fixed issue with loading readline init files (inputrc) that seems to be
138
-  triggered by libedit.
139
-* ``$MULTILINE_PROMPT`` now allows colors, as originally intended.
140
-* Rectified install issue with Jupyter hook when installing with pyenv,
141
-  Jupyter install hook now repects ``--prefix`` argument.
142
-* Fixed issue with the xonsh.ply subpackage not being installed.
143
-* Fixed a parsing bug whereby a trailing ``&`` on a line was being ignored
144
-  (processes were unable to be started in the background)
145
-
146
-
147
-
148
-v0.3.0
149
-====================
150
-**Added:**
151
-
152
-* ``and``, ``or``, ``&&``, ``||`` have been added as subprocess logical operators,
153
-  by popular demand!
154
-* Subprocesses may be negated with ``not`` and grouped together with parentheses.
155
-* New framework for writing xonsh extentions, called ``xontribs``.
156
-* Added a new shell type ``'none'``, used to avoid importing ``readline`` or
157
-  ``prompt_toolkit`` when running scripts or running a single command.
158
-* New: `sudo` functionality on Windows through an alias
159
-* Automatically enhance colors for readability in the default terminal (cmd.exe)
160
-  on Windows. This functionality can be enabled/disabled with the
161
-  $INTENSIFY_COLORS_ON_WIN environment variable.
162
-* Added ``Ellipsis`` lookup to ``__xonsh_env__`` to allow environment variable checks, e.g. ``'HOME' in ${...}``
163
-* Added an option to update ``os.environ`` every time the xonsh environment changes.
164
-  This is disabled by default but can be enabled by setting ``$UPDATE_OS_ENVIRON`` to
165
-  True.
166
-* Added Windows 'cmd.exe' as a foreign shell. This gives xonsh the ability to source
167
-  Windows Batch files (.bat and .cmd). Calling ``source-cmd script.bat`` or the
168
-  alias ``source-bat script.bat`` will call the bat file and changes to the
169
-  environment variables will be reflected in xonsh.
170
-* Added an alias for the conda environment activate/deactivate batch scripts when
171
-  running the Anaconda python distribution on Windows.
172
-* Added a menu entry to launch xonsh when installing xonsh from a conda package
173
-* Added a new ``which`` alias that supports both regular ``which`` and also searches
174
-  through xonsh aliases. A pure python implementation of ``which`` is used. Thanks
175
-  to Trent Mick. https://github.com/trentm/which/
176
-* Added support for prompt toolkit v1.0.0.
177
-* Added ``$XONSH_CACHE_SCRIPTS`` and ``$XONSH_CACHE_EVERYTHING`` environment
178
-  variables to control caching of scripts and interactive commands.  These can
179
-  also be controlled by command line options ``--no-script-cache`` and
180
-  ``--cache-everything`` when starting xonsh.
181
-* Added a workaround to allow ctrl-c to interrupt reverse incremental search in
182
-  the readline shell
183
-
184
-**Changed:**
185
-
186
-* Running scripts through xonsh (or running a single command with ``-c``) no
187
-  longer runs the user's rc file, unless the ``--login`` option is specified.
188
-  Also avoids loading aliases and environments from foreign shells, as well as
189
-  loading bash completions.
190
-* rc files are now compiled and cached, to avoid re-parsing when they haven't
191
-  changed.  Scripts are also compiled and cached, and there is the option to
192
-  cache interactive commands.
193
-* Left and Right arrows in the ``prompt_toolkit`` shell now wrap in multiline
194
-  environments
195
-* Regexpath matching with backticks, now returns an empty list in python mode.
196
-* Pygments added as a dependency for the conda package
197
-* Foreign shells now allow for setting exit-on-error commands before and after
198
-  all other commands via the ``seterrprevcmd`` and ``seterrpostcmd`` arguments.
199
-  Sensinble defaults are provided for existing shells.
200
-* PLY is no longer a external dependency but is bundled in xonsh/ply. Xonsh can
201
-  therefore run without any external dependencies, although having prompt-toolkit
202
-  recommended.
203
-* Provide better user feedback when running ``which`` in a platform that doesn't
204
-  provide it (e.g. Windows).
205
-* The lexer now uses a custom tokenizer that handles regex globs in the proper
206
-  way.
207
-
208
-
209
-
210
-
211
-
212
-
213
-**Fixed:**
214
-
215
-* Fixed bug with loading prompt-toolkit shell < v0.57.
216
-* Fixed bug with prompt-toolkit completion when the cursor is not at the end of
217
-  the line.
218
-* Aliases will now evaluate enviornment variables and other expansions
219
-  at execution time rather than passing through a literal string.
220
-* Fixed environment variables from os.environ not beeing loaded when a running
221
-  a script
222
-* The readline shell will now load the inputrc files.
223
-* Fixed bug that prevented `source-alias` from working.
224
-* Now able to ``^C`` the xonfig wizard on start up.
225
-* Fixed deadlock on Windows when runing subprocess that generates enough output
226
-  to fill the OS pipe buffer.
227
-* Sourcing foreign shells will now return a non-zero exit code if the
228
-  source operation failed for some reason.
229
-* Fixed PermissionError when running commands in directories without read permissions
230
-* Prevent Windows fixups from overriding environment vars in static config
231
-* Fixed Optional Github project status to reflect added/removed files via git_dirty_working_directory()
232
-* Fixed xonsh.exe launcher on Windows, when Python install directory has a space in it
233
-* Fixed `$CDPATH` to support `~` and environments variables in its items
234
-
235
-
236
-
237
-
238
-v0.2.7
239
-====================
240
-**Added:**
241
-
242
-* Added new valid ``$SHELL_TYPE`` called ``'best'``. This selects the best value
243
-  for the concrete shell type based on the availability on the user's machine.
244
-* New environment variable ``$XONSH_COLOR_STYLE`` will set the color mapping
245
-  for all of xonsh.
246
-* New ``XonshStyle`` pygments style will determine the approriate color
247
-  mapping based on ``$XONSH_COLOR_STYLE``.  The associated ``xonsh_style_proxy()``
248
-  is intended for wrapping ``XonshStyle`` when actually being used by
249
-  pygments.
250
-* The functions ``print_color()`` and ``format_color()`` found in ``xonsh.tools``
251
-  dispatch to the approriate shell color handling and may be used from
252
-  anywhere.
253
-* ``xonsh.tools.HAVE_PYGMENTS`` flag now denotes if pygments is installed and
254
-  available on the users system.
255
-* The ``ansi_colors`` module is now availble for handling ANSI color codes.
256
-* ``?`` and ``??`` operator output now has colored titles, like in IPython.
257
-* ``??`` will syntax highlight source code if pygments is available.
258
-* Python mode output is now syntax highlighted if pygments is available.
259
-* New ``$RIGHT_PROMPT`` environment variable for displaying right-aligned
260
-  text in prompt-toolkit shell.
261
-* Added ``!(...)`` operator, which returns an object representing the result
262
-  of running a command.  The truth value of this object is True if the
263
-  return code is equal to zero and False otherwise.
264
-* Optional dependency on the win_unicode_console package to enable unicode
265
-  support in cmd.exe on Windows. This can be disabled/enabled with the
266
-  ``$WIN_UNICODE_CONSOLE`` environment variable.
267
-
268
-**Changed:**
269
-
270
-* Updated ``$SHELL_TYPE`` default to ``'best'``.
271
-* Shell classes are now responsible for implementing their own color
272
-  formatting and printing.
273
-* Prompt coloring, history diffing, and tracing uses new color handling
274
-  capabilities.
275
-* New ``Token.Color`` token for xonsh color names, e.g. we now use
276
-  ``Token.Color.RED`` rather than ``Token.RED``.
277
-* Untracked files in git are ignored when determining if a git workdir is
278
-  is dirty. This affects the coloring of the branch label.
279
-* Regular expression globbing now uses ``re.fullmatch`` instead of
280
-  ``re.match``, and the result of an empty regex glob does not cause the
281
-  argument to be deleted.
282
-
283
-
284
-**Removed:**
285
-
286
-* The ``xonsh.tools.TERM_COLORS`` mapping has been axed, along with all
287
-  references to it. This may cause a problem if you were using a raw color code
288
-  in your xonshrc file from ``$FORMATTER_DICT``. To fix, simply remove these
289
-  references.
290
-
291
-**Fixed:**
292
-
293
-* Multidimensional slicing, as in numpy, no longer throws SyntaxErrors.
294
-* Some minor zsh fixes for more platforms and setups.
295
-* The ``BaseShell.settitle`` method no longer has its commands captured by
296
-  ``$(...)``
297
-
298
-
299
-
300
-v0.2.6
301
-====================
302
-**Added:**
303
-
304
-* ``trace`` alias added that enables users to turn on and off the printing
305
-  of source code lines prior to their execution. This is useful for debugging scripts.
306
-* New ability to force callable alias functions to be run in the foreground, i.e.
307
-  the main thread from which the function was called. This is useful for debuggers
308
-  and profilers which may require such access. Use the ``xonsh.proc.foreground``
309
-  decorator on an alias function to flag it. ``ForegroundProcProxy`` and
310
-  ``SimpleForegroundProcProxy`` classes have been added to support this feature.
311
-  Normally, forcing a foreground alias is not needed.
312
-* Added boolean ``$RAISE_SUBPROC_ERROR`` environment variable. If true
313
-  and a subprocess command exits with a non-zero return code, a
314
-  CalledProcessError will be raised. This is useful in scripts that should
315
-  fail at the first error.
316
-* If the ``setproctitle`` package is installed, the process title will be
317
-  set to ``'xonsh'`` rather than the path to the Python interpreter.
318
-* zsh foreign shell interface now supported natively in xonsh, like with Bash.
319
-  New ``source-zsh`` alias allows easy access to zsh scripts and functions.
320
-* Vox virtual environment manager added.
321
-
322
-**Changed:**
323
-
324
-* The ``foreign_shell_data()`` keyword arguments ``envcmd`` and ``aliascmd``
325
-  now default to ``None``.
326
-* Updated alias docs to pull in usage from the commands automatically.
327
-
328
-**Fixed:**
329
-
330
-* Hundreds of bugs related to line and column numbers have been addressed.
331
-* Fixed path completion not working for absolute paths or for expanded paths on Windows.
332
-* Fixed issue with hg dirty branches and $PATH.
333
-* Fixed issues related to foreign shell data in files with whitespace in the names.
334
-* Worked around bug in ConEmu/cmder which prevented ``get_git_branch()``
335
-  from working in these terminal emulators on Windows.
336
-
337
-
338
-v0.2.5
339
-===========
340
-**Added:**
341
-
342
-* New configuration utility 'xonfig' which reports current system
343
-  setup information and creates config files through an interactive
344
-  wizard.
345
-* Toolkit for creating wizards now available
346
-* timeit and which aliases will now complete their arguments.
347
-* $COMPLETIONS_MENU_ROWS environment variable controls the size of the
348
-  tab-completion menu in prompt-toolkit.
349
-* Prompt-toolkit shell now supports true multiline input with the ability
350
-  to scroll up and down in the prompt.
351
-
352
-**Changed:**
353
-
354
-* The xonfig wizard will run on interactive startup if no configuration
355
-  file is found.
356
-* BaseShell now has a singleline() method for prompting a single input.
357
-* Environment variable docs are now auto-generated.
358
-* Prompt-toolkit shell will now dynamically allocate space for the
359
-  tab-completion menu.
360
-* Looking up nonexistent environment variables now generates an error
361
-  in Python mode, but produces a sane default value in subprocess mode.
362
-* Environments are now considered to contain all manually-adjusted keys,
363
-  and also all keys with an associated default value.
364
-
365
-**Removed:**
366
-
367
-* Removed ``xonsh.ptk.shortcuts.Prompter.create_prompt_layout()`` and
368
-  ``xonsh.ptk.shortcuts.Prompter.create_prompt_application()`` methods
369
-  to reduce portion of xonsh that forks prompt-toolkit. This may require
370
-  users to upgrade to prompt-toolkit v0.57+.
371
-
372
-**Fixed:**
373
-
374
-* First prompt in the prompt-toolkit shell now allows for up and down
375
-  arrows to search through history.
376
-* Made obtaining the prompt-toolkit buffer thread-safe.
377
-* Now always set non-detypable environment variables when sourcing
378
-  foreign shells.
379
-* Fixed issue with job management if a TTY existed but was not controlled
380
-  by the process, posix only.
381
-* Jupyter kernel no longer times out when using foreign shells on startup.
382
-* Capturing redirections, e.g. ``$(echo hello > f.txt)``, no longer fails
383
-  with a decoding error.
384
-* Evaluation in a Jupyter cell will return pformatted object.
385
-* Jupyter with redirect uncaptured subprocs to notebook.
386
-* Tab completion in Jupyter fixed.
387
-
388
-
389
-v0.2.1 - v0.2.4
390
-===============
391
-You are reading the docs...but you still feel hungry.
392
-
393
-v0.2.0
394
-=============
395
-**Added:**
396
-
397
-* Rich history recording and replaying
398
-
399
-v0.1.0
400
-=============
401
-**Added:**
402
-
403
-* Naturally typed environment variables
404
-* Inherits the environment from BASH
405
-* Uses BASH completion for subprocess commands
406
-* Regular expression filename globbing
407
-* Its own PLY-based lexer and parser
408
-* xonsh code parses into a Python AST
409
-* You can do all the normal Python things, like arithmetic and importing
410
-* Captured and uncaptured subprocesses
411
-* Pipes, redirection, and non-blocking subprocess syntax support
412
-* Help and superhelp with ? and ??
413
-* Command aliasing
414
-* Multiline input, unlike ed
415
-* History matching like in IPython
416
-* Color prompts
417
-* Low system overhead
418
-
419
-
420
-
421
-
422
-<v0.1.0
423
-=============
424
-The before times, like 65,000,000 BCE.

+ 0
- 393
CONTRIBUTING.rst View File

@@ -1,393 +0,0 @@
1
-.. _devguide:
2
-
3
-=================
4
-Developer's Guide
5
-=================
6
-Welcome to the xonsh developer's guide!  This is a place for developers to
7
-place information that does not belong in the user's guide or the library
8
-reference but is useful or necessary for the next people that come along to
9
-develop xonsh.
10
-
11
-.. note:: All code changes must go through the pull request review procedure.
12
-
13
-Changelog
14
-=========
15
-Pull requests will often have CHANGELOG entries associated with. However,
16
-to avoid excessive merge conflicts, please follow the following procedure:
17
-
18
-1. Go into the ``news/`` directory,
19
-2. Copy the ``TEMPLATE.rst`` file to another file in the ``news/`` directory.
20
-   We suggest using the branchname::
21
-
22
-        $ cp TEMPLATE.rst branch.rst
23
-
24
-3. Add your entries as a bullet pointed lists in your ``branch.rst`` file in
25
-   the appropriate category. It is OK to leave the ``None`` entries for later
26
-   use.
27
-4. Commit your ``branch.rst``.
28
-
29
-Feel free to update this file whenever you want! Please don't use someone
30
-else's file name. All of the files in this ``news/`` directory will be merged
31
-automatically at release time.  The ``None`` entries will be automatically
32
-filtered out too!
33
-
34
-
35
-Style Guide
36
-===========
37
-xonsh is a pure Python project, and so we use PEP8 (with some additions) to
38
-ensure consistency throughout the code base.
39
-
40
-----------------------------------
41
-Rules to Write By
42
-----------------------------------
43
-It is important to refer to things and concepts by their most specific name.
44
-When writing xonsh code or documentation please use technical terms
45
-appropriately. The following rules help provide needed clarity.
46
-
47
-**********
48
-Interfaces
49
-**********
50
-* User-facing APIs should be as generic and robust as possible.
51
-* Tests belong in the top-level ``tests`` directory.
52
-* Documentation belongs in the top-level ``docs`` directory.
53
-
54
-************
55
-Expectations
56
-************
57
-* Code must have associated tests and adequate documentation.
58
-* User-interaction code (such as the Shell class) is hard to test.
59
-  Mechanism to test such constructs should be developed over time.
60
-* Have *extreme* empathy for your users.
61
-* Be selfish. Since you will be writing tests you will be your first user.
62
-
63
--------------------
64
-Python Style Guide
65
--------------------
66
-xonsh uses `PEP8`_ for all Python code. The following rules apply where `PEP8`_
67
-is open to interpretation.
68
-
69
-* Use absolute imports (``import xonsh.tools``) rather than explicit
70
-  relative imports (``import .tools``). Implicit relative imports
71
-  (``import tools``) are never allowed.
72
-* Use ``'single quotes'`` for string literals, and
73
-  ``"""triple double quotes"""`` for docstrings. Double quotes are allowed to
74
-  prevent single quote escaping, e.g. ``"Y'all c'mon o'er here!"``
75
-* We use sphinx with the numpydoc extension to autogenerate API documentation. Follow
76
-  the `numpydoc`_ standard for docstrings.
77
-* Simple functions should have simple docstrings.
78
-* Lines should be at most 80 characters long. The 72 and 79 character
79
-  recommendations from PEP8 are not required here.
80
-* All Python code should be compliant with Python 3.4+.  At some
81
-  unforeseen date in the future, Python 2.7 support *may* be supported.
82
-* Tests should be written with nose using a procedural style. Do not use
83
-  unittest directly or write tests in an object-oriented style.
84
-* Test generators make more dots and the dots must flow!
85
-
86
-You can easily check for style issues, including some outright bugs such
87
-as mispelled variable names, using pylint. If you're using Anaconda you'll
88
-need to run "conda install pylint" once. You can easily run pylint on
89
-the edited files in your uncommited git change::
90
-
91
-    $ pylint $(git status -s | awk '/\.py$$/ { print $$2 }' | sort)
92
-
93
-If you want to lint the entire code base run::
94
-
95
-    $ pylint $(find tests xonsh -name \*.py | sort)
96
-
97
-How to Test
98
-================
99
-
100
-----------------------------------
101
-Docker
102
-----------------------------------
103
-
104
-If you want to run your "work in progress version" without installing
105
-and in a fresh environment you can use Docker. If Docker is installed
106
-you just have to run this::
107
-
108
-  $ python xonsh-in-docker.py
109
-
110
-This will build and run the current state of the repository in an isolated
111
-container (it may take a while the first time you run it). There are two
112
-additionals arguments you can pass this script.
113
-
114
-* The version of python
115
-* the version of ``prompt_toolkit``
116
-
117
-Example::
118
-
119
-  $ python docker.py 3.4 0.57
120
-
121
-Ensure your cwd is the root directory of the project (i.e., the one containing the
122
-.git directory).
123
-
124
-----------------------------------
125
-Dependencies
126
-----------------------------------
127
-
128
-Prep your environment for running the tests::
129
-
130
-    $ pip install requirements-tests.txt
131
-
132
-
133
-----------------------------------
134
-Running the Tests - Basic
135
-----------------------------------
136
-
137
-Run all the tests using Nose::
138
-
139
-    $ nosetests -q
140
-
141
-Use "-q" to keep nose from outputing a dot for every test.  There are A LOT of tests
142
-and you will waste time waiting for all the dots to get pushed through stdout.
143
-
144
-----------------------------------
145
-Running the Tests - Advanced
146
-----------------------------------
147
-
148
-To perform all unit tests::
149
-
150
-    $ scripts/run_tests.xsh all
151
-
152
-If you're working on a change and haven't yet committed it you can run the
153
-tests associated with the change. This does not require that the change
154
-include the unit test module. This will execute any unit tests that are
155
-part of the change as well as the unit tests for xonsh source modules in
156
-the change::
157
-
158
-    $ scripts/run_tests.xsh
159
-
160
-If you want to run specific tests you can specify the test names to
161
-execute. For example to run test_aliases::
162
-
163
-    $ scripts/run_tests.xsh aliases
164
-
165
-The test name can be the bare test name (e.g., ``aliases``), include
166
-the ``test_`` prefix and ``.py`` suffix without the directory
167
-(e.g., ``test_aliases.py``), or the complete relative path (e.g.,
168
-``tests/test_aliases.py``). For example:
169
-
170
-Note that you can pass multiple test names in the above examples::
171
-
172
-    $ scripts/run_tests.xsh aliases environ
173
-
174
-As before, if you want to test the xonsh code that is installed on your
175
-system first cd into the `tests` directory then run the tests::
176
-
177
-    $ cd tests
178
-    $ env XONSHRC='' nosetests test_aliases.py test_environ.py
179
-
180
-Happy testing!
181
-
182
-
183
-How to Document
184
-====================
185
-Documentation takes many forms. This will guide you through the steps of
186
-successful documentation.
187
-
188
-----------
189
-Docstrings
190
-----------
191
-No matter what language you are writing in, you should always have
192
-documentation strings along with you code. This is so important that it is
193
-part of the style guide.  When writing in Python, your docstrings should be
194
-in reStructured Text using the `numpydoc`_ format.
195
-
196
-------------------------
197
-Auto-Documentation Hooks
198
-------------------------
199
-The docstrings that you have written will automatically be connected to the
200
-website, once the appropriate hooks have been setup.  At this stage, all
201
-documentation lives within xonsh's top-level ``docs`` directory.
202
-We uses the sphinx tool to manage and generate the documentation, which
203
-you can learn about from `the sphinx website <http://sphinx-doc.org/>`_.
204
-If you want to generate the documentation, first xonsh itself must be installed
205
-and then you may run the following command from the ``docs`` dir:
206
-
207
-.. code-block:: bash
208
-
209
-    ~/xonsh/docs $ make html
210
-
211
-For each new
212
-module, you will have to supply the appropriate hooks. This should be done the
213
-first time that the module appears in a pull request.  From here, call the
214
-new module ``mymod``.  The following explains how to add hooks.
215
-
216
-------------------------
217
-Python Hooks
218
-------------------------
219
-Python documentation lives in the ``docs/api`` directory.
220
-First, create a file in this directory that represents the new module called
221
-``mymod.rst``.
222
-The ``docs/api`` directory matches the structure of the ``xonsh/`` directory.
223
-So if your module is in a sub-package, you'll need to go into the sub-package's
224
-directory before creating ``mymod.rst``.
225
-The contents of this file should be as follows:
226
-
227
-**mymod.rst:**
228
-
229
-.. code-block:: rst
230
-
231
-    .. _xonsh_mymod:
232
-
233
-    =======================================
234
-    My Awesome Module -- :mod:`xonsh.mymod`
235
-    =======================================
236
-
237
-    .. currentmodule:: xonsh.mymod
238
-
239
-    .. automodule:: xonsh.mymod
240
-        :members:
241
-
242
-This will discover all of the docstrings in ``mymod`` and create the
243
-appropriate webpage. Now, you need to hook this page up to the rest of the
244
-website.
245
-
246
-Go into the ``index.rst`` file in ``docs/xonsh`` or other subdirectory and add
247
-``mymod`` to the appropriate ``toctree`` (which stands for table-of-contents
248
-tree). Note that every sub-package has its own ``index.rst`` file.
249
-
250
-
251
-Building the Website
252
-===========================
253
-
254
-Building the website/documentation requires the following dependencies:
255
-
256
-#. `Sphinx <http://sphinx-doc.org/>`_
257
-#. `Cloud Sphinx Theme <https://pythonhosted.org/cloud_sptheme/cloud_theme.html>`_
258
-
259
------------------------------------
260
-Procedure for modifying the website
261
------------------------------------
262
-The xonsh website source files are located in the ``docs`` directory.
263
-A developer first makes necessary changes, then rebuilds the website locally
264
-by executing the command::
265
-
266
-    $ make html
267
-
268
-This will generate html files for the website in the ``_build/html/`` folder.
269
-The developer may view the local changes by opening these files with their
270
-favorite browser, e.g.::
271
-
272
-    $ google-chrome _build/html/index.html
273
-
274
-Once the developer is satisfied with the changes, the changes should be
275
-committed and pull-requested per usual. Once the pull request is accepted, the
276
-developer can push their local changes directly to the website by::
277
-
278
-    $ make push-root
279
-
280
-Branches and Releases
281
-=============================
282
-Mainline xonsh development occurs on the ``master`` branch. Other branches
283
-may be used for feature development (topical branches) or to represent
284
-past and upcoming releases.
285
-
286
-All releases should have a release candidate ('-rc1') that comes out 2 - 5 days
287
-prior to the scheduled release.  During this time, no changes should occur to
288
-a special release branch ('vX.X.X-release').
289
-
290
-The release branch is there so that development can continue on the
291
-develop branch while the release candidates (rc) are out and under review.
292
-This is because otherwise any new developments would have to wait until
293
-post-release to be merged into develop to prevent them from accidentally
294
-getting released early.
295
-
296
-As such, the 'vX.X.X-release' branch should only exist while there are
297
-release candidates out.  They are akin to a temporary second level of staging,
298
-and so everything that is in this branch should also be part of master.
299
-
300
-Every time a new release candidate comes out the vX.X.X-release should be
301
-tagged with the name 'X.X.X-rcX'.  There should be a 2 - 5 day period of time
302
-in between release candidates.  When the full and final release happens, the
303
-'vX.X.X-release' branch is merged into master and then deleted.
304
-
305
-If you have a new fix that needs to be in the next release candidate, you
306
-should make a topical branch and then pull request it into the release branch.
307
-After this has been accepted, the topical branch should be merged with
308
-master as well.
309
-
310
-The release branch must be quiet and untouched for 2 - 5 days prior to the
311
-full release.
312
-
313
-The release candidate procedure here only applies to major and minor releases.
314
-Micro releases may be pushed and released directly without having a release
315
-candidate.
316
-
317
-------------------
318
-Checklist
319
-------------------
320
-When releasing xonsh, make sure to do the following items in order:
321
-
322
-1. Review **ALL** issues in the issue tracker, reassigning or closing them as
323
-   needed.
324
-2. Ensure that all issues in this release's milestone have been closed. Moving issues
325
-   to the next release's milestone is a perfectly valid strategy for
326
-   completing this milestone.
327
-3. Perform maintenance tasks for this project, see below.
328
-4. Write and commit the release notes.
329
-5. Review the current state of documentation and make appropriate updates.
330
-6. Bump the version (in code, documentation, etc.) and commit the change.
331
-7. If this is a release candidate, tag the release branch with a name that
332
-   matches that of the release:
333
-
334
-   * If this is the first release candidate, create a release branch called
335
-     'vX.X.X-release' off of develop.  Tag this branch with the name
336
-     'X.X.X-rc1'.
337
-   * If this is the second or later release candidate, tag the release branch
338
-     with the name 'X.X.X-rcX'.
339
-
340
-8. If this is the full and final release (and not a release candidate),
341
-   merge the release branch into the master branch.  Next, tag the master
342
-   branch with the name 'X.X.X'. Finally, delete the release branch.
343
-9. Push the tags upstream
344
-10. Update release information on the website.
345
-
346
---------------------
347
-Maintenance Tasks
348
---------------------
349
-You can cleanup your local repository of transient files such as \*.pyc files
350
-created by unit testing by running::
351
-
352
-    $ rm -f xonsh/lexer_table.py xonsh/parser_table.py
353
-    $ rm -f xonsh/lexer_test_table.py xonsh/parser_test_table.py
354
-    $ rm -f xonsh/*.pyc tests/*.pyc
355
-    $ rm -f xonsh/*.rej tests/*.rej
356
-    $rm -fr build
357
-
358
------------------------
359
-Performing the Release
360
------------------------
361
-To perform the release, run these commands for the following tasks:
362
-
363
-**pip upload:**
364
-
365
-.. code-block:: bash
366
-
367
-    $ ./setup.py sdist upload
368
-
369
-
370
-**conda upload:**
371
-
372
-.. code-block:: bash
373
-
374
-    $ rm -f /path/to/conda/conda-bld/src_cache/xonsh.tar.gz
375
-    $ conda build --no-test recipe
376
-    $ conda convert -p all -o /path/to/conda/conda-bld /path/to/conda/conda-bld/linux-64/xonsh-X.X.X-0.tar.bz2
377
-    $ binstar upload /path/to/conda/conda-bld/*/xonsh-X.X.X*.tar.bz2
378
-
379
-**website:**
380
-
381
-.. code-block:: bash
382
-
383
-    $ cd docs
384
-    $ make clean html push-root
385
-
386
-
387
-Document History
388
-===================
389
-Portions of this page have been forked from the PyNE documentation,
390
-Copyright 2011-2015, the PyNE Development Team. All rights reserved.
391
-
392
-.. _PEP8: https://www.python.org/dev/peps/pep-0008/
393
-.. _numpydoc: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt

+ 0
- 1
MANIFEST.in View File

@@ -1 +0,0 @@
1
-include logo.txt

+ 0
- 28
README.rst View File

@@ -1,28 +0,0 @@
1
-xonsh
2
-=====
3
-
4
-.. image:: https://badges.gitter.im/scopatz/xonsh.svg
5
-   :alt: Join the chat at https://gitter.im/scopatz/xonsh
6
-   :target: https://gitter.im/scopatz/xonsh?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
7
-
8
-.. image:: https://travis-ci.org/xonsh/xonsh.svg?branch=master
9
-    :target: https://travis-ci.org/xonsh/xonsh
10
-
11
-.. image:: https://ci.appveyor.com/api/projects/status/ufqtigii8ma3rctt/branch/master?svg=true
12
-    :target: https://ci.appveyor.com/project/rbrewer123/xonsh-unq93
13
-
14
-.. image:: https://landscape.io/github/scopatz/xonsh/master/landscape.svg?style=flat
15
-    :target: https://landscape.io/github/scopatz/xonsh/master
16
-    :alt: Code Health
17
-
18
-xonsh is a Python-ish, BASHwards-looking shell language and command prompt.
19
-The language is a superset of Python 3.4+ with additional shell primitives.
20
-xonsh (pronounced *conch*) is meant for the daily use of experts and novices 
21
-alike.
22
-
23
-Please visit http://xon.sh for more information.
24
-
25
-Projects that use xonsh
26
-***********************
27
-
28
-- `gitsome <https://github.com/donnemartin/gitsome>`_: A supercharged Git/shell autocompleter with GitHub integration.

+ 0
- 1
appveyor.yml View File

@@ -1 +0,0 @@
1
-.appveyor.yml

+ 0
- 1
binstar.yml View File

@@ -1 +0,0 @@
1
-.binstar.yml

+ 0
- 9
codecov.yml View File

@@ -1,9 +0,0 @@
1
-coverage:
2
-  status:
3
-    project:
4
-      default:
5
-        target: auto
6
-        threshold: 10
7
-    patch:
8
-      default:
9
-        target: 0%

+ 0
- 37
logo.txt View File

@@ -1,37 +0,0 @@
1
-                           ╓██▄
2
-                          ╙██▀██╕
3
-                         ▐██4Φ█▀█▌
4
-                       ²██▄███▀██^██
5
-                     -███╩▀ " ╒▄█████▀█
6
-                      ║██▀▀W╤▄▀ ▐║█╘ ╝█
7
-                 ▄m▀%Φ▀▀  ╝*"    ,α█████▓▄,▄▀Γ"▀╕
8
-                 "▀██¼"     ▄═╦█╟║█▀ ╓ `^`   ,▄ ╢╕
9
-                  ,▀╫M█▐j╓╟▀ ╔▓▄█▀  '║ ╔    ╣║▌  ▀▄
10
-               ▄m▀▀███╬█╝▀  █▀^      "ÜM  j▐╟╫╨▒   ╙▀≡═╤═m▀╗
11
-               █æsæ╓  ╕, ,▄Ä   ▐'╕H   LU  ║║╠╫Å^2=⌐         █
12
-            ▄æ%Å███╠█ª╙▄█▀      $1╙       ║║╟╫╩*T▄           ▌
13
-           ╙╗%▄,╦██▌█▌█╢M         ╕      M║║║║█═⌐ⁿ"^         ╫
14
-             ╙╣▀████@█░█    ▌╕╕   `      ▌║▐▐║█D═≈⌐¬ⁿ      s ║⌐
15
-               ╙╬███▓║█`     ▌╚     ╕   ╕▌║▐▐╣▌⌐*▒▒Dù`       ▐▌
16
-                ╙╬██╨U█      ╟      $ ▌ ▌▌▐▐▐M█▄═≤⌐%       ╓⌐ ▌
17
-                 ║║█▄▌║             ╟ ▌ ▌M▐▐▐M█▀▒▒▒22,       ▐▌
18
-                  ███╙^▌            ║ ▌ ⌐M▐▐▐M█≤⌐⌐¬──        ▐M
19
-                  ║██ ▌╙   ╓       H║ ▌╒ M║▐▐M█"^^^^^"ⁿ      ║
20
-                   ██╕╙@▓   ╕      ▌║ H'  ║▐▐▐█══=.,,,       █
21
-                   ╙█▓╔╚╚█     ╠   ▌└╒ ▌▐ ╚║║║▀****ⁿ -      ╓▌
22
-                    ╙█▌¼V╚▌   ▌  ╕ ▌ ║╒ ║ ▌▒╠█▀≤≤≤≤≤⌐       █
23
-                     ╙█▌╔█╚▌     ┘ M ▌║ ╫ UUM██J^^"        ▐▌
24
-                      ╙██╙█╙▌  ╕$j  ▐⌐▌ ▌║╝╟█Å%%%≈═        █
25
-                       ╙╣█╣█^▌ ╠║▐  ║ ▌▐.DU██^[""ⁿ       -╒▌
26
-                         ▀█▄█`▌ ░M▀ ▌▐ Å£╝╝█╜%≈═╓""w   ⁿ⌐ █
27
-                          `▀▄▀`▌ ▌█▐⌐║▐UW╖██%≤═░*─    =z ▄Γ
28
-                            ╙██╙▄▌█  ▌Å╛╣██╨%╤ƒⁿ=    -` ▄┘
29
-                              █▌╢▓▌▌ W £6█╤,"ⁿ `   ▄≡▀▀▀
30
-                               █"█▌▌╟Å╓█╓█▀%`    ▄▀
31
-                               ╙▌██`▒U▓U█%╗*     █
32
-                                ▌╫║ ▌ÅÅ║▀╛¬`      `"█
33
-                                ▌╫  ╫╟ █▄     ~╦%▒╥4^
34
-                                ▌▌  "M█ `▀╕ X╕"╗▄▀^
35
-                                █▌   ╓M   ╙▀e▀▀^
36
-                                ╙██▄▄▀
37
-                                  ^^

+ 0
- 68
news/035.rst View File

@@ -1,68 +0,0 @@
1
-**Added:**
2
-
3
-* Tab completers can now raise ``StopIteration`` to prevent consideration of
4
-  remaining completers.
5
-* Added tab completer for the ``completer`` alias.
6
-* New ``Block`` and ``Functor`` context managers are now available as
7
-  part of the ``xonsh.contexts`` module.
8
-* ``Block`` provides support for turning a context body into a non-executing
9
-  list of string lines. This is implmement via a syntax tree transformation.
10
-  This is useful for creating remote execution tools that seek to prevent
11
-  local execution.
12
-* ``Functor`` is a subclass of the ``Block`` context manager that turns the
13
-  block into a callable object.  The function object is available via the
14
-  ``func()`` attribute.  However, the ``Functor`` instance is itself callable
15
-  and will dispatch to ``func()``.
16
-* New ``$VC_BRANCH_TIMEOUT`` environment variable is the time (in seconds)
17
-  of how long to spend attempting each individual version control branch
18
-  information command during ``$PROMPT`` formatting.  This allows for faster
19
-  prompt resolution and faster startup times.
20
-* New lazy methods added to CommandsCache allowing for testing and inspection
21
-  without the possibility of recomputing the cache.
22
-* ``!(command)`` is now usefully iterable, yielding lines of stdout
23
-* Added XonshCalledProcessError, which includes the relevant CompletedCommand.
24
-  Also handles differences between Py3.4 and 3.5 in CalledProcessError
25
-* Tab completion of paths now includes zsh-style path expansion (subsequence
26
-  matching), toggleable with ``$SUBSEQUENCE_PATH_COMPLETION``
27
-* Tab completion of paths now includes "fuzzy" matches that are accurate to
28
-  within a few characters, toggleable with ``$FUZZY_PATH_COMPLETION``
29
-* Provide ``$XONSH_SOURCE`` for scripts in the environment variables pointing to
30
-  the currently running script's path
31
-* Arguments '+' and '-' for the ``fg`` command (job control)
32
-* Provide ``$XONSH_SOURCE`` for scripts in the environment variables pointing to
33
-  the currently running script's path
34
-* ``!(command)`` is now usefully iterable, yielding lines of stdout
35
-* Added XonshCalledProcessError, which includes the relevant CompletedCommand.
36
-  Also handles differences between Py3.4 and 3.5 in CalledProcessError
37
-* XonshError and XonshCalledProcessError are now in builtins
38
-
39
-**Changed:**
40
-
41
-* Functions in ``Execer`` now take ``transform`` kwarg instead of
42
-  ``wrap_subproc``.
43
-* Provide ``$XONSH_SOURCE`` for scripts in the environment variables pointing to
44
-  the currently running script's path
45
-* XonshError and XonshCalledProcessError are now in builtins
46
-
47
-**Deprecated:** None
48
-
49
-
50
-**Removed:**
51
-
52
-* ``ensure_git()`` and ``ensure_hg()`` decorators removed.
53
-* ``call_hg_command()`` function removed.
54
-
55
-
56
-**Fixed:**
57
-
58
-* Strip leading space in commands passed using the "-c" switch
59
-* Fixed xonfig wizard failing on Windows due to colon in created filename.
60
-* Ensured that the prompt_toolkit shell functions, even without a ``completer``
61
-  attribute.
62
-* Fixed crash resulting from malformed ``$PROMPT`` or ``$TITLE``.
63
-* xonsh no longer backgrounds itself after every command on Cygwin.
64
-* Fixed an issue about ``os.killpg()`` on Cygwin which caused xonsh to crash
65
-  occasionally
66
-* Fix crash on startup when Bash Windows Subsystem for Linux is on the Path.
67
-
68
-**Security:** None

+ 0
- 11
news/TEMPLATE.rst View File

@@ -1,11 +0,0 @@
1
-**Added:** None
2
-
3
-**Changed:** None
4
-
5
-**Deprecated:** None
6
-
7
-**Removed:** None
8
-
9
-**Fixed:** None
10
-
11
-**Security:** None

+ 0
- 15
news/adqm-anon_aliases.rst View File

@@ -1,15 +0,0 @@
1
-**Added:** None
2
-
3
-**Changed:**
4
-
5
-* ``@()`` now passes through functions as well as strings, which allows for the
6
-  use of anonymous aliases and aliases not explicitly added to the ``aliases``
7
-  mapping.
8
-
9
-**Deprecated:** None
10
-
11
-**Removed:** None
12
-
13
-**Fixed:** None
14
-
15
-**Security:** None

+ 0
- 15
news/adqm-more_search.rst View File

@@ -1,15 +0,0 @@
1
-**Added:**
2
-
3
-* Normal globbing is now available in Python mode via ``g````
4
-* Backticks were expanded to allow searching using arbitrary functions, via
5
-  ``@<func>````
6
-
7
-**Changed:** None
8
-
9
-**Deprecated:** None
10
-
11
-**Removed:** None
12
-
13
-**Fixed:** None
14
-
15
-**Security:** None

+ 0
- 14
news/clean-up-premain.rst View File

@@ -1,14 +0,0 @@
1
-**Added:** None
2
-
3
-**Changed:**
4
-
5
-* Cleaned up argument parsing in ``xonsh.main.premain`` by removing the
6
-  ``undo_args`` hack.
7
-
8
-**Deprecated:** None
9
-
10
-**Removed:** None
11
-
12
-**Fixed:** None
13
-
14
-**Security:** None

+ 0
- 13
news/completer_list_bugs.rst View File

@@ -1,13 +0,0 @@
1
-**Added:** None
2
-
3
-**Changed:** None
4
-
5
-**Deprecated:** None
6
-
7
-**Removed:** None
8
-
9
-**Fixed:** None
10
-* Fixed ``_list_completers`` such that it does not throw a ValueError if no completer is registered.
11
-* Fixed ``_list_completers`` such that it does not throw an AttributeError if a completer has no docstring.
12
-
13
-**Security:** None

+ 0
- 14
news/fix_pipeline.rst View File

@@ -1,14 +0,0 @@
1
-**Added:** None
2
-
3
-**Changed:** None
4
-
5
-**Deprecated:** None
6
-
7
-**Removed:** None
8
-
9
-**Fixed:**
10
-
11
-* Fixed issue where input was directed to the last process in a pipeline,
12
-  rather than the first.
13
-
14
-**Security:** None

+ 0
- 13
news/fix_xonfig.rst View File

@@ -1,13 +0,0 @@
1
-**Added:** None
2
-
3
-**Changed:** None
4
-
5
-**Deprecated:** None
6
-
7
-**Removed:** None
8
-
9
-**Fixed:**
10
-
11
-* Bug where xonfig wizard can't find ENV docs
12
-
13
-**Security:** None

+ 0
- 13
news/path_tuple.rst View File

@@ -1,13 +0,0 @@
1
-**Added:** None
2
-
3
-**Changed:** None
4
-
5
-**Deprecated:** None
6
-
7
-**Removed:** None
8
-
9
-**Fixed:**
10
-
11
-* Fixed ``xonsh.environ.locate_binary()`` to handle PATH variable are given as a tuple. 
12
-
13
-**Security:** None

+ 0
- 15
news/replace_prompt.rst View File

@@ -1,15 +0,0 @@
1
-**Added:** None
2
-
3
-**Changed:** 
4
-
5
-* On Windows the ``PROMPT`` environment variable is reset to `$P$G` before starting
6
-  subprocesses. This prevents the unformatted xonsh ``PROMPT`` tempalte from showing up 
7
-  when running batch files with ``ECHO ON```  
8
-
9
-**Deprecated:** None
10
-
11
-**Removed:** None
12
-
13
-**Fixed:** None
14
-
15
-**Security:** None

+ 0
- 22
news/rmbash.rst View File

@@ -1,22 +0,0 @@
1
-**Added:**
2
-
3
-* ``xonsh.platform`` now has a new ``PATH_DEFAULT`` variable.
4
-
5
-**Changed:**
6
-
7
-* ``Env`` now guarantees that the ``$PATH`` is available and mutable when
8
-  initialized.
9
-
10
-**Deprecated:** None
11
-
12
-**Removed:**
13
-
14
-* Bash is no longer loaded by default as a foreign shell for initial
15
-  configuration. This was done to increase stock startup times. This
16
-  behaviour can be recovered by adding ``{"shell": "bash"}`` to your
17
-  ``"foreign_shells"`` in your config.json file. For more details,
18
-  see http://xon.sh/xonshconfig.html#foreign-shells
19
-
20
-**Fixed:** None
21
-
22
-**Security:** None

+ 0
- 14
news/simplify_env_repr.rst View File

@@ -1,14 +0,0 @@
1
-**Added:** None
2
-
3
-**Changed:** 
4
-
5
-* ``__repr__`` on the environment only shows a short representation of the 
6
-  object instead of printing the whole environment dictionary
7
-
8
-**Deprecated:** None
9
-
10
-**Removed:** None
11
-
12
-**Fixed:** None
13
-
14
-**Security:** None

+ 0
- 14
news/source_cmd_prompt.rst View File

@@ -1,14 +0,0 @@
1
-**Added:** None
2
-
3
-**Changed:**
4
-
5
-* On Windows the ``PROMPT`` environment variable is reset to `$P$G` before
6
-  sourcing *.bat files.
7
-
8
-**Deprecated:** None
9
-
10
-**Removed:** None
11
-
12
-**Fixed:** None
13
-
14
-**Security:** None

+ 0
- 14
news/vi_mode_change.rst View File

@@ -1,14 +0,0 @@
1
-**Added:** None
2
-
3
-**Changed:**
4
-
5
-* In ``VI_MODE``, the ``v`` key will enter character selection mode, not open
6
-  the editor.  ``Ctrl-X Ctrl-E`` will still open an editor in any mode
7
-
8
-**Deprecated:** None
9
-
10
-**Removed:** None
11
-
12
-**Fixed:** None
13
-
14
-**Security:** None

+ 0
- 36
recipe/meta.yaml View File

@@ -1,36 +0,0 @@
1
-package:
2
-  name: xonsh
3
-  version: {{ environ.get('GIT_DESCRIBE_TAG', '0.0.0') }}
4
-
5
-source:
6
-   git_url: ../
7
-
8
-build:
9
-  script: python setup.py install --single-version-externally-managed --record=record.txt
10
-  number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
11
-  skip: True  # [py2k]
12
-  entry_points:
13
-    - xonsh = xonsh.main:main
14
-
15
-requirements:
16
-  build:
17
-    - python
18
-    - ply
19
-    - setuptools
20
-    - jupyter
21
-  run:
22
-    - python
23
-    - ply
24
-    - prompt_toolkit
25
-    - setproctitle
26
-    - pygments
27
-
28
-app:
29
-  entry: xonsh
30
-  icon: ../docs/_static/ascii_conch_part_color.png
31
-
32
-about:
33
-  home: http://xon.sh/
34
-  license: BSD
35
-  summary: xonsh is a Python-ish, BASHwards-facing shell.
36
-

BIN
recipe/xonsh.ico View File


+ 0
- 11
recipe/xonsh_shortcut.json View File

@@ -1,11 +0,0 @@
1
-{
2
-    "menu_name": "Anaconda${PY_VER} ${PLATFORM}",
3
-    "menu_items":
4
-    [
5
-        {
6
-            "name": "xonsh",
7
-            "pyscript": "${PYTHON_SCRIPTS}/xonsh-script.py",
8
-            "icon": "${MENU_DIR}/xonsh.ico"
9
-        }
10
-    ]
11
-}

+ 0
- 159
release.xsh View File

@@ -1,159 +0,0 @@
1
-#!/usr/bin/env xonsh
2
-"""Release helper script for xonsh."""
3
-import os
4
-import re
5
-import sys
6
-from argparse import ArgumentParser, Action
7
-
8
-def replace_in_file(pattern, new, fname):
9
-    """Replaces a given pattern in a file"""
10
-    with open(fname, 'r') as f:
11
-        raw = f.read()
12
-    lines = raw.splitlines()
13
-    ptn = re.compile(pattern)
14
-    for i, line in enumerate(lines):
15
-        if ptn.match(line):
16
-            lines[i] = new
17
-    upd = '\n'.join(lines) + '\n'
18
-    with open(fname, 'w') as f:
19
-        f.write(upd)
20
-
21
-
22
-NEWS = [os.path.join('news', f) for f in os.listdir('news')
23
-        if f != 'TEMPLATE.rst']
24
-NEWS_CATEGORIES = ['Added', 'Changed', 'Deprecated', 'Removed', 'Fixed',
25
-                   'Security']
26
-NEWS_RE = re.compile('\*\*({0}):\*\*'.format('|'.join(NEWS_CATEGORIES)),
27
-                     flags=re.DOTALL)
28
-
29
-def merge_news():
30
-    """Reads news files and merges them."""
31
-    cats = {c: '' for c in NEWS_CATEGORIES}
32
-    for news in NEWS:
33
-        with open(news) as f:
34
-            raw = f.read()
35
-        raw = raw.strip()
36
-        parts = NEWS_RE.split(raw)
37
-        while len(parts) > 0 and parts[0] not in NEWS_CATEGORIES:
38
-            parts = parts[1:]
39
-        for key, val in zip(parts[::2], parts[1::2]):
40
-            val = val.strip()
41
-            if val == 'None':
42
-                continue
43
-            cats[key] += val + '\n'
44
-    for news in NEWS:
45
-        os.remove(news)
46
-    s = ''
47
-    for c in NEWS_CATEGORIES:
48
-        val = cats[c]
49
-        if len(val) == 0:
50
-            continue
51
-        s += '**' + c + ':**\n\n' + val + '\n\n'
52
-    return s
53
-
54
-def version_update(ver):
55
-    """Updates version strings in relevant files."""
56
-    fnews = ('.. current developments\n\n'
57
-             'v{0}\n'
58
-             '====================\n\n'
59
-             '{1}')
60
-    news = merge_news()
61
-    news = fnews.format(ver, news)
62
-    pnfs = [
63
-        ('__version__\s*=.*', "__version__ = '{0}'".format(ver),
64
-         ['xonsh', '__init__.py']),
65
-        ('version:\s*', 'version: {0}.{{build}}'.format(ver), ['.appveyor.yml']),
66
-        ('.. current developments', news, ['CHANGELOG.rst']),
67
-      ]
68
-    for p, n, f in pnfs:
69
-        replace_in_file(p, n, os.path.join(*f))
70
-
71
-
72
-def just_do_git(ns):
73
-    """Commits and updates tags."""
74
-    git status
75
-    git commit -am @("version bump to " + ns.ver)
76
-    git push @(ns.upstream) @(ns.branch)
77
-    git tag @(ns.ver)
78
-    git push --tags @(ns.upstream)
79
-
80
-
81
-def pipify():
82
-    """Make and upload pip package."""
83
-    ./setup.py sdist upload
84
-
85
-
86
-def condaify(ver):
87
-    """Make and upload conda packages."""
88
-    conda_dir = os.path.dirname(os.path.dirname($(which conda)))
89
-    conda_bld = os.path.join(conda_dir, 'conda-bld')
90
-    rm -f @(os.path.join(conda_bld, 'src_cache', 'xonsh.tar.gz'))
91
-    conda build --no-test recipe
92
-    pkgpath = os.path.join(conda_bld, '*', 'xonsh-{0}*.tar.bz2'.format(ver))
93
-    pkg = __xonsh_glob__(pkgpath)[0]
94
-    conda convert -p all -o @(conda_bld) @(pkg)
95
-    anaconda upload -u xonsh @(__xonsh_glob__(pkgpath))
96
-
97
-def docser():
98
-    """Create docs"""
99
-    # FIXME this should be made more general
100
-    ./setup.py install --user
101
-    cd docs
102
-    make clean html push-root
103
-    cd ..
104
-
105
-
106
-DOERS = ('do_version_bump', 'do_git', 'do_pip', 'do_conda', 'do_docs')
107
-
108
-class OnlyAction(Action):
109
-    def __init__(self, option_strings, dest, **kwargs):
110
-        super().__init__(option_strings, dest, **kwargs)
111
-
112
-    def __call__(self, parser, namespace, values, option_string=None):
113
-        for doer in DOERS:
114
-            if doer == self.dest:
115
-                setattr(namespace, doer, True)
116
-            else:
117
-                setattr(namespace, doer, False)
118
-
119
-
120
-def main(args=None):
121
-    parser = ArgumentParser('release')
122
-    parser.add_argument('--upstream',
123
-                        default='git@github.com:scopatz/xonsh.git',
124
-                        help='upstream repo')
125
-    parser.add_argument('-b', '--branch', default='master',
126
-                         help='branch to commit / push to.')
127
-    for doer in DOERS:
128
-        base = doer[3:].replace('_', '-')
129
-        parser.add_argument('--do-' + base, dest=doer, default=True,
130
-                            action='store_true',
131
-                            help='runs ' + base)
132
-        parser.add_argument('--no-' + base, dest=doer, action='store_false',
133
-                            help='does not run ' + base)
134
-        parser.add_argument('--only-' + base, dest=doer, action=OnlyAction,
135
-                            help='only runs ' + base, nargs=0)
136
-    parser.add_argument('ver', help='target version string')
137
-    ns = parser.parse_args(args or $ARGS[1:])
138
-
139
-    # enable debugging
140
-    $RAISE_SUBPROC_ERROR = True
141
-    trace on
142
-
143
-    # run commands
144
-    if ns.do_version_bump:
145
-        version_update(ns.ver)
146
-    if ns.do_git:
147
-        just_do_git(ns)
148
-    if ns.do_pip:
149
-        pipify()
150
-    if ns.do_conda:
151
-        condaify(ns.ver)
152
-    if ns.do_docs:
153
-        docser()
154
-
155
-    # disable debugging
156
-    trace off
157
-
158
-if __name__ == '__main__':
159
-    main()

+ 0
- 3
requirements-docs.txt View File

@@ -1,3 +0,0 @@
1
-cloud_sptheme
2
-numpydoc==0.5
3
-Sphinx

+ 0
- 6
requirements-tests.txt View File

@@ -1,6 +0,0 @@
1
-ply
2
-nose
3
-prompt-toolkit
4
-pygments
5
-coverage
6
-codecov

+ 0
- 5
tests/bashrc.sh View File

@@ -1,5 +0,0 @@
1
-export EMERALD="SWORD"
2
-alias ll='ls -a -lF'
3
-alias la='ls -A'
4
-export MIGHTY=WARRIOR
5
-alias l='ls -CF'

+ 0
- 3
tests/batch.bat View File

@@ -1,3 +0,0 @@
1
-echo on
2
-set ENV_TO_BE_ADDED=Hallo world
3
-set ENV_TO_BE_REMOVED=

+ 0
- 12
tests/histories/echo.json View File

@@ -1,12 +0,0 @@
1
-{"locs": [        69,       3707,       3787,       3435],
2
- "index": {"offsets": {"__total__": 0, "cmds": [{"__total__": 10, "inp": 18, "out": 52, "rtn": 83, "ts": [93, 113, 92]}, {"__total__": 137, "inp": 145, "rtn": 161, "ts": [171, 191, 170]}, 9], "env": {"BASH_COMPLETIONS": 245, "CASE_SENSITIVE_COMPLETIONS": 342, "CLUTTER_IM_MODULE": 368, "COLORTERM": 388, "CROSS_SECTIONS": 424, "DATAPATH": 489, "DBUS_SESSION_BUS_ADDRESS": 548, "DEFAULTS_PATH": 641, "DESKTOP_SESSION": 707, "DISPLAY": 735, "EDITOR": 751, "GDMSESSION": 771, "GDM_LANG": 800, "GIO_LAUNCHED_DESKTOP_FILE": 838, "GIO_LAUNCHED_DESKTOP_FILE_PID": 914, "GNOME_DESKTOP_SESSION_ID": 950, "GTEST_COLOR": 976, "GTK_IM_MODULE": 1000, "GTK_MODULES": 1023, "HOME": 1052, "INDENT": 1079, "LANG": 1095, "LANGUAGE": 1122, "LC_COLLATE": 1145, "LC_CTYPE": 1162, "LC_MESSAGES": 1192, "LC_MONETARY": 1212, "LC_NUMERIC": 1231, "LC_TIME": 1247, "LD_LIBRARY_PATH": 1271, "LESS": 1308, "LESSOPEN": 1328, "LOGNAME": 1398, "LSCUTOFF": 1421, "MANDATORY_PATH": 1446, "MULTILINE_PROMPT": 1515, "ORBIT_SOCKETDIR": 1539, "PATH": 1569, "PROMPT": 1751, "PWD": 1859, "QT4_IM_MODULE": 1893, "QT_IM_MODULE": 1916, "QT_QPA_PLATFORMTHEME": 1948, "SESSION_MANAGER": 1982, "SHELL": 2064, "SHELL_TYPE": 2091, "SHLVL": 2112, "SSH_AGENT_PID": 2134, "SSH_AUTH_SOCK": 2159, "TERM": 2203, "TERMINATOR_UUID": 2231, "TITLE": 2289, "USER": 2333, "WINDOWID": 2356, "XAUTHORITY": 2382, "XDG_CONFIG_DIRS": 2430, "XDG_CURRENT_DESKTOP": 2492, "XDG_DATA_DIRS": 2526, "XDG_GREETER_DATA_DIR": 2625, "XDG_MENU_PREFIX": 2677, "XDG_RUNTIME_DIR": 2706, "XDG_SEAT": 2736, "XDG_SEAT_PATH": 2762, "XDG_SESSION_DESKTOP": 2826, "XDG_SESSION_ID": 2861, "XDG_SESSION_PATH": 2887, "XDG_SESSION_TYPE": 2951, "XDG_VTNR": 2970, "XMODIFIERS": 2989, "XONSHRC": 3012, "XONSH_CONFIG_DIR": 3058, "XONSH_DATA_DIR": 3107, "XONSH_HISTORY_FILE": 3165, "XONSH_HISTORY_SIZE": 3224, "XONSH_STORE_STDOUT": 3263, "XONSH_VERSION": 3284, "_": 3298, "__total__": 224}, "locked": 3326, "sessionid": 3346, "ts": [3393, 3413, 3392]}, "sizes": {"__total__": 3435, "cmds": [{"__total__": 125, "inp": 25, "out": 22, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 76, "inp": 7, "rtn": 1, "ts": [18, 18, 41]}, 206], "env": {"BASH_COMPLETIONS": 65, "CASE_SENSITIVE_COMPLETIONS": 3, "CLUTTER_IM_MODULE": 5, "COLORTERM": 16, "CROSS_SECTIONS": 51, "DATAPATH": 29, "DBUS_SESSION_BUS_ADDRESS": 74, "DEFAULTS_PATH": 45, "DESKTOP_SESSION": 15, "DISPLAY": 4, "EDITOR": 4, "GDMSESSION": 15, "GDM_LANG": 7, "GIO_LAUNCHED_DESKTOP_FILE": 41, "GIO_LAUNCHED_DESKTOP_FILE_PID": 6, "GNOME_DESKTOP_SESSION_ID": 9, "GTEST_COLOR": 5, "GTK_IM_MODULE": 6, "GTK_MODULES": 19, "HOME": 15, "INDENT": 6, "LANG": 13, "LANGUAGE": 7, "LC_COLLATE": 3, "LC_CTYPE": 13, "LC_MESSAGES": 3, "LC_MONETARY": 3, "LC_NUMERIC": 3, "LC_TIME": 3, "LD_LIBRARY_PATH": 27, "LESS": 6, "LESSOPEN": 57, "LOGNAME": 9, "LSCUTOFF": 5, "MANDATORY_PATH": 47, "MULTILINE_PROMPT": 3, "ORBIT_SOCKETDIR": 20, "PATH": 170, "PROMPT": 99, "PWD": 15, "QT4_IM_MODULE": 5, "QT_IM_MODULE": 6, "QT_QPA_PLATFORMTHEME": 13, "SESSION_MANAGER": 71, "SHELL": 11, "SHELL_TYPE": 10, "SHLVL": 3, "SSH_AGENT_PID": 6, "SSH_AUTH_SOCK": 34, "TERM": 7, "TERMINATOR_UUID": 47, "TITLE": 34, "USER": 9, "WINDOWID": 10, "XAUTHORITY": 27, "XDG_CONFIG_DIRS": 37, "XDG_CURRENT_DESKTOP": 15, "XDG_DATA_DIRS": 73, "XDG_GREETER_DATA_DIR": 31, "XDG_MENU_PREFIX": 8, "XDG_RUNTIME_DIR": 16, "XDG_SEAT": 7, "XDG_SEAT_PATH": 39, "XDG_SESSION_DESKTOP": 15, "XDG_SESSION_ID": 4, "XDG_SESSION_PATH": 42, "XDG_SESSION_TYPE": 5, "XDG_VTNR": 3, "XMODIFIERS": 10, "XONSHRC": 24, "XONSH_CONFIG_DIR": 29, "XONSH_DATA_DIR": 34, "XONSH_HISTORY_FILE": 35, "XONSH_HISTORY_SIZE": 15, "XONSH_STORE_STDOUT": 2, "XONSH_VERSION": 7, "_": 14, "__total__": 3090}, "locked": 5, "sessionid": 38, "ts": [18, 18, 41]}},
3
- "data": {"cmds": [{"inp": "echo and the bunnymen\n", "out": "and the bunnymen\r\n", "rtn": 0, "ts": [1440360782.5314634, 1440360782.5452716]
4
-}
5
-, {"inp": "EOF\n", "rtn": 0, "ts": [1440360785.7070692, 1440360785.7086098]
6
-}
7
-]
8
-, "env": {"BASH_COMPLETIONS": "/etc/bash_completion:/usr/share/bash-completion/completions/git", "CASE_SENSITIVE_COMPLETIONS": "1", "CLUTTER_IM_MODULE": "xim", "COLORTERM": "gnome-terminal", "CROSS_SECTIONS": "/home/scopatz/openmc/data/nndc/cross_sections.xml", "DATAPATH": "/usr/share/MCNPX/v260/Data/", "DBUS_SESSION_BUS_ADDRESS": "unix:abstract=/tmp/dbus-mN1JNeR4P5,guid=4222f88e296fedba6528ff3055d9d809", "DEFAULTS_PATH": "/usr/share/gconf/awesome-gnome.default.path", "DESKTOP_SESSION": "awesome-gnome", "DISPLAY": ":0", "EDITOR": "xo", "GDMSESSION": "awesome-gnome", "GDM_LANG": "en_US", "GIO_LAUNCHED_DESKTOP_FILE": "/usr/share/applications/awesome.desktop", "GIO_LAUNCHED_DESKTOP_FILE_PID": "1894", "GNOME_DESKTOP_SESSION_ID": "Default", "GTEST_COLOR": "yes", "GTK_IM_MODULE": "ibus", "GTK_MODULES": "overlay-scrollbar", "HOME": "/home/scopatz", "INDENT": "    ", "LANG": "en_US.UTF-8", "LANGUAGE": "en_US", "LC_COLLATE": "C", "LC_CTYPE": "en_US.UTF-8", "LC_MESSAGES": "C", "LC_MONETARY": "C", "LC_NUMERIC": "C", "LC_TIME": "C", "LD_LIBRARY_PATH": "/home/scopatz/.local/lib:", "LESS": " -R ", "LESSOPEN": "| /usr/share/source-highlight/src-hilite-lesspipe.sh %s", "LOGNAME": "scopatz", "LSCUTOFF": "100", "MANDATORY_PATH": "/usr/share/gconf/awesome-gnome.mandatory.path", "MULTILINE_PROMPT": ".", "ORBIT_SOCKETDIR": "/tmp/orbit-scopatz", "PATH": "/home/scopatz/.local/bin:/home/scopatz/sandbox/bin:/home/scopatz/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games", "PROMPT": "{BOLD_GREEN}{user}@{hostname}{BOLD_BLUE} {cwd}{branch_color}{curr_branch} {BOLD_BLUE}${NO_COLOR} ", "PWD": "/home/scopatz", "QT4_IM_MODULE": "xim", "QT_IM_MODULE": "ibus", "QT_QPA_PLATFORMTHEME": "appmenu-qt5", "SESSION_MANAGER": "local/athenaie:@/tmp/.ICE-unix/1729,unix/athenaie:/tmp/.ICE-unix/1729", "SHELL": "/bin/bash", "SHELL_TYPE": "readline", "SHLVL": "2", "SSH_AGENT_PID": "1788", "SSH_AUTH_SOCK": "/tmp/ssh-zI4rxe7ejkJG/agent.1729", "TERM": "xterm", "TERMINATOR_UUID": "urn:uuid:648fe1b7-d380-439b-bb8a-d79850a650bc", "TITLE": "{user}@{hostname}: {cwd} | xonsh", "USER": "scopatz", "WINDOWID": "67108868", "XAUTHORITY": "/home/scopatz/.Xauthority", "XDG_CONFIG_DIRS": "/etc/xdg/xdg-awesome-gnome:/etc/xdg", "XDG_CURRENT_DESKTOP": "Awesome GNOME", "XDG_DATA_DIRS": "/usr/share/awesome-gnome:/usr/share/gnome:/usr/local/share/:/usr/share/", "XDG_GREETER_DATA_DIR": "/var/lib/lightdm-data/scopatz", "XDG_MENU_PREFIX": "gnome-", "XDG_RUNTIME_DIR": "/run/user/1000", "XDG_SEAT": "seat0", "XDG_SEAT_PATH": "/org/freedesktop/DisplayManager/Seat0", "XDG_SESSION_DESKTOP": "awesome-gnome", "XDG_SESSION_ID": "c3", "XDG_SESSION_PATH": "/org/freedesktop/DisplayManager/Session0", "XDG_SESSION_TYPE": "x11", "XDG_VTNR": "7", "XMODIFIERS": "@im=ibus", "XONSHRC": "/home/scopatz/.xonshrc", "XONSH_CONFIG_DIR": "/home/scopatz/.config/xonsh", "XONSH_DATA_DIR": "/home/scopatz/.local/share/xonsh", "XONSH_HISTORY_FILE": "/home/scopatz/.xonsh_history.json", "XONSH_HISTORY_SIZE": "8128 commands", "XONSH_STORE_STDOUT": "", "XONSH_VERSION": "0.1.6", "_": "/usr/bin/env"}
9
-, "locked": false, "sessionid": "67a24a96-b389-4aab-b2b6-6a0606d2ac65", "ts": [1440360773.6575115, 1440360785.7093797]
10
-}
11
-
12
-}

+ 0
- 16
tests/histories/simple-python.json View File

@@ -1,16 +0,0 @@
1
-{"locs": [        69,       3964,       4044,       3597],
2
- "index": {"offsets": {"__total__": 0, "cmds": [{"__total__": 10, "inp": 18, "out": 51, "rtn": 75, "ts": [85, 105, 84]}, {"__total__": 128, "inp": 136, "rtn": 169, "ts": [179, 199, 178]}, {"__total__": 223, "inp": 231, "rtn": 247, "ts": [257, 277, 256]}, {"__total__": 301, "inp": 309, "rtn": 325, "ts": [335, 355, 334]}, 9], "env": {"BASH_COMPLETIONS": 408, "CASE_SENSITIVE_COMPLETIONS": 505, "CLUTTER_IM_MODULE": 531, "COLORTERM": 551, "CROSS_SECTIONS": 587, "DATAPATH": 652, "DBUS_SESSION_BUS_ADDRESS": 711, "DEFAULTS_PATH": 804, "DESKTOP_SESSION": 870, "DISPLAY": 898, "EDITOR": 914, "GDMSESSION": 934, "GDM_LANG": 963, "GIO_LAUNCHED_DESKTOP_FILE": 1001, "GIO_LAUNCHED_DESKTOP_FILE_PID": 1077, "GNOME_DESKTOP_SESSION_ID": 1113, "GTEST_COLOR": 1139, "GTK_IM_MODULE": 1163, "GTK_MODULES": 1186, "HOME": 1215, "INDENT": 1242, "LANG": 1258, "LANGUAGE": 1285, "LC_COLLATE": 1308, "LC_CTYPE": 1325, "LC_MESSAGES": 1355, "LC_MONETARY": 1375, "LC_NUMERIC": 1394, "LC_TIME": 1410, "LD_LIBRARY_PATH": 1434, "LESS": 1471, "LESSOPEN": 1491, "LOGNAME": 1561, "LSCUTOFF": 1584, "MANDATORY_PATH": 1609, "MULTILINE_PROMPT": 1678, "ORBIT_SOCKETDIR": 1702, "PATH": 1732, "PROMPT": 1914, "PWD": 2022, "QT4_IM_MODULE": 2056, "QT_IM_MODULE": 2079, "QT_QPA_PLATFORMTHEME": 2111, "SESSION_MANAGER": 2145, "SHELL": 2227, "SHELL_TYPE": 2254, "SHLVL": 2275, "SSH_AGENT_PID": 2297, "SSH_AUTH_SOCK": 2322, "TERM": 2366, "TERMINATOR_UUID": 2394, "TITLE": 2452, "USER": 2496, "WINDOWID": 2519, "XAUTHORITY": 2545, "XDG_CONFIG_DIRS": 2593, "XDG_CURRENT_DESKTOP": 2655, "XDG_DATA_DIRS": 2689, "XDG_GREETER_DATA_DIR": 2788, "XDG_MENU_PREFIX": 2840, "XDG_RUNTIME_DIR": 2869, "XDG_SEAT": 2899, "XDG_SEAT_PATH": 2925, "XDG_SESSION_DESKTOP": 2989, "XDG_SESSION_ID": 3024, "XDG_SESSION_PATH": 3050, "XDG_SESSION_TYPE": 3114, "XDG_VTNR": 3133, "XMODIFIERS": 3152, "XONSHRC": 3175, "XONSH_CONFIG_DIR": 3221, "XONSH_DATA_DIR": 3270, "XONSH_HISTORY_FILE": 3328, "XONSH_HISTORY_SIZE": 3387, "XONSH_STORE_STDOUT": 3426, "XONSH_VERSION": 3447, "_": 3461, "__total__": 387}, "locked": 3489, "sessionid": 3509, "ts": [3556, 3576, 3555]}, "sizes": {"__total__": 3597, "cmds": [{"__total__": 116, "inp": 24, "out": 15, "rtn": 1, "ts": [18, 17, 40]}, {"__total__": 93, "inp": 24, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 76, "inp": 7, "rtn": 1, "ts": [18, 18, 41]}, {"__total__": 75, "inp": 7, "rtn": 1, "ts": [18, 17, 40]}, 369], "env": {"BASH_COMPLETIONS": 65, "CASE_SENSITIVE_COMPLETIONS": 3, "CLUTTER_IM_MODULE": 5, "COLORTERM": 16, "CROSS_SECTIONS": 51, "DATAPATH": 29, "DBUS_SESSION_BUS_ADDRESS": 74, "DEFAULTS_PATH": 45, "DESKTOP_SESSION": 15, "DISPLAY": 4, "EDITOR": 4, "GDMSESSION": 15, "GDM_LANG": 7, "GIO_LAUNCHED_DESKTOP_FILE": 41, "GIO_LAUNCHED_DESKTOP_FILE_PID": 6, "GNOME_DESKTOP_SESSION_ID": 9, "GTEST_COLOR": 5, "GTK_IM_MODULE": 6, "GTK_MODULES": 19, "HOME": 15, "INDENT": 6, "LANG": 13, "LANGUAGE": 7, "LC_COLLATE": 3, "LC_CTYPE": 13, "LC_MESSAGES": 3, "LC_MONETARY": 3, "LC_NUMERIC": 3, "LC_TIME": 3, "LD_LIBRARY_PATH": 27, "LESS": 6, "LESSOPEN": 57, "LOGNAME": 9, "LSCUTOFF": 5, "MANDATORY_PATH": 47, "MULTILINE_PROMPT": 3, "ORBIT_SOCKETDIR": 20, "PATH": 170, "PROMPT": 99, "PWD": 15, "QT4_IM_MODULE": 5, "QT_IM_MODULE": 6, "QT_QPA_PLATFORMTHEME": 13, "SESSION_MANAGER": 71, "SHELL": 11, "SHELL_TYPE": 10, "SHLVL": 3, "SSH_AGENT_PID": 6, "SSH_AUTH_SOCK": 34, "TERM": 7, "TERMINATOR_UUID": 47, "TITLE": 34, "USER": 9, "WINDOWID": 10, "XAUTHORITY": 27, "XDG_CONFIG_DIRS": 37, "XDG_CURRENT_DESKTOP": 15, "XDG_DATA_DIRS": 73, "XDG_GREETER_DATA_DIR": 31, "XDG_MENU_PREFIX": 8, "XDG_RUNTIME_DIR": 16, "XDG_SEAT": 7, "XDG_SEAT_PATH": 39, "XDG_SESSION_DESKTOP": 15, "XDG_SESSION_ID": 4, "XDG_SESSION_PATH": 42, "XDG_SESSION_TYPE": 5, "XDG_VTNR": 3, "XMODIFIERS": 10, "XONSHRC": 24, "XONSH_CONFIG_DIR": 29, "XONSH_DATA_DIR": 34, "XONSH_HISTORY_FILE": 35, "XONSH_HISTORY_SIZE": 15, "XONSH_STORE_STDOUT": 2, "XONSH_VERSION": 7, "_": 14, "__total__": 3090}, "locked": 5, "sessionid": 38, "ts": [18, 17, 40]}},
3
- "data": {"cmds": [{"inp": "print('The Turtles')\n", "out": "The Turtles\n", "rtn": 0, "ts": [1440371854.0424275, 1440371854.042462]
4
-}
5
-, {"inp": "def f():\n    pass\n\n", "rtn": 0, "ts": [1440371868.8591268, 1440371868.8591323]
6
-}
7
-, {"inp": "f()\n", "rtn": 0, "ts": [1440371873.6370964, 1440371873.6371114]
8
-}
9
-, {"inp": "EOF\n", "rtn": 0, "ts": [1440371879.4418402, 1440371879.442938]
10
-}
11
-]
12
-, "env": {"BASH_COMPLETIONS": "/etc/bash_completion:/usr/share/bash-completion/completions/git", "CASE_SENSITIVE_COMPLETIONS": "1", "CLUTTER_IM_MODULE": "xim", "COLORTERM": "gnome-terminal", "CROSS_SECTIONS": "/home/scopatz/openmc/data/nndc/cross_sections.xml", "DATAPATH": "/usr/share/MCNPX/v260/Data/", "DBUS_SESSION_BUS_ADDRESS": "unix:abstract=/tmp/dbus-mN1JNeR4P5,guid=4222f88e296fedba6528ff3055d9d809", "DEFAULTS_PATH": "/usr/share/gconf/awesome-gnome.default.path", "DESKTOP_SESSION": "awesome-gnome", "DISPLAY": ":0", "EDITOR": "xo", "GDMSESSION": "awesome-gnome", "GDM_LANG": "en_US", "GIO_LAUNCHED_DESKTOP_FILE": "/usr/share/applications/awesome.desktop", "GIO_LAUNCHED_DESKTOP_FILE_PID": "1894", "GNOME_DESKTOP_SESSION_ID": "Default", "GTEST_COLOR": "yes", "GTK_IM_MODULE": "ibus", "GTK_MODULES": "overlay-scrollbar", "HOME": "/home/scopatz", "INDENT": "    ", "LANG": "en_US.UTF-8", "LANGUAGE": "en_US", "LC_COLLATE": "C", "LC_CTYPE": "en_US.UTF-8", "LC_MESSAGES": "C", "LC_MONETARY": "C", "LC_NUMERIC": "C", "LC_TIME": "C", "LD_LIBRARY_PATH": "/home/scopatz/.local/lib:", "LESS": " -R ", "LESSOPEN": "| /usr/share/source-highlight/src-hilite-lesspipe.sh %s", "LOGNAME": "scopatz", "LSCUTOFF": "100", "MANDATORY_PATH": "/usr/share/gconf/awesome-gnome.mandatory.path", "MULTILINE_PROMPT": ".", "ORBIT_SOCKETDIR": "/tmp/orbit-scopatz", "PATH": "/home/scopatz/.local/bin:/home/scopatz/sandbox/bin:/home/scopatz/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games", "PROMPT": "{BOLD_GREEN}{user}@{hostname}{BOLD_BLUE} {cwd}{branch_color}{curr_branch} {BOLD_BLUE}${NO_COLOR} ", "PWD": "/home/scopatz", "QT4_IM_MODULE": "xim", "QT_IM_MODULE": "ibus", "QT_QPA_PLATFORMTHEME": "appmenu-qt5", "SESSION_MANAGER": "local/athenaie:@/tmp/.ICE-unix/1729,unix/athenaie:/tmp/.ICE-unix/1729", "SHELL": "/bin/bash", "SHELL_TYPE": "readline", "SHLVL": "2", "SSH_AGENT_PID": "1788", "SSH_AUTH_SOCK": "/tmp/ssh-zI4rxe7ejkJG/agent.1729", "TERM": "xterm", "TERMINATOR_UUID": "urn:uuid:efa23cb0-4eed-4de0-9dbc-c9b9f2f78263", "TITLE": "{user}@{hostname}: {cwd} | xonsh", "USER": "scopatz", "WINDOWID": "67108868", "XAUTHORITY": "/home/scopatz/.Xauthority", "XDG_CONFIG_DIRS": "/etc/xdg/xdg-awesome-gnome:/etc/xdg", "XDG_CURRENT_DESKTOP": "Awesome GNOME", "XDG_DATA_DIRS": "/usr/share/awesome-gnome:/usr/share/gnome:/usr/local/share/:/usr/share/", "XDG_GREETER_DATA_DIR": "/var/lib/lightdm-data/scopatz", "XDG_MENU_PREFIX": "gnome-", "XDG_RUNTIME_DIR": "/run/user/1000", "XDG_SEAT": "seat0", "XDG_SEAT_PATH": "/org/freedesktop/DisplayManager/Seat0", "XDG_SESSION_DESKTOP": "awesome-gnome", "XDG_SESSION_ID": "c3", "XDG_SESSION_PATH": "/org/freedesktop/DisplayManager/Session0", "XDG_SESSION_TYPE": "x11", "XDG_VTNR": "7", "XMODIFIERS": "@im=ibus", "XONSHRC": "/home/scopatz/.xonshrc", "XONSH_CONFIG_DIR": "/home/scopatz/.config/xonsh", "XONSH_DATA_DIR": "/home/scopatz/.local/share/xonsh", "XONSH_HISTORY_FILE": "/home/scopatz/.xonsh_history.json", "XONSH_HISTORY_SIZE": "8128 commands", "XONSH_STORE_STDOUT": "", "XONSH_VERSION": "0.1.6", "_": "/usr/bin/env"}
13
-, "locked": false, "sessionid": "c461668b-f650-4e17-8774-2b58384a1b9c", "ts": [1440371810.6295521, 1440371879.443467]
14
-}
15
-
16
-}

BIN
tests/man1/yes.1.gz View File


+ 0
- 5
tests/sample.xsh View File

@@ -1,5 +0,0 @@
1
-# I am a test module.
2
-aliases['echo'] = lambda args, stdin=None: print(' '.join(args))
3
-
4
-$WAKKA = "jawaka"
5
-x = $(echo "hello mom" $WAKKA)

+ 0
- 140
tests/test_aliases.py View File

@@ -1,140 +0,0 @@
1
-# -*- coding: utf-8 -*-
2
-"""Testing built_ins.Aliases"""
3
-from __future__ import unicode_literals, print_function
4
-
5
-import os
6
-import tempfile
7
-
8
-import nose
9
-from nose.plugins.skip import SkipTest
10
-from nose.tools import assert_equal
11
-
12
-import xonsh.built_ins as built_ins
13
-from xonsh.aliases import Aliases
14
-from xonsh.aliases import _which
15
-from xonsh.environ import Env
16
-from xonsh.tools import ON_WINDOWS
17
-
18
-from tools import mock_xonsh_env
19
-
20
-
21
-def cd(args, stdin=None):
22
-    return args
23
-
24
-ALIASES = Aliases({'o': ['omg', 'lala']},
25
-                  color_ls=['ls', '--color=true'],
26
-                  ls="ls '-  -'",
27
-                  cd=cd,
28
-                  indirect_cd='cd ..')
29
-RAW = ALIASES._raw
30
-
31
-def test_imports():
32
-    assert_equal(RAW, {
33
-        'o': ['omg', 'lala'],
34
-        'ls': ['ls', '-  -'],
35
-        'color_ls': ['ls', '--color=true'],
36
-        'cd': cd,
37
-        'indirect_cd': ['cd', '..']
38
-    })
39
-
40
-def test_eval_normal():
41
-    with mock_xonsh_env({}):
42
-        assert_equal(ALIASES.get('o'), ['omg', 'lala'])
43
-
44
-def test_eval_self_reference():
45
-    with mock_xonsh_env({}):
46
-        assert_equal(ALIASES.get('ls'), ['ls', '-  -'])
47
-
48
-def test_eval_recursive():
49
-    with mock_xonsh_env({}):
50
-        assert_equal(ALIASES.get('color_ls'), ['ls', '-  -', '--color=true'])
51
-
52
-def test_eval_recursive_callable_partial():
53
-    if ON_WINDOWS:
54
-        raise SkipTest
55
-    built_ins.ENV = Env(HOME=os.path.expanduser('~'))
56
-    with mock_xonsh_env(built_ins.ENV):
57
-        assert_equal(ALIASES.get('indirect_cd')(['arg2', 'arg3']),
58
-                     ['..', 'arg2', 'arg3'])
59
-
60
-
61
-class TestWhich:
62
-    # Tests for the _whichgen function which is the only thing we 
63
-    # use from the _which.py module.
64
-    def setup(self):
65
-        # Setup two folders with some test files.
66
-        self.testdirs = [tempfile.TemporaryDirectory(),
67
-                         tempfile.TemporaryDirectory()]
68
-        if ON_WINDOWS:
69
-            self.testapps = ['whichtestapp1.exe',
70
-                             'whichtestapp2.wta']
71
-        else:
72
-            self.testapps = ['whichtestapp1']
73
-        for app in self.testapps:
74
-            for d in self.testdirs:
75
-                path = os.path.join(d.name, app)
76
-                open(path, 'wb').write(b'')
77
-                os.chmod(path, 0o755)
78
-
79
-    def teardown(self):
80
-        for d in self.testdirs:
81
-            d.cleanup()
82
-
83
-    def test_whichgen(self):
84
-        testdir = self.testdirs[0].name
85
-        arg = 'whichtestapp1'
86
-        matches = list(_which.whichgen(arg, path=[testdir]))
87
-        assert len(matches) == 1
88
-        assert self._file_match(matches[0][0], os.path.join(testdir, arg))
89
-
90
-    def test_whichgen_failure(self):
91
-        testdir = self.testdirs[0].name
92
-        arg = 'not_a_file'
93
-        matches = list(_which.whichgen(arg, path=[testdir]))
94
-        assert len(matches) == 0
95
-
96
-    def test_whichgen_verbose(self):
97
-        testdir = self.testdirs[0].name
98
-        arg = 'whichtestapp1'
99
-        matches = list(_which.whichgen(arg, path=[testdir], verbose=True))
100
-        assert len(matches) == 1
101
-        match, from_where = matches[0]
102
-        assert self._file_match(match, os.path.join(testdir, arg))
103
-        assert from_where == 'from given path element 0'
104
-
105
-    def test_whichgen_multiple(self):
106
-        testdir0 = self.testdirs[0].name
107
-        testdir1 = self.testdirs[1].name
108
-        arg = 'whichtestapp1'
109
-        matches = list(_which.whichgen(arg, path=[testdir0, testdir1]))
110
-        assert len(matches) == 2
111
-        assert self._file_match(matches[0][0], os.path.join(testdir0, arg))
112
-        assert self._file_match(matches[1][0], os.path.join(testdir1, arg))
113
-
114
-    if ON_WINDOWS:
115
-        def test_whichgen_ext_failure(self):
116
-            testdir = self.testdirs[0].name
117
-            arg = 'whichtestapp2'
118
-            matches = list(_which.whichgen(arg, path=[testdir]))
119
-            assert len(matches) == 0
120
-
121
-        def test_whichgen_ext_success(self):
122
-                testdir = self.testdirs[0].name
123
-                arg = 'whichtestapp2'
124
-                matches = list(_which.whichgen(arg, path=[testdir], exts = ['.wta']))
125
-                assert len(matches) == 1
126
-                assert self._file_match(matches[0][0], os.path.join(testdir, arg))
127
-
128
-    def _file_match(self, path1, path2):
129
-        if ON_WINDOWS:
130
-            path1 = os.path.normpath(os.path.normcase(path1))
131
-            path2 = os.path.normpath(os.path.normcase(path2))
132
-            path1 = os.path.splitext(path1)[0]
133
-            path2 = os.path.splitext(path2)[0]
134
-            return path1 == path2
135
-        else:
136
-            return os.path.samefile(path1, path2)
137
-
138
-
139
-if __name__ == '__main__':
140
-    nose.runmodule()

+ 0
- 34
tests/test_ast.py View File

@@ -1,34 +0,0 @@
1
-"""Xonsh AST tests."""
2
-from nose.tools import assert_equal
3
-
4
-from xonsh import ast
5
-from xonsh.ast import Tuple, Name, Store, min_line
6
-
7
-from tools import execer_setup, check_parse
8
-
9
-
10
-def setup():
11
-    execer_setup()
12
-
13
-
14
-def test_gather_names_name():
15
-    node = Name(id='y', ctx=Store())
16
-    exp = {'y'}
17
-    obs = ast.gather_names(node)
18
-    assert_equal(exp, obs)
19
-
20
-
21
-def test_gather_names_tuple():
22
-    node = Tuple(elts=[Name(id='y', ctx=Store()),
23
-                       Name(id='z', ctx=Store())])
24
-    exp = {'y', 'z'}
25
-    obs = ast.gather_names(node)
26
-    assert_equal(exp, obs)
27
-
28
-
29
-def test_multilline_num():
30
-    code = ('x = 1\n'
31
-            'ls -l\n')  # this second line wil be transformed
32
-    tree = check_parse(code)
33
-    lsnode = tree.body[1]
34
-    assert_equal(2, min_line(lsnode))

+ 0
- 118
tests/test_builtins.py View File

@@ -1,118 +0,0 @@
1
-# -*- coding: utf-8 -*-
2
-"""Tests the xonsh builtins."""
3
-from __future__ import unicode_literals, print_function
4
-import os
5
-import re
6
-
7
-import nose
8
-from nose.plugins.skip import SkipTest
9
-from nose.tools import assert_equal, assert_true, assert_not_in
10
-
11
-from xonsh import built_ins
12
-from xonsh.built_ins import reglob, pathsearch, helper, superhelper, \
13
-    ensure_list_of_strs, list_of_strs_or_callables, regexsearch, \
14
-    globsearch
15
-from xonsh.environ import Env
16
-from xonsh.tools import ON_WINDOWS
17
-
18
-from tools import mock_xonsh_env
19
-
20
-
21
-def test_reglob_tests():
22
-    testfiles = reglob('test_.*')
23
-    for f in testfiles:
24
-        assert_true(f.startswith('test_'))
25
-
26
-def test_repath_backslash():
27
-    if ON_WINDOWS:
28
-        raise SkipTest
29
-    home = os.path.expanduser('~')
30
-    built_ins.ENV = Env(HOME=home)
31
-    with mock_xonsh_env(built_ins.ENV):
32
-        exp = os.listdir(home)
33
-        exp = {p for p in exp if re.match(r'\w\w.*', p)}
34
-        exp = {os.path.join(home, p) for p in exp}
35
-        obs = set(pathsearch(regexsearch, r'~/\w\w.*'))
36
-        assert_equal(exp, obs)
37
-
38
-def test_repath_home_itself():
39
-    if ON_WINDOWS:
40
-        raise SkipTest
41
-    exp = os.path.expanduser('~')
42
-    built_ins.ENV = Env(HOME=exp)
43
-    with mock_xonsh_env(built_ins.ENV):
44
-        obs = pathsearch(regexsearch, '~')
45
-        assert_equal(1, len(obs))
46
-        assert_equal(exp, obs[0])
47
-
48
-def test_repath_home_contents():
49
-    if ON_WINDOWS:
50
-        raise SkipTest
51
-    home = os.path.expanduser('~')
52
-    built_ins.ENV = Env(HOME=home)
53
-    with mock_xonsh_env(built_ins.ENV):
54
-        exp = os.listdir(home)
55
-        exp = {os.path.join(home, p) for p in exp}
56
-        obs = set(pathsearch(regexsearch, '~/.*'))
57
-        assert_equal(exp, obs)
58
-
59
-def test_repath_home_var():
60
-    if ON_WINDOWS:
61
-        raise SkipTest
62
-    exp = os.path.expanduser('~')
63
-    built_ins.ENV = Env(HOME=exp)
64
-    with mock_xonsh_env(built_ins.ENV):
65
-        obs = pathsearch(regexsearch, '$HOME')
66
-        assert_equal(1, len(obs))
67
-        assert_equal(exp, obs[0])
68
-
69
-def test_repath_home_var_brace():
70
-    if ON_WINDOWS:
71
-        raise SkipTest
72
-    exp = os.path.expanduser('~')
73
-    built_ins.ENV = Env(HOME=exp)
74
-    with mock_xonsh_env(built_ins.ENV):
75
-        obs = pathsearch(regexsearch, '${"HOME"}')
76
-        assert_equal(1, len(obs))
77
-        assert_equal(exp, obs[0])
78
-
79
-def test_helper_int():
80
-    with mock_xonsh_env({}):
81
-        helper(int, 'int')
82
-
83
-def test_helper_helper():
84
-    with mock_xonsh_env({}):
85
-        helper(helper, 'helper')
86
-
87
-def test_helper_env():
88
-    with mock_xonsh_env({}):
89
-        helper(Env, 'Env')
90
-
91
-def test_superhelper_int():
92
-    with mock_xonsh_env({}):
93
-        superhelper(int, 'int')
94
-
95
-def test_superhelper_helper():
96
-    with mock_xonsh_env({}):
97
-        superhelper(helper, 'helper')
98
-
99
-def test_superhelper_env():
100
-    with mock_xonsh_env({}):
101
-        superhelper(Env, 'Env')
102
-
103
-def test_ensure_list_of_strs():
104
-    cases = [(['yo'], 'yo'), (['yo'], ['yo']), (['42'], 42), (['42'], [42])]
105
-    for exp, inp in cases:
106
-        obs = ensure_list_of_strs(inp)
107
-        yield assert_equal, exp, obs
108
-
109
-def test_list_of_strs_or_callables():
110
-    f = lambda x: 20
111
-    cases = [(['yo'], 'yo'), (['yo'], ['yo']), (['42'], 42), (['42'], [42]),
112
-             ([f], f), ([f], [f])]
113
-    for exp, inp in cases:
114
-        obs = list_of_strs_or_callables(inp)
115
-        yield assert_equal, exp, obs
116
-
117
-if __name__ == '__main__':
118
-    nose.runmodule()

+ 0
- 340
tests/test_contexts.py View File

@@ -1,340 +0,0 @@
1
-"""Tests xonsh contexts."""
2
-from nose.tools import assert_equal, assert_is, assert_is_not
3
-
4
-from tools import (mock_xonsh_env, execer_setup, check_exec, check_eval,
5
-    check_parse, skip_if)
6
-
7
-from xonsh.contexts import Block, Functor
8
-
9
-#
10
-# helpers
11
-#
12
-
13
-def setup():
14
-    execer_setup()
15
-
16
-
17
-X1_WITH = ('x = 1\n'
18
-           'with Block() as b:\n')
19
-SIMPLE_WITH = 'with Block() as b:\n'
20
-FUNC_WITH = ('x = 1\n'
21
-             'def func():\n'
22
-             '    y = 1\n'
23
-             '    with Block() as b:\n'
24
-             '{body}'
25
-             '    y += 1\n'
26
-             '    return b\n'
27
-             'x += 1\n'
28
-             'rtn = func()\n'
29
-             'x += 1\n')
30
-
31
-FUNC_OBSG = {'x': 3}
32
-FUNC_OBSL = {'y': 1}
33
-
34
-def block_checks_glb(name, glbs, body, obs=None):
35
-    block = glbs[name]
36
-    obs = obs or {}
37
-    for k, v in obs.items():
38
-        yield assert_equal, v, glbs[k]
39
-    if isinstance(body, str):
40
-        body = body.splitlines()
41
-    yield assert_equal, body, block.lines
42
-    yield assert_is, glbs, block.glbs
43
-    yield assert_is, None, block.locs
44
-
45
-
46
-def block_checks_func(name, glbs, body, obsg=None, obsl=None):
47
-    block = glbs[name]
48
-    obsg = obsg or {}
49
-    for k, v in obsg.items():
50
-        yield assert_equal, v, glbs[k]
51
-    if isinstance(body, str):
52
-        body = body.splitlines()
53
-    yield assert_equal, body, block.lines
54
-    yield assert_is, glbs, block.glbs
55
-    # local context tests
56
-    locs = block.locs
57
-    yield assert_is_not, None, locs
58
-    obsl = obsl or {}
59
-    for k, v in obsl.items():
60
-        yield assert_equal, v, locs[k]
61
-
62
-
63
-#
64
-# Block tests
65
-#
66
-
67
-def test_block_noexec():
68
-    s = ('x = 1\n'
69
-         'with Block():\n'
70
-         '    x += 42\n')
71
-    glbs = {'Block': Block}
72
-    check_exec(s, glbs=glbs, locs=None)
73
-    assert_equal(1, glbs['x'])
74
-
75
-
76
-def test_block_oneline():
77
-    body = '    x += 42\n'
78
-    s = X1_WITH + body
79
-    glbs = {'Block': Block}
80
-    check_exec(s, glbs=glbs, locs=None)
81
-    yield from block_checks_glb('b', glbs, body, {'x': 1})
82
-
83
-
84
-def test_block_manylines():
85
-    body = ('    ![echo wow mom]\n'
86
-            '# bad place for a comment\n'
87
-            '    x += 42')
88
-    s = X1_WITH + body
89
-    glbs = {'Block': Block}
90
-    check_exec(s, glbs=glbs, locs=None)
91
-    yield from block_checks_glb('b', glbs, body, {'x': 1})
92
-
93
-
94
-def test_block_leading_comment():
95
-    # leading comments do not show up in block lines
96
-    body = ('    # I am a leading comment\n'
97
-            '    x += 42\n')
98
-    s = X1_WITH + body
99
-    glbs = {'Block': Block}
100
-    check_exec(s, glbs=glbs, locs=None)
101
-    yield from block_checks_glb('b', glbs, ['    x += 42'], {'x': 1})
102
-
103
-
104
-def test_block_trailing_comment():
105
-    # trailing comments do not show up in block lines
106
-    body = ('    x += 42\n'
107
-            '    # I am a trailing comment\n')
108
-    s = X1_WITH + body
109
-    glbs = {'Block': Block}
110
-    check_exec(s, glbs=glbs, locs=None)
111
-    yield from block_checks_glb('b', glbs, ['    x += 42'], {'x': 1})
112
-
113
-
114
-def test_block_trailing_line_continuation():
115
-    body = ('    x += \\\n'
116
-            '         42\n')
117
-    s = X1_WITH + body
118
-    glbs = {'Block': Block}
119
-    check_exec(s, glbs=glbs, locs=None)
120
-    yield from block_checks_glb('b', glbs, body, {'x': 1})
121
-
122
-
123
-def test_block_trailing_close_paren():
124
-    body = ('    x += int("42"\n'
125
-            '             )\n')
126
-    s = X1_WITH + body
127
-    glbs = {'Block': Block}
128
-    check_exec(s, glbs=glbs, locs=None)
129
-    yield from block_checks_glb('b', glbs, body, {'x': 1})
130
-
131
-
132
-def test_block_trailing_close_many():
133
-    body = ('    x = {None: [int("42"\n'
134
-            '                    )\n'
135
-            '                ]\n'
136
-            '         }\n')
137
-    s = SIMPLE_WITH + body
138
-    glbs = {'Block': Block}
139
-    check_exec(s, glbs=glbs, locs=None)
140
-    yield from block_checks_glb('b', glbs, body)
141
-
142
-
143
-def test_block_trailing_triple_string():
144
-    body = ('    x = """This\n'
145
-            'is\n'
146
-            '"probably"\n'
147
-            '\'not\' what I meant.\n'
148
-            '"""\n')
149
-    s = SIMPLE_WITH + body
150
-    glbs = {'Block': Block}
151
-    check_exec(s, glbs=glbs, locs=None)
152
-    yield from block_checks_glb('b', glbs, body)
153
-
154
-
155
-def test_block_func_oneline():
156
-    body = '        x += 42\n'
157
-    s = FUNC_WITH.format(body=body)
158
-    glbs = {'Block': Block}
159
-    check_exec(s, glbs=glbs, locs=None)
160
-    yield from block_checks_func('rtn', glbs, body, FUNC_OBSG, FUNC_OBSL)
161
-
162
-
163
-def test_block_func_manylines():
164
-    body = ('        ![echo wow mom]\n'
165
-            '# bad place for a comment\n'
166
-            '        x += 42\n')
167
-    s = FUNC_WITH.format(body=body)
168
-    glbs = {'Block': Block}
169
-    check_exec(s, glbs=glbs, locs=None)
170
-    yield from block_checks_func('rtn', glbs, body, FUNC_OBSG, FUNC_OBSL)
171
-
172
-
173
-def test_block_func_leading_comment():
174
-    # leading comments do not show up in block lines
175
-    body = ('        # I am a leading comment\n'
176
-            '        x += 42\n')
177
-    s = FUNC_WITH.format(body=body)
178
-    glbs = {'Block': Block}
179
-    check_exec(s, glbs=glbs, locs=None)
180
-    yield from block_checks_func('rtn', glbs, '        x += 42\n',
181
-                                 FUNC_OBSG, FUNC_OBSL)
182
-
183
-
184
-def test_block_func_trailing_comment():
185
-    # trailing comments do not show up in block lines
186
-    body = ('        x += 42\n'
187
-            '        # I am a trailing comment\n')
188
-    s = FUNC_WITH.format(body=body)
189
-    glbs = {'Block': Block}
190
-    check_exec(s, glbs=glbs, locs=None)
191
-    yield from block_checks_func('rtn', glbs, '        x += 42\n',
192
-                                 FUNC_OBSG, FUNC_OBSL)
193
-
194
-
195
-def test_blockfunc__trailing_line_continuation():
196
-    body = ('        x += \\\n'
197
-            '             42\n')
198
-    s = FUNC_WITH.format(body=body)
199
-    glbs = {'Block': Block}
200
-    check_exec(s, glbs=glbs, locs=None)
201
-    yield from block_checks_func('rtn', glbs, body, FUNC_OBSG, FUNC_OBSL)
202
-
203
-
204
-def test_block_func_trailing_close_paren():
205
-    body = ('        x += int("42"\n'
206
-            '                 )\n')
207
-    s = FUNC_WITH.format(body=body)
208
-    glbs = {'Block': Block}
209
-    check_exec(s, glbs=glbs, locs=None)
210
-    yield from block_checks_func('rtn', glbs, body, FUNC_OBSG, FUNC_OBSL)
211
-
212
-
213
-def test_block_func_trailing_close_many():
214
-    body = ('        x = {None: [int("42"\n'
215
-            '                        )\n'
216
-            '                    ]\n'
217
-            '             }\n')
218
-    s = FUNC_WITH.format(body=body)
219
-    glbs = {'Block': Block}
220
-    check_exec(s, glbs=glbs, locs=None)
221
-    yield from block_checks_func('rtn', glbs, body, FUNC_OBSG, FUNC_OBSL)
222
-
223
-
224
-def test_block_func_trailing_triple_string():
225
-    body = ('        x = """This\n'
226
-            'is\n'
227
-            '"probably"\n'
228
-            '\'not\' what I meant.\n'
229
-            '"""\n')
230
-    s = FUNC_WITH.format(body=body)
231
-    glbs = {'Block': Block}
232
-    check_exec(s, glbs=glbs, locs=None)
233
-    yield from block_checks_func('rtn', glbs, body, FUNC_OBSG, FUNC_OBSL)
234
-
235
-
236
-#
237
-# Functor tests
238
-#
239
-
240
-X2_WITH = ('x = 1\n'
241
-           'with Functor() as f:\n'
242
-           '{body}'
243
-           'x += 1\n'
244
-           '{calls}\n'
245
-           )
246
-
247
-def test_functor_oneline_onecall_class():
248
-    body = ('    global x\n'
249
-            '    x += 42\n')
250
-    calls = 'f()'
251
-    s = X2_WITH.format(body=body, calls=calls)
252
-    glbs = {'Functor': Functor}
253
-    check_exec(s, glbs=glbs, locs=None)
254
-    yield from block_checks_glb('f', glbs, body, {'x': 44})
255
-
256
-
257
-def test_functor_oneline_onecall_func():
258
-    body = ('    global x\n'
259
-            '    x += 42\n')
260
-    calls = 'f.func()'
261
-    s = X2_WITH.format(body=body, calls=calls)
262
-    glbs = {'Functor': Functor}
263
-    check_exec(s, glbs=glbs, locs=None)
264
-    yield from block_checks_glb('f', glbs, body, {'x': 44})
265
-
266
-
267
-def test_functor_oneline_onecall_both():
268
-    body = ('    global x\n'
269
-            '    x += 42\n')
270
-    calls = 'f()\nf.func()'
271
-    s = X2_WITH.format(body=body, calls=calls)
272
-    glbs = {'Functor': Functor}
273
-    check_exec(s, glbs=glbs, locs=None)
274
-    yield from block_checks_glb('f', glbs, body, {'x': 86})
275
-
276
-
277
-XA_WITH = ('x = [1]\n'
278
-           'with Functor() as f:\n'
279
-           '{body}'
280
-           'x.append(2)\n'
281
-           '{calls}\n'
282
-           )
283
-
284
-def test_functor_oneline_append():
285
-    body = '    x.append(3)\n'
286
-    calls = 'f()\n'
287
-    s = XA_WITH.format(body=body, calls=calls)
288
-    glbs = {'Functor': Functor}
289
-    check_exec(s, glbs=glbs, locs=None)
290
-    yield from block_checks_glb('f', glbs, body, {'x': [1, 2, 3]})
291
-
292
-
293
-def test_functor_return():
294
-    body = '    x = 42\n'
295
-    t = ('res = 0\n'
296
-         'with Functor(rtn="x") as f:\n'
297
-         '{body}\n'
298
-         'res = f()\n')
299
-    s = t.format(body=body)
300
-    glbs = {'Functor': Functor}
301
-    check_exec(s, glbs=glbs, locs=None)
302
-    yield from block_checks_glb('f', glbs, body, {'res': 42})
303
-
304
-
305
-def test_functor_args():
306
-    body = '    x = 42 + a\n'
307
-    t = ('res = 0\n'
308
-         'with Functor(args=("a",), rtn="x") as f:\n'
309
-         '{body}\n'
310
-         'res = f(2)\n')
311
-    s = t.format(body=body)
312
-    glbs = {'Functor': Functor}
313
-    check_exec(s, glbs=glbs, locs=None)
314
-    yield from block_checks_glb('f', glbs, body, {'res': 44})
315
-
316
-
317
-def test_functor_kwargs():
318
-    body = '    x = 42 + a + b\n'
319
-    t = ('res = 0\n'
320
-         'with Functor(kwargs={{"a": 1, "b": 12}}, rtn="x") as f:\n'
321
-         '{body}\n'
322
-         'res = f(b=6)\n')
323
-    s = t.format(body=body)
324
-    glbs = {'Functor': Functor}
325
-    check_exec(s, glbs=glbs, locs=None)
326
-    yield from block_checks_glb('f', glbs, body, {'res': 49})
327
-
328
-
329
-def test_functor_fullsig():
330
-    body = '    x = 42 + a + b + c\n'
331
-    t = ('res = 0\n'
332
-         'with Functor(args=("c",), kwargs={{"a": 1, "b": 12}}, rtn="x") as f:\n'
333
-         '{body}\n'
334
-         'res = f(55)\n')
335
-    s = t.format(body=body)
336
-    glbs = {'Functor': Functor}
337
-    check_exec(s, glbs=glbs, locs=None)
338
-    yield from block_checks_glb('f', glbs, body, {'res': 110})
339
-
340
-

+ 0
- 77
tests/test_dirstack.py View File

@@ -1,77 +0,0 @@
1
-# -*- coding: utf-8 -*-
2
-"""Testing dirstack"""
3
-from __future__ import unicode_literals, print_function
4
-
5
-from contextlib import contextmanager
6
-from functools import wraps
7
-import os
8
-import builtins
9
-
10
-from nose.tools import assert_equal, assert_not_equal
11
-import nose
12
-
13
-from xonsh import dirstack
14
-from xonsh.environ import Env
15
-from xonsh.built_ins import load_builtins
16
-
17
-
18
-HERE = os.path.abspath(os.path.dirname(__file__))
19
-PARENT = os.path.dirname(HERE)
20
-
21
-@contextmanager
22
-def chdir(adir):
23
-    old_dir = os.getcwd()
24
-    os.chdir(adir)
25
-    yield
26
-    os.chdir(old_dir)
27
-
28
-@contextmanager
29
-def xonsh_env(env):
30
-    load_builtins()
31
-    old_env = builtins.__xonsh_env__
32
-    builtins.__xonsh_env__ = env
33
-    yield
34
-    builtins.__xonsh_env__ = old_env
35
-
36
-def test_simple():
37
-    load_builtins()
38
-    with xonsh_env(Env(CDPATH=PARENT, PWD=PARENT)):
39
-        with chdir(PARENT):
40
-            assert_not_equal(os.getcwd(), HERE)
41
-            dirstack.cd(["tests"])
42
-            assert_equal(os.getcwd(), HERE)
43
-
44
-def test_cdpath_simple():
45
-    with xonsh_env(Env(CDPATH=PARENT, PWD=HERE)):
46
-        with chdir(os.path.normpath("/")):
47
-            assert_not_equal(os.getcwd(), HERE)
48
-            dirstack.cd(["tests"])
49
-            assert_equal(os.getcwd(), HERE)
50
-
51
-def test_cdpath_collision():
52
-    with xonsh_env(Env(CDPATH=PARENT, PWD=HERE)):
53
-        sub_tests = os.path.join(HERE, "tests")
54
-        if not os.path.exists(sub_tests):
55
-            os.mkdir(sub_tests)
56
-        with chdir(HERE):
57
-            assert_equal(os.getcwd(), HERE)
58
-            dirstack.cd(["tests"])
59
-            assert_equal(os.getcwd(), os.path.join(HERE, "tests"))
60
-
61
-def test_cdpath_expansion():
62
-    with xonsh_env(Env(HERE=HERE, CDPATH=("~", "$HERE"))):
63
-        test_dirs = (
64
-            os.path.join(HERE, "xonsh-test-cdpath-here"),
65
-            os.path.expanduser("~/xonsh-test-cdpath-home")
66
-        )
67
-        try:
68
-            for _ in test_dirs:
69
-                if not os.path.exists(_):
70
-                    os.mkdir(_)
71
-                assert os.path.exists(dirstack._try_cdpath(_)), "dirstack._try_cdpath: could not resolve {0}".format(_)
72
-        except Exception as e:
73
-            tuple(os.rmdir(_) for _ in test_dirs if os.path.exists(_))
74
-            raise e
75
-
76
-if __name__ == '__main__':
77
-    nose.runmodule()

+ 0
- 184
tests/test_environ.py View File

@@ -1,184 +0,0 @@
1
-# -*- coding: utf-8 -*-
2
-"""Tests the xonsh environment."""
3
-from __future__ import unicode_literals, print_function
4
-import os
5
-import tempfile
6
-import builtins
7
-from tempfile import TemporaryDirectory
8
-from xonsh.tools import ON_WINDOWS
9
-
10
-
11
-import nose
12
-from nose.tools import (assert_equal, assert_true, assert_not_in,
13
-    assert_is_instance, assert_in, assert_raises)
14
-
15
-from xonsh.environ import (Env, format_prompt, load_static_config,
16
-    locate_binary, partial_format_prompt)
17
-
18
-from tools import mock_xonsh_env
19
-
20
-def test_env_normal():
21
-    env = Env(VAR='wakka')
22
-    assert_equal('wakka', env['VAR'])
23
-
24
-def test_env_path_list():
25
-    env = Env(MYPATH=['wakka'])
26
-    assert_equal(['wakka'], env['MYPATH'])
27
-
28
-def test_env_path_str():
29
-    env = Env(MYPATH='wakka' + os.pathsep + 'jawaka')
30
-    assert_equal(['wakka', 'jawaka'], env['MYPATH'])
31
-
32
-def test_env_detype():
33
-    env = Env(MYPATH=['wakka', 'jawaka'])
34
-    assert_equal('wakka' + os.pathsep + 'jawaka', env.detype()['MYPATH'])
35
-
36
-def test_env_detype_mutable_access_clear():
37
-    env = Env(MYPATH=['wakka', 'jawaka'])
38
-    assert_equal('wakka' + os.pathsep + 'jawaka', env.detype()['MYPATH'])
39
-    env['MYPATH'][0] = 'woah'
40
-    assert_equal(None, env._detyped)
41
-    assert_equal('woah' + os.pathsep + 'jawaka', env.detype()['MYPATH'])
42
-
43
-def test_env_detype_no_dict():
44
-    env = Env(YO={'hey': 42})
45
-    det = env.detype()
46
-    assert_not_in('YO', det)
47
-
48
-def test_format_prompt():
49
-    formatter_dict = {
50
-        'a_string': 'cat',
51
-        'none': (lambda: None),
52
-        'f': (lambda: 'wakka'),
53
-        }
54
-    cases = {
55
-        'my {a_string}': 'my cat',
56
-        'my {none}{a_string}': 'my cat',
57
-        '{f} jawaka': 'wakka jawaka',
58
-        }
59
-    for p, exp in cases.items():
60
-        obs = format_prompt(template=p, formatter_dict=formatter_dict)
61
-        yield assert_equal, exp, obs
62
-    for p, exp in cases.items():
63
-        obs = partial_format_prompt(template=p, formatter_dict=formatter_dict)
64
-        yield assert_equal, exp, obs
65
-
66
-def test_format_prompt_with_broken_template():
67
-    for p in ('{user', '{user}{hostname'):
68
-        assert_equal(partial_format_prompt(p), p)
69
-        assert_equal(format_prompt(p), p)
70
-
71
-    # '{{user' will be parsed to '{user'
72
-    for p in ('{{user}', '{{user'):
73
-        assert_in('user', partial_format_prompt(p))
74
-        assert_in('user', format_prompt(p))
75
-
76
-def test_format_prompt_with_broken_template_in_func():
77
-    for p in (
78
-        lambda: '{user',
79
-        lambda: '{{user',
80
-        lambda: '{{user}',
81
-        lambda: '{user}{hostname',
82
-    ):
83
-        # '{{user' will be parsed to '{user'
84
-        assert_in('user', partial_format_prompt(p))
85
-        assert_in('user', format_prompt(p))
86
-
87
-def test_format_prompt_with_invalid_func():
88
-    def p():
89
-        foo = bar  # raises exception
90
-        return '{user}'
91
-    assert_is_instance(partial_format_prompt(p), str)
92
-    assert_is_instance(format_prompt(p), str)
93
-
94
-def test_HISTCONTROL():
95
-    env = Env(HISTCONTROL=None)
96
-    assert_is_instance(env['HISTCONTROL'], set)
97
-    assert_equal(len(env['HISTCONTROL']), 0)
98
-
99
-    env['HISTCONTROL'] = ''
100
-    assert_is_instance(env['HISTCONTROL'], set)
101
-    assert_equal(len(env['HISTCONTROL']), 0)
102
-
103
-    env['HISTCONTROL'] = 'ignoredups'
104
-    assert_is_instance(env['HISTCONTROL'], set)
105
-    assert_equal(len(env['HISTCONTROL']), 1)
106
-    assert_true('ignoredups' in env['HISTCONTROL'])
107
-    assert_true('ignoreerr' not in env['HISTCONTROL'])
108
-
109
-    env['HISTCONTROL'] = 'ignoreerr,ignoredups,ignoreerr'
110
-    assert_equal(len(env['HISTCONTROL']), 2)
111
-    assert_true('ignoreerr' in env['HISTCONTROL'])
112
-    assert_true('ignoredups' in env['HISTCONTROL'])
113
-
114
-def test_swap():
115
-    env = Env(VAR='wakka')
116
-    assert_equal(env['VAR'], 'wakka')
117
-
118
-    # positional arg
119
-    with env.swap({'VAR': 'foo'}):
120
-        assert_equal(env['VAR'], 'foo')
121
-
122
-    # make sure the environment goes back outside the context manager
123
-    assert_equal(env['VAR'], 'wakka')
124
-
125
-    # kwargs only
126
-    with env.swap(VAR1='foo', VAR2='bar'):
127
-        assert_equal(env['VAR1'], 'foo')
128
-        assert_equal(env['VAR2'], 'bar')
129
-
130
-    # positional and kwargs
131
-    with env.swap({'VAR3': 'baz'}, VAR1='foo', VAR2='bar'):
132
-        assert_equal(env['VAR1'], 'foo')
133
-        assert_equal(env['VAR2'], 'bar')
134
-        assert_equal(env['VAR3'], 'baz')
135
-
136
-    # make sure the environment goes back outside the context manager
137
-    assert_equal(env['VAR'], 'wakka')
138
-    assert 'VAR1' not in env
139
-    assert 'VAR2' not in env
140
-    assert 'VAR3' not in env
141
-
142
-def check_load_static_config(s, exp, loaded):
143
-    env = Env({'XONSH_SHOW_TRACEBACK': False})
144
-    f = tempfile.NamedTemporaryFile(delete=False)
145
-    with mock_xonsh_env(env):
146
-        f.write(s)
147
-        f.close()
148
-        conf = load_static_config(env, f.name)
149
-    os.unlink(f.name)
150
-    assert_equal(exp, conf)
151
-    assert_equal(env['LOADED_CONFIG'], loaded)
152
-
153
-def test_load_static_config_works():
154
-    s = b'{"best": "awash"}'
155
-    check_load_static_config(s, {'best': 'awash'}, True)
156
-
157
-def test_load_static_config_type_fail():
158
-    s = b'["best", "awash"]'
159
-    check_load_static_config(s, {}, False)
160
-
161
-def test_load_static_config_json_fail():
162
-    s = b'{"best": "awash"'
163
-    check_load_static_config(s, {}, False)
164
-
165
-if ON_WINDOWS:
166
-    def test_locate_binary_on_windows():
167
-        files = ('file1.exe', 'FILE2.BAT', 'file3.txt')
168
-        with TemporaryDirectory() as tmpdir:
169
-            for fname in files:
170
-                fpath = os.path.join(tmpdir, fname)
171
-                with open(fpath, 'w') as f:
172
-                    f.write(fpath)
173
-            env = Env({'PATH': [tmpdir], 'PATHEXT': ['.COM', '.EXE', '.BAT']})
174
-            with mock_xonsh_env(env):
175
-                assert_equal( locate_binary('file1'), os.path.join(tmpdir,'file1.exe'))
176
-                assert_equal( locate_binary('file1.exe'), os.path.join(tmpdir,'file1.exe'))
177
-                assert_equal( locate_binary('file2'), os.path.join(tmpdir,'FILE2.BAT'))
178
-                assert_equal( locate_binary('file2.bat'), os.path.join(tmpdir,'FILE2.BAT'))
179
-                assert_equal( locate_binary('file3'), None)
180
-
181
-
182
-
183
-if __name__ == '__main__':
184
-    nose.runmodule()

+ 0
- 113
tests/test_execer.py View File

@@ -1,113 +0,0 @@
1
-# -*- coding: utf-8 -*-
2
-"""Tests the xonsh lexer."""
3
-from __future__ import unicode_literals, print_function
4
-import os
5
-import sys
6
-import ast
7
-
8
-from nose.tools import assert_raises
9
-
10
-from xonsh.execer import Execer
11
-from xonsh.tools import ON_WINDOWS
12
-
13
-from tools import (mock_xonsh_env, execer_setup, check_exec, check_eval,
14
-    check_parse, skip_if)
15
-