List of all *python* dependencies and why

97 views
Skip to first unread message

Matt Wilkie

unread,
Nov 22, 2017, 3:34:58 PM11/22/17
to leo-e...@googlegroups.com
I'm in the closing stretch for Issue #586, separating end user dependencies from developer requirements. This is what I have now, is anything missing?

~~~
user_requires = [
    'docutils', # Sphinx, rST plugin
    'pyxml', # ?
    'pyenchant', # spell check support
    'PyQt5; python_version >= "3.0"',
    'python-qt5; python_version < "3.0" and platform_system=="Windows"',
    # missing: pip installable pyqt for Linux python 2.x
    ]

developer_requires = {'develop':[
    'pylint','pyflakes', # coding syntax standards
    'pypandoc', # doc format conversion
    'twine','wheel','keyring' # Pip packaging, uploading to PyPi
    ]}
~~~

Note: this is specific to Python module and library dependencies, which is why Git isn't in the list for developers. It can't be installed with Pip.

matt

Chris George

unread,
Nov 22, 2017, 4:39:19 PM11/22/17
to leo-e...@googlegroups.com
pyxml is required if you want to import xml files.

pandoc is required for users if they wish to view markdown files using viewrendered. I am not sure of the difference between pandoc and pypandoc.

Chris



--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscribe@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Terry Brown

unread,
Nov 22, 2017, 7:20:55 PM11/22/17
to leo-e...@googlegroups.com
markdown.py would be a much lighter dependency than pandoc, although a bit less featurefull. My goal is to have leo_edit_pane replace viewrendered. LEP will use either.

You probably take this in to account already, but a lot of these things are "recommends" rather than "requires" kind of dependencies.

Cheers -Terry
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Matt Wilkie

unread,
Nov 23, 2017, 1:19:12 AM11/23/17
to leo-e...@googlegroups.com
thanks!

pypandoc is a wrapper around the pandoc commandline utility, allowing a person to use pandoc from within python using python style syntax. It's a sledgehammer solution to the small hammer problem I faced converting Leo's markdown readme to restructured text for Pypi.org. However pandoc is indisputed king of text format conversion so I used it, thinking it would provide other utility too, That said, I'd be happy to switch to something more lightweight.
 
As for 'recommends' vs 'dependencies', that's part of why I asked what the packages are used for, to help me get a feel for what should be included out of the box. Actually that should have been part of the opening Q: What should be included out of the box?

matt

Edward K. Ream

unread,
Nov 23, 2017, 1:20:37 AM11/23/17
to leo-editor
On Wed, Nov 22, 2017 at 6:20 PM, Terry Brown <terry...@gmail.com> wrote:
markdown.py would be a much lighter dependency than pandoc, although a bit less featurefull. My goal is to have leo_edit_pane replace viewrendered. LEP will use either.

You probably take this in to account already, but a lot of these things are "recommends" rather than "requires" kind of dependencies.

​Indeed.  The way to cut through all this morass is to use the Anaconda distribution.  This gives you almost everything you ever need, except pylint.

Edward

Matt Wilkie

unread,
Nov 23, 2017, 1:57:30 AM11/23/17
to leo-e...@googlegroups.com
You probably take this in to account already, but a lot of these things are "recommends" rather than "requires" kind of dependencies.

​Indeed.  The way to cut through all this morass is to use the Anaconda distribution.  This gives you almost everything you ever need, except pylint.

That probably explains why I didn't get any errors for not specifying docutils etc. earlier. I'm quite liking Anaconda and the conda package manager, though I'm using Miniconda and not the full distribution (only a 60mb initial download).

matt

Josef

unread,
Nov 23, 2017, 8:51:25 AM11/23/17
to leo-e...@googlegroups.com
It seems to me that docutils is even required for the viewrendered plugin (perhaps indirectly?)

Terry Brown

unread,
Nov 23, 2017, 10:19:41 AM11/23/17
to leo-e...@googlegroups.com
I think though that making `pip install leo-editor` work with or
without Anaconda is very valuable from the point of view of making Leo
easy for people to try.

Tell people to install Anaconda, and first they see what is still a
semi-commercial system, and then the find the download is ~500 Mb,
which is an impediment for some people and gives the impression it's
going to install a lot of stuff in your system. Of course miniconda is
a much lighter weight solution, but then you have to handle
dependencies again. pip is definitely the most cross-platform light
weight out of the box installer for Python apps.

