Closed bjones1 closed 8 years ago
Hi
This script is a step ahead but it seems like at also doesn't solve all problems.
If I understand correctly, now it will work only on Debian-based systems. But on Debian based it is easier to install Enki from the repository. tre, CodeChat and mathjax are not available in the repository. We can make scripts which help to install this packages. But not whole Enki.
We have prebuilt packages only for the most popular Linux distributions. But on other Linuxes this script is also likely to fail. And a user would be frustrated. We can not support all package managers and know package names for all distributions. So I think it is better to just say to a user "Install X to have optional feature Y" and let him to find a way how to install a package on his distribution if he wants.
I think a better solution would be to
Than return to this pull request and re-think if we need installation script and how it should work.
One more thing. Some time ago I tried to install CodeChat. There are some issues:
documentaion
is confusing. When I see it, my first idea is that it contains documentation for the project but not the project itself. Rename the repository to codechat
. Some people and sites have a link to existing repository. Replace current repo with a link to new one.pip install -U CodeChat
Btw, if you need this script now, i.e. for your students to install Enki quickly on Ubuntu, I can add it to the repo.
Good points. Thinking a bit more, there are several cases, ordered from a fully automatic install to a full manual process:
How does this sound in terms of updating the PR?
For CodeChat, I'll rename the repo and provided clear install instructions on the home page. The current version of CodeChat is available on pip. I'm not as comfortable with providing Linux packages, so I'll ask Yajo for help.
I'm close to migrating from tre to regex, which provide pip and linux packages, so that should help.
There are a hack for developers on supported OSes.
OK, let's wait for regex from pip and CodeChat,
OK, I've done a bit of fixing. It now uses regex instead of tre, and is hopefully a bit clearer. I didn't include your developer's hack for supported OSes, since I couldn't find a good place to put it. How does this look?
Removing tre is amazing!!!! I tried to install regex and preview Enki README.md. Sync doesn't work for me out of the box. Does it work for your on this file?
Hmm, strange. Works for me on Windows. I'll check on Unix when I have a minute.
OK, notify me when you have checked. I've finished with bugs I wanted to fix and it's time to release v 15.11.
This works fine for me on Ubuntu 14. What OS are you using?
Oops, I incorrectly installed regex. Now it works fine on README. However I have some test failures. See #335.
I've discovered that it doesn't make sense to copy mdx_mathjax. See Using the extension from a Python program. It seems enough to install the extension with pip.
Oops, mdx_mathjax is not installable from pip
The mdx_mathjax installation is one of my least favorite items -- no pip package, no Linux package, just an ugly file copy. Yuck. Does this get included when installing Enki via apt-get?
No, it doesn't get included to .deb. I'm not sure if we should. markdown and mathjax are 3rdparty software. Not all users need mathjax. And if they need - they always can install it.
However, if we would like to include it, we can just copy the file to enki repository
IMHO, I'd like Enki to come "with batteries included" -- that is, all features available by default, following Python's philosophy (a rich standard library). So, mathjax/sphinx/ctags/etc. should all be installed by default. The only exceptions I would make is programming languages (scheme, etc.), since users who want this will already have it installed.
"Batteries included" is very good practice. But I would like to support and be responsible for 3rdparty markdown extension.
The mdx_markdown REAME is incorrect. It seems like to get the extension working we just need to put the file at any place at python path. i.e. site-packages
where the majority of the software is installed.
So, I think there are 2 better ways to simplify the installation:
Good ideas -- a better install process would be great. Looking at https://github.com/waylan/Python-Markdown/issues/391, the author wants extensions to live in separate repos, not the core Python-markdown repo. Also, per https://github.com/waylan/Python-Markdown/wiki/Third-Party-Extensions, there are several math extensions, and the Markdown developers don't want to support them. So, I'd suggest creating a pip package. The instructions at https://github.com/waylan/Python-Markdown/wiki/Tutorial:-Writing-Extensions-for-Python-Markdown provide a fairly easy way to do this. Perhaps a pull request to https://github.com/mayoff/python-markdown-mathjax?
I've rethought this. The entire script is less than 20 lines. Packing for pip adds that much code again for setup.py -- then that much again for Linux packaging. I'd suggest simply including it in enki.plugins.preview and importing it from there, instead of all this work.
If I understood correctly, the file must be in python import path. It is bad idea to include preview
to the global path. I'd suggest creating separate directory which contains only mdx_markdown.
I don't think so. For me, putting mdx_mathjax.py
in enki.plugins.preview
than changing https://github.com/hlamer/enki/blob/master/enki/plugins/preview/preview.py#L163 to from . import mdx_mathjax
work fine. (WIndows -- haven't tested on Linux).
Are you sure your imported but not globally installed mathjax is used? I tried to do similar thing but markdown complained that it can't find and import mathjax.
Oops, you're right. There was an mdx_markdown.pyc
file I didn't delete. I started playing with this, found a few fixes, but also got confused: what does this extension do, anyway? If I don't import it at all, math in a Markdown document seems to work just fine. ???
mdx_mathjax was contributed by @rolandschulz. I guess he knows why it is needed. I think the majority of users don't need mathjax, and the minority can install it without our help.
I went ahead and fixed this. The case: $$a = 2 *b* c$$
, for example, doesn't work without a MathJax extension. I found a better extension that fully supports MathJax and used it instead. The old one doesn't support standard MathJax notation, such as \(*a = b + 1\)
. See http://docs.mathjax.org/en/latest/start.html#tex-and-latex-input for more examples.
I've rebased and updated. Install instructions are now much simpler! Does this seem reasonable?
I started migration to Python 3. Qutepart is already ready. I'd like to switch Enki to Python 3, create requirements.txt and than rethink if install script is usable for users or for developers.
Neat! That could be a lot of work, but I'm definitely excited about the port. What do you think about moving to PyQt5 after Py3?
It will definitely be Qt5. I'm even not sure Qt4 is available for Python3. I'm not sure yet which version to use, PyQt or PySide.
Yes, Qt4 is available for Py3. The migration path is:
Personally, I'm a fan of PyQt4/5 since I'm impressed by Phil Thompson's knowledge and response time to any questions asked. I don't know about PySide.
Yes, PyQt is better choice. PySide seems abandoned. I've pushed to qutepart master 2 first steps.
Bryan, I've updated the install instructions (copy-pasted some text from your README version) and included requirements.txt
to the repository.
Now I hope it is quite easy to install Enki.
I think it doesn't make sense to include a install script to the repository. The script is likely to fail on exotic systems, and users will be unhappy. It is probably easier to follow the instructions than to fix the script.
OK. I can see your reasoning.
What about placing requirements.txt
in setup.py
instead, then using setuptools
to automatically download and install them if necessary? Note that the Python 3 manual recommends setuptools
instead of distutils
.
I moved the Unix install instructions to the install script -- does this seem reasonable to you?