LightTable / Python

Python language plugin for Light Table
MIT License
98 stars 51 forks source link

Maintainer proposal #52

Closed stemd closed 8 years ago

stemd commented 8 years ago

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: https://github.com/LightTable/Python/pull/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):

print(now()) gives 7.6.2016
print(this.date()) gives 22.1.2015
print(this.CodeMirror.date()) gives 19.5.2014

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.

slick666 commented 8 years ago

I like it.

carocad commented 8 years ago

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 :)

stemd commented 8 years ago

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 :)

kenny-evitt commented 8 years ago

@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!

kenny-evitt commented 8 years ago

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

stemd commented 8 years ago

@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).

rundis commented 8 years ago

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

kenny-evitt commented 8 years ago

@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.

kenny-evitt commented 8 years ago

@stemd My Google Groups post announcing your maintainership!

cldwalker commented 8 years ago

@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 (https://github.com/LightTable/LightTable/issues/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

apscomp commented 8 years ago

Thanks a lot @stemd & congratulations !!