Cheers -Terry

Terry Brown

unread,
Nov 23, 2017, 10:25:24 AM11/23/17
to leo-e...@googlegroups.com
viewrendered uses docutils to render rst (reStructuredText) formatted
docs. But it's a bug if viewrendered won't load without it, as rst
doesn't need to be rendered to be useful, and viewrendered should show
it in its raw form. I think the rst is displayed in the log as a
fallback, which is ok.

Cheers -Terry

vitalije

unread,
Nov 23, 2017, 11:50:42 AM11/23/17
to leo-editor
But it's a bug if viewrendered won't load without it, as rst doesn't need to be rendered to be useful, and viewrendered should show it in its raw form.  I think the rst is displayed in the log as a fallback, which is ok. 
Here is viewrendered init function. Clearly it refuses to start without docutils. I agree with you that this plugin should work even without docutils, or to give clear explanation why it doesn't work. 

def init():
     
'''Return True if the plugin has loaded successfully.'''
     ok
= bool(got_docutils and QtSvg and QtWebKitWidgets)
     
# 2017/08/18: register handlers only if all required imports
     
# were successful.

     
if ok:
         g
.plugin_signon(__name__)
         g
.registerHandler('after-create-leo-frame', onCreate)
         g
.registerHandler('close-frame', onClose)
         g
.registerHandler('scrolledMessage', show_scrolled_message)
     
return ok


Vitalije

Viktor Ransmayr

unread,
Nov 23, 2017, 2:57:59 PM11/23/17
to leo-e...@googlegroups.com
Hello Terry & Leo-Community,

2017-11-23 16:19 GMT+01:00 Terry Brown <terry...@gmail.com>:
On Thu, 23 Nov 2017 00:20:34 -0600
"Edward K. Ream" <edre...@gmail.com> wrote:

...

> ​Indeed.  The way to cut through all this morass is to use the
> Anaconda distribution.  This gives you almost everything you ever
> need, except pylint.

I think though that making `pip install leo-editor` work with or
without Anaconda is very valuable from the point of view of making Leo
easy for people to try.

+ 10

Tell people to install Anaconda, and first they see what is still a
semi-commercial system, and then the find the download is ~500 Mb,
which is an impediment for some people and gives the impression it's
going to install a lot of stuff in your system. 

Yes. - I prefer to separate into separate virtual environments ('venvs')

Of course miniconda is
a much lighter weight solution, but then you have to handle
dependencies again. 

I agree.

pip is definitely the most cross-platform light
weight out of the box installer for Python apps.

+1

With kind regards,

Viktor

Matt Wilkie

unread,
Nov 24, 2017, 2:21:45 AM11/24/17
to leo-e...@googlegroups.com
Status update: we're down to only docutils as a reliable pip-installable dependency:
  • pyenchant - no wheels for some platforms, e.g. amd64
  • pyxml - no pip package
  • PyQt5 - only py3 (but is reliable there)
  • python-qt5 - for py2.7, only available for Windows, but not reliable because "pip install from .whl fails conditional dependency check" https://github.com/pypa/pip/issues/4886
I'm giving up on a "batteries included" pip package. Maybe next year.

I've proven that core Leo works and works well, with py3 being the smoothest path. It's still better than before. Time to focus on updating docs and publishing to pypi.org.

matt


Edward K. Ream

unread,
Nov 26, 2017, 12:05:30 PM11/26/17
to leo-editor
​Thanks for this. Experiments show that docutils can run without docutils.

Rev 0589aa3 allows docutils always to run, and adds a warning some imports fail.

Edward

rvn...@tesco.net

unread,
Nov 26, 2017, 5:01:23 PM11/26/17
to leo-e...@googlegroups.com
My 2 cents: the only dependencies that needed to be reported are modules needed to run Leo on a standard python install.
Thus, in my view, Leo should present itself with a set of plugins that will work out of the box (i.e. on a standard python/os-install).

Any other dependencies that come in by linking up with any other python program, like ipython, pylint, etc. should be resolved by user/maintainer/distribution with respect to that link-able program.

This might be not easy to separate as, say, command-line options such as --ipython that ship with leo but that won't have an effect without ipython being present
(and the rest which has to be installed on my bare system for ipython to work: 
six
ipython_genutils
enum34
traitlets
simplegeneric
shutil_get_terminal_size
Pygments
wcwidth
prompt_toolkit
pathlib
pickleshare
ptyprocess
pexpect
jedi
decorator
ipython
;
for pylint: 
py
setuptools-scm
pytest
pytest-runner
python-mccabe
six
singledispatch
ConfigParser
functools-lru-cache
enum34
ipaddress
pies2overrides
pies
isort
python-wrapt
python-lazy-object-proxy
astroid
pylint

Of course soon there will be overlap between module-dependencies, but it should not be leo's task to keep track of that I would think.

The leo-documentation/@settings could possibly be the place to make this clear. Would it be possible to put these extra's in their own box with an explanation how the link can be made to work? Then it may become clear to users what extras they can install and can use to extend the program if they want to. Anaconda seems not a good option if one aims for a minimal set-up and more understanding of how something operates and can be set-up.

As a beginner I found it a bit overwhelming seeing all possibilities and then finding they did not (all) work. Either by lack of proper @settings or by lack of the installed module. I am getting there though (I hope).

I learned a lot by going through various files: workbook, leo-cheatsheet,leoSettings, myLeoSettings, scripts, quick-start, on http://leoeditor.com, FAQ.html, tutorial, documentation and what more, but it is not easy to keep track where one found some bit of info.
It is all, like instructions for running/downloading/installing/using leo a bit spread.

Cheers,

rob

Edward K. Ream

unread,
Nov 27, 2017, 7:07:16 AM11/27/17
to leo-editor
On Sun, Nov 26, 2017 at 3:02 PM, <rvn...@tesco.net> wrote:
My 2 cents: the only dependencies that needed to be reported are modules needed to run Leo on a standard python install.
Thus, in my view, Leo should present itself with a set of plugins that will work out of the box (i.e. on a standard python/os-install).

​What, exactly, is a "standard python install"?

Imo, using Anaconda will save most users a lot of aggravation in the long run.  IPython recommends this approach, and I agree.  A few extra minutes of download time will repay themselves many times over. On modern machines, the extra space requirements don't matter.

Please do not burden Leo's devs with issues relating to a user's unwillingness or inability to install dependencies.  I'm not going to have a lot of sympathy for such troubles.

Having said that, if a plugin fails to load due to missing dependency, it should clearly report that fact.

Edward

Terry Brown

unread,
Nov 27, 2017, 9:17:41 AM11/27/17
to leo-e...@googlegroups.com
On Mon, 27 Nov 2017 06:07:13 -0600
"Edward K. Ream" <edre...@gmail.com> wrote:

> On Sun, Nov 26, 2017 at 3:02 PM, <rvn...@tesco.net> wrote:
>
> > My 2 cents: the only dependencies that needed to be reported are
> > modules needed to run Leo on a standard python install.
> > Thus, in my view, Leo should present itself with a set of plugins
> > that will work out of the box (i.e. on a standard
> > python/os-install).
>
> ​What, exactly, is a "standard python install"?

It's something of a non-question, seeing even though Python has
"standard" methods, each platform also has package management options,
and different users will tend to use Python centric or platform centric
methods.

That said, I would say setup.py and pip tie for Python's standard
installation pathway.

> Imo, using Anaconda will save most users a lot of aggravation in the
> long run. IPython recommends this approach, and I agree. A few
> extra minutes of download time will repay themselves many times over.
> On modern machines, the extra space requirements don't matter.

Telling people they need to install Anaconda to run Leo will put people
off trying Leo. It's almost as bad as telling them they need to use
git to get Leo ;-)

- Anaconda can appear, at first glance, to be commercial
- Having to install a large (500 Mb) framework to run Leo implies
(incorrectly) that Leo is not a whole thing by itself
- Users then need to work out how to use Anaconda to manage
dependencies - if Leo is an app., how is managing dependencies even
a thing?
- All Python systems (including Anaconda) integrate with pip, so even
experienced Python developers who have chosen a stack other than
Anaconda (the scientific analysis distro.) for domain specific
reasons may lose interest if they're told you have to use Anaconda
and can't use pip.

Miniconda only partly mitigates these drawbacks.

I'm not saying that Anaconda / Miniconda shouldn't be suggested *among*
the options, they just shouldn't be presented as the only option,
just as getting Leo from git shouldn't be the only option.

I think it comes down to what filter we're trying to apply to incoming
users. Python devs only? Or all comers, even writers ;-)

Matt's pip install seems to get Leo running with minimal effort, as
long as you use Python 3. I'm not sure what it does currently, but
hopefully it can report the things your missing because pip can't find
them for your OS, maybe even point to (mini)Anaconda instructions on
Leo's web site as a fuller alternative. But the important thing is
that it gets Leo running so the user has a chance to see it rather than
just drifting on to something that's easier to install.

Spelling and formatting rst aren't critical to demoing Leo - Leo should
start with nothing more than PyQt, as far as I'm aware.

Cheers -Terry

Edward K. Ream

unread,
Nov 27, 2017, 9:26:56 AM11/27/17
to leo-editor
On Mon, Nov 27, 2017 at 8:17 AM, Terry Brown <terry...@gmail.com> wrote:
I'm not saying that Anaconda / Miniconda shouldn't be suggested *among*
the options, they just shouldn't be presented as the only option,
just as getting Leo from git shouldn't be the only option.

​Perfectly reasonable.​

I think it comes down to what filter we're trying to apply to incoming
users.  Python devs only?  Or all comers, even writers ;-)

​Imo, the focus should be on making things as simple as possible for non-technical people​, such as writers.

In fact, I think scientists qualify, in general, as non-technical people, which is why the Anaconda distro makes sense for IPython.  It saves a lot of install headaches later.

Matt's pip install seems to get Leo running with minimal effort, as
long as you use Python 3. 
​... But the important thing is
that it gets Leo running so the user has a chance to see it rather than
just drifting on to something that's easier to install.

​That's what we want, surely.​

Spelling and formatting rst aren't critical to demoing Leo - Leo should
start with nothing more than PyQt, as far as I'm aware.

​I agree.

Edward

Offray Vladimir Luna Cárdenas

unread,
Nov 27, 2017, 10:04:02 AM11/27/17
to leo-e...@googlegroups.com

Hi,


On 27/11/17 09:17, Terry Brown wrote:
Miniconda only partly mitigates these drawbacks.

I'm not saying that Anaconda / Miniconda shouldn't be suggested *among*
the options, they just shouldn't be presented as the only option,
just as getting Leo from git shouldn't be the only option.

I think it comes down to what filter we're trying to apply to incoming
users.  Python devs only?  Or all comers, even writers ;-)

I agreed. Several installation methods should be provided. Miniconda should be suggested as the easiest way, similar to what Jupyter does, but without requiring to install all anaconda to just install Leo (the case of Jupyter is distinct because they suppose the users wants also all the huge scientific python environment), without precluding other install alternatives like pip.

I have pushed Leo for (scientific) writers, researchers and the "general public". This is a way that will take time, but providing friendly installers will make it easier to traverse for non-technical savvy users.

Cheers,

Offray

Matt Wilkie

unread,
Nov 28, 2017, 9:57:55 AM11/28/17
to leo-e...@googlegroups.com
thanks for the extended background/justification Terry :)

> Matt's pip install seems to get Leo running with minimal effort, as long as you use Python 3.
They common configurations are minimal, they just aren't all wrapped up in a single simple instruction set:

From bare Python 3 install, windows and linux (mac untested):

    pip install leo

From bare Python 2 install, windows:

    pip install python-qt5
    pip install leo

From bare Python 2 install, linux (debian and kin):

    apt install python-pyqt5
    pip install leo

(Substitute pyqt4 for 5 if desired).

matt

Offray Vladimir Luna Cárdenas

unread,
Nov 28, 2017, 12:59:02 PM11/28/17
to leo-e...@googlegroups.com


On 28/11/17 09:57, Matt Wilkie wrote:
> From bare Python 2 install, linux (debian and kin):
>
>     apt install python-pyqt5
>     pip install leo
>

In Arch/Manjaro and alike:

yaourt -S leo

That's it. But (Ana/mini)conda would provide a distro/OS neutral single
way to install/update the software.

Cheers,

Offray
Reply all
Reply to author
Forward
0 new messages