Code Monkey home page Code Monkey logo

slug's Introduction

xonsh

xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt.

The language is a superset of Python 3.6+ with additional shell primitives. xonsh (pronounced conch) is meant for the daily use of experts and novices alike.

What is xonsh?

If you like xonsh, โญ the repo, write a tweet and stay tuned by watching releases.

Join to xonsh.zulipchat.com

GitHub Actions

codecov.io

repology.org

First steps

Install xonsh from pip:

python -m pip install 'xonsh[full]'

And visit https://xon.sh for more information:

Extensions

Xonsh has an extension/plugin system. We call these additions xontribs.

Projects that use xonsh or compatible

  • gitsome: Supercharged Git/shell autocompleter with GitHub integration.
  • xxh: Using xonsh wherever you go through the SSH.
  • rever: Cross-platform software release tool.
  • Regro autotick bot: Regro Conda-Forge autoticker.
  • zoxide: A smarter cd command.
  • any-nix-shell: xonsh support for the nix run and nix-shell environments of the Nix package manager.

Jupyter-based interactive notebooks via xontrib-jupyter:

The xonsh shell community

The xonsh shell is developed by a community of volunteers. There are a few ways to help out:

We welcome new contributors!

Credits

  • Thanks to Zulip for supporting the xonsh community!

slug's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

pepe5

slug's Issues

Test on WSL

Expand CI to cover Windows Subsystem for Linux (aka Bash on Windows, Ubuntu on Windows).

Add stop method to plumbing

Currently, Tee, Valve, and QuickConnect clean up when their source pipe hits EOF. Add a method to manually clean up.

Text-mode Pipes

Add Pipes that go between text and binary, or are just text on both sides.

Interruptible Reads on Windows

Both Valve and QuickConnect need extremely special windows implementations.

  • Python's .read() will only break on an actual triggered interrupt, not just a faked exception through PyThreadState_SetAsyncExc().
  • Window's select only works on sockets, not pipes or other IO types.

So I think we need to use win32's ReadFile() manually in conjunction with CancelSynchronousIo() in order to not read an extra block when switching.

PG doesn't initialize with staggered start

If you start the individual processes in a process group, the process group is not initialized correctly, causing the processes to not properly join the group nor the group created.

with ProcessGroup() as pg:
  pipe = Pipe()
  spam = Process(['spam'], stdout=pipe.side_in)
  pg.add(spam)
  eggs = Process(['eggs'], stdin=pipe.side_out)
  pg.add(spam)
spam.start()
eggs.start()
eggs.join()
pg.kill()
pg.join()

context issue

This is the code in current readme:

with ProcessGroup() as pg:
  pipe = mkpipe()
  spam = pg.process(['spam'], stdin=StdIn(), stdout=pipe.side_in, stderr=StdErr(), environ=...)
  eggs = pg.process(['eggs'], stdin=pipe.side_out, stdout=StdOut(), stderr=StdErr(), environ=...)
pg.start()
pg.join()

The last two line looks a bit weird. I mean it's valid but I'd like keep the pg only used inside the with block - make pg.start(), pg.join() implemented inside the context manager itself?

[RFC] Dependency Injection?

We have a lot of singletons. Most of them get lumped on to builtins, which is ugly and hackish and they have to all be initialized carefully and at once.

Dependency injection would allow us to delay some initialization, clean up namespaces, and make sure that concerns are where they belong.

Cache pgid

Process (POSIX version) should somehow cache pgid so it's still available after the process exits.

PyPy support

Now that PyPy3.5 is released, PyPy support should be added.

Note that I think there's a few places where we rely on specific CPython behaviors, so some work might be needed.

pipeline not work

Content of file test_slug.py:

from slug import Process, ProcessGroup, Pipe

with ProcessGroup() as pg:
  pipe = Pipe()
  spam = pg.add(Process(['ls'], stdout=pipe.side_in))
  eggs = pg.add(Process(['wc'], stdin=pipe.side_out))
pg.start()
pg.join()

Run py test_slug.py, on Linux, it will stuck. On Mac this issue shows:

$ py test_slug.py
Traceback (most recent call last):
  File "test_slug.py", line 8, in <module>
    pg.start()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/xonsh_slug-0.0.1-py3.6.egg/slug/posix.py", line 91, in start
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/xonsh_slug-0.0.1-py3.6.egg/slug/posix.py", line 63, in pgid
ProcessLookupError: [Errno 3] No such process
      71      72     750

Virtual file connectors

Add adaptors to go between purely virtual file-like objects and concrete types with file descriptors.

Process Return Code on premature death?

When a process aborts (ie, ends without setting a numeric return code), what should Process.return_code return?

Negative number matching the signal number?

String of the signal name?

Special object?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.