Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Maintainer proposal #52

Closed
Closed

Description

@stemd

I wrote 5 days ago in #lighttable irc channel following:

hi, regarding issue https://groups.google.com/forum/#!topic/light-table-discussion/Z4px5li-Aj0 (Python3 on Linux)
I got it working, but I'm not too happy with my solution
in short, I applied pull request: #47 to solve Python3 incompatibility
and on my OS I symlinked /usr/bin/python to python3 instead of python2
(Ubuntu is already slowly phasing out python2, so this is no biggie for a temporary workaround)
what I would like to do is better solution, forward & backward compatible - meaning, having Python plugin compatible with Python 2 and 3 branches
detecting which version should not be too hard, parsing #! line for python or python3 is trivial
what I don't know (ATM) is how to change coupling of LT to Python 2 or 3 in smarter way than changing symlinks in /usr/bin :)
I'll (eventually) find it myself, but for LT dev giving me pointer in right direction should be trivial (and I would be immensely grateful :)))
...
LightTable is simply the best eye candy of an IDE I ever saw :)
and if I could upgrade it a bit (not much, but some things like this Python2/3 compatibility is necessary), I could start using it exclusively

As I got zero reactions in 2 or 3 days, I mailed last commiter to this project with this and some more ideas, and got direction to open an issue here. Important part follows:

I thought to put up few PR's to this repo and then to ask for status of maintainer, but as there are already 9 pull requests of which at least half need to be applied before my work starts, why to wait?

What I wanna do with this repository (first priorities):

  • update Python external dependencies (that's only CodeMirror, I tried its python.js from 20.4.2016, it's working fine), as for this = LightTable/Python you have following:
print(now()) gives 7.6.2016
print(this.date()) gives 22.1.2015
print(this.CodeMirror.date()) gives 19.5.2014
  • merge all PRs that can be merged
  • implement support of Python 2 & 3. LightTable 0.8.1 is working with Python2, there are 3 PR's which make it work with Python3, I tried it and it is working fine with both Python2 and Python3 on my PC, but more testing would be nice (on different OS's, although results should be the same as changes in Python code are equivalent to changes in Java code, result should be the same everywhere). Also it would be nice that if on the first line of your something.py file you have /usr/bin/env pythonX or /usr/bin/pythonX you would not need to change manually [:app :lt.plugins.python/python-exe "/usr/bin/pythonX"] in your user.behaviors, that should be detected and done automatically on the fly.
  • better documentation for this plugin, e.g. how to set/change Python version used for REPL, how to set/change Python version used by this plugin ([:app :lt.plugins.python/python-exe "/usr/bin/pythonX"] and [:app :lt.plugins.python/python "/usr/bin/pythonY"]). That could be wriiten also as - starting documentation, as currently there is none - plugin simply works after installing if you have only Python2, but if you have only 3 or both Python 2 and 3 and default is 3 - there should be some documentation how to manage that situations.
  • solving issue Multiline comments in Python doesn't compile #40 (multiline comments)
  • implementing doc search
  • implementing linting (pylint is first what comes to mind)

I'm aware that some of above is trivial for someone skilled in Clojure & LightTable & Python, but evidently none has come in last 2 years, so I would like to try. I'm skilled in Python, in Clojure not as much, but I like LightTable enough to be ready to learn a few new tricks.

Activity

  1. slick666 commented on Jun 7, 2016

    @slick666

    I like it.

  2. carocad commented on Jun 7, 2016

    @carocad

    hi @stemd,
    maybe you already know this but I will write it anyway. Some time ago I wrote an answer about python3 usage on LT in Stackoverflow. You can check the answer here: http://stackoverflow.com/questions/28327779/running-python-3-from-light-table

    I hope it helps and kudos for volunteering to maintaining it :)

  3. stemd commented on Jun 7, 2016

    @stemd
    CollaboratorAuthor

    That's under "better documentation for this plugin".

    I saw both python-exe and python strings in python_compiled.js file in Python plugin directory, but it's smarter to change something when you know what it should do, than to change and see what happens, and scratch your head when (seemingly) nothing happen. Every approach is valid, but experienced programmer sometimes choose to read the code, not always using beginner programmer loops: try-fail and try-success.
    https://s-media-cache-ak0.pinimg.com/236x/53/6d/fc/536dfc6bfc75b29874ea99d67611ca44.jpg :)

  4. kenny-evitt commented on Jun 7, 2016

    @kenny-evitt

    @stemd Mind if I make an announcement on the mailing list (Google Groups group)? If you want to do it yourself, that's more than fine with me too!

  5. kenny-evitt commented on Jun 7, 2016

    @kenny-evitt

    @stemd Oh, and welcome to the team by-the-way 🎉

  6. stemd commented on Jun 7, 2016

    @stemd
    CollaboratorAuthor

    @kenny-evitt Please write an announcement, I'm still reading all the docs I can find, so I can start fixing issues which pain me ASAP (Ctrl+d does nothing for Python, linter in 21st century editor is must-have).

  7. rundis commented on Jun 7, 2016

    @rundis

    Regarding lnter, you could check out the pluggable plugin ! https://github.com/bbbates/lt-lint

  8. kenny-evitt commented on Jun 8, 2016

    @kenny-evitt

    @stemd Here's the plugin (ClojureScript) code that runs the Python executable:

    (defn run-py [{:keys [path project-path name client venv] :as info}]
      (let [n (notifos/working "Connecting..")
            obj (object/create ::connecting-notifier client)
            env (if venv
                  {"VIRTUAL_ENV" venv}
                  {})
            env (if (:ipython-exe @python)
                  (assoc env "LT_IPYTHON_PATH" (:ipython-exe @python))
                  env)]
        (proc/exec {:command (or (:python-exe @python) (:venv-py info) "python")
                    :args [py-path tcp/port (clients/->id client)]
                    :cwd (or venv project-path)
                    :env env
                    :obj obj})))
    

    That's (one set of code) that you'd need to change to support multiple Python versions.

  9. cldwalker commented on Jun 8, 2016

    @cldwalker
    Member

    @stemd Welcome aboard! As you're learning more Clojure(Script) and this plugin, feel free to ping us with questions and open pull requests for discussion. Thanks for taking this on!

    update Python external dependencies (that's only CodeMirror, I tried its python.js from 20.4.2016, it's working fine), as for this = LightTable/Python you have following:

    When updating python's codemirror, keep in mind LT is running an older version of CodeMirror (LightTable/LightTable#1797) in case you see some features not working. Also, please mention in the commit or in a For Commiters section like in the Clojure plugin the exact commit used to update codemirror/python.js

  10. apscomp commented on Jun 10, 2016

    @apscomp

    Thanks a lot @stemd & congratulations !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions