RE: ? to build with installed Sphinx?

59 views
Skip to first unread message

Vlad Riscutia

unread,
Feb 11, 2013, 12:27:36 AM2/11/13
to tinker...@googlegroups.com, Srinath Vadlamani
The in development version of Tinkerer implements a custom builder as the one that comes with Sphinx produces some tags that are not supported in html5. I will make this builder optional before the next release with the ability to use Sphinx one instead. I am very curious what caused the problem though. Can you by any chance share a small RST file with which I can repro this?
 
Thank you,
Vlad
 
From: Srinath Vadlamani <srinath....@gmail.com>
Sent: February 10, 2013 8:26 PM
To: tinker...@googlegroups.com
Subject: Re: ? to build with installed Sphinx?
 
This is motivated because of the following compile error:
# Sphinx version: 1.1.3
# Python version: 2.7.3
# Docutils version: 0.10 release
# Jinja2 version: 2.6
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sphinx/cmdline.py", line 189, in main
    app.build(force_all, filenames)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sphinx/application.py", line 204, in build
    self.builder.build_update()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 196, in build_update
    'out of date' % len(to_build))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 252, in build
    self.write(docnames, list(updated_docnames), method)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 292, in write
    self.write_doc(docname, doctree)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sphinx/builders/html.py", line 419, in write_doc
    self.docwriter.write(doctree, destination)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sphinx/writers/html.py", line 38, in translate
    self.document.walkabout(visitor)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docutils/nodes.py", line 166, in walkabout
    visitor.dispatch_visit(self)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docutils/nodes.py", line 1627, in dispatch_visit
    return method(node)
  File "/Users/srinathv/software/lib/python2.7/site-packages/Tinkerer-1.0.2-py2.7.egg/tinkerer/ext/html5.py", line 534, in unknown_visit
    raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
NotImplementedError: Unknown node: displaymath

Thanks for making a great blogging software.

On Sunday, February 10, 2013 9:00:31 PM UTC-7, Srinath Vadlamani wrote:
I am on a mac os x and use macports to manage Sphinx & python.  With that said, how do I build the hg repo using the installed sphinx?

Thanks,
<>Srinath

 

--
You received this message because you are subscribed to the Google Groups "tinkerer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinkerer-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Srinath Vadlamani

unread,
Feb 11, 2013, 11:16:38 PM2/11/13
to tinker...@googlegroups.com, Srinath Vadlamani
For some reason I can not upload files, so I'll have to paste the text:

Scientific computing tools
==========================
.. contents:: Help me plot, calculate, run many times with easy documention


.. highlight:: bash
   
This will test github math rendering.

.. math:: a^2

Does this work :math:`x \rightarrow \int dy`.
Yes this works.

But what about math lines





This use to work very nicely, but now seems to fail.
Thanks,
<>Srinath

Christian Jann

unread,
Feb 12, 2013, 8:59:18 AM2/12/13
to tinker...@googlegroups.com, Srinath Vadlamani
Same here, it builds fine but as soon as I add 'sphinx.ext.pngmath' to the
list of extension I get the same error.

# Sphinx version: 1.2pre
# Python version: 2.7.3
# Docutils version: 0.11 repository
# Jinja2 version: 2.6

On Monday 11 February 2013 20:16:38 Srinath Vadlamani wrote:
> For some reason I can not upload files, so I'll have to paste the text:
>
> Scientific computing tools
> ==========================
> .. contents:: Help me plot, calculate, run many times with easy documention
>
>
> .. highlight:: bash
>
> This will test github math rendering.
>
> .. math:: a^2
>
> Does this work :math:`x \rightarrow \int dy`.
> Yes this works.
>
> But what about math lines
>
>
>
>
>
> This use to work very nicely, but now seems to fail.
> Thanks,
> <>Srinath
>
> On Sunday, February 10, 2013 10:27:36 PM UTC-7, vladris wrote:
> > The in development version of Tinkerer implements a custom builder as the
> > one that comes with Sphinx produces some tags that are not supported in
> > html5. I will make this builder optional before the next release with the
> > ability to use Sphinx one instead. I am very curious what caused the
> > problem though. Can you by any chance share a small RST file with which I
> > can repro this?
> >
> > Thank you,
> > Vlad
> >
> > *From:* Srinath Vadlamani <srinath....@gmail.com <javascript:>>
> >
> > *Sent:* February 10, 2013 8:26 PM
> > *To:* tinker...@googlegroups.com <javascript:>
> > *Subject:* Re: ? to build with installed Sphinx?

Srinath Vadlamani

unread,
Feb 12, 2013, 9:35:07 PM2/12/13
to tinker...@googlegroups.com, Srinath Vadlamani
Christian, 
  Are you suggesting I remove the sphinx.ext.pngmath extension, or is this a bug that needs to be addressed?
Thank you for looking at this.

<>Srinath

Christian Jann

unread,
Feb 13, 2013, 4:00:15 AM2/13/13
to tinker...@googlegroups.com, Srinath Vadlamani
Hi Srinath,

This was just a hint for Vlad how to reproduce this bug (that needs to be
fixed). The same happens with 'sphinx.ext.mathjax', so this is also no
alternative.

To build the hg repo:

- I can only tell you how it works under Linux, but it may be similar under
Mac OS X
- you need to have hg (mercurial) installed
- open a console
- execute "hg clone https://bitbucket.org/vladris/tinkerer"
- change into the tinkerer directory: "cd tinkerer"
- as root/administrator/with sudo execute "python setup.py install"
- now the latest tinkerer version should be installed
- you can also google how to install Sphinx from source on Mac or other Python
packages, Tinkerer is no exception here

If you edit the file tinkerer/tinkerer/ext/blog.py and comment out the line
that says app.config.html_translator_class =
"tinkerer.ext.html5.SmartyPantsHTML5Translator", e.g. add a # in front of if,
then pngmath should work again.

Srinath Vadlamani

unread,
Feb 13, 2013, 8:57:28 AM2/13/13
to Christian Jann, tinker...@googlegroups.com
Should I comment out the line before I build/install or in the install directory? Thanks.

-Srinath V.
--Sent from my iPhone. Likely brief.

Vlad Riscutia

unread,
Feb 13, 2013, 12:17:36 PM2/13/13
to tinker...@googlegroups.com, Christian Jann
Thanks Christian for narrowing it down! I have a couple of ideas about what goes wrong and I will get to it as soon as I can. 

I opened a bug to track this: https://bitbucket.org/vladris/tinkerer/issue/69/html5-build-failure

Thank you,
Vlad

Vlad Riscutia

unread,
Feb 17, 2013, 7:22:59 PM2/17/13
to tinker...@googlegroups.com, Christian Jann
The issue should be fixed now.

Thank you,
Vlad

Srinath Vadlamani

unread,
Feb 18, 2013, 1:46:41 PM2/18/13
to tinker...@googlegroups.com, Christian Jann
THis worked.  Is it possible to use local sphinx builds now?

Thanks,
<>Srinath
=================================
Srinath Vadlamani
=================================

Vlad Riscutia

unread,
Feb 18, 2013, 2:53:26 PM2/18/13
to tinker...@googlegroups.com, tinker...@googlegroups.com, Christian Jann
Not sure what you mean by local Sphinx build. Can you please clarify?

Thank you,
Vlad

Vlad Riscutia

unread,
Feb 18, 2013, 2:58:55 PM2/18/13
to tinker...@googlegroups.com, tinker...@googlegroups.com, Christian Jann
Not sure what you mean by local Sphinx build. Can you please clarify?

Thank you,
Vlad

Srinath Vadlamani

unread,
Feb 18, 2013, 4:28:33 PM2/18/13
to tinker...@googlegroups.com, Christian Jann
I have Sphinx on my machine already.  How do I use it to build tinkerer?  Currently, tinkerer seems to build its own Sphinx.

thanks,
<>Srinath
=================================
Srinath Vadlamani
=================================


Christian Jann

unread,
Feb 18, 2013, 5:15:26 PM2/18/13
to tinker...@googlegroups.com
Tinkerer should use a already installed version of Sphinx and only installs a
newer version of Sphinx if the installed version is older then the version
that is specified in setup.py:

requires = ["Jinja2>=2.3", "Sphinx>=1.1", "argparse>=1.2"]

What do you get if you open a console and type "python" and the following
commands (after the ">>>"):

[chris@thinkpad ~]$ python
Python 2.7.3 (default, Jul 24 2012, 10:05:38)
[GCC 4.7.0 20120507 (Red Hat 4.7.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sphinx
>>> sphinx.package_dir
'/usr/lib/python2.7/site-packages/Sphinx-1.2pre_7c437d4e4f10dev_20130218-
py2.7.egg/sphinx'
>>>

This should print the path where Sphinx is installed on your system and the
version of Sphinx is also visible. As long as Tinkerer works I would not care
about a second installation of Sphinx but I doubt that it builds its own
version if you don't post the complete build log (the output of something like
sudo python setup.py install, if Sphinx was already installed it won't install
it again).

Btw you don't have to add me in the CC, I've subscribed this list.

Srinath Vadlamani

unread,
Feb 18, 2013, 5:28:25 PM2/18/13
to tinker...@googlegroups.com, Christian Jann
$python
Python 2.7.3 (default, Oct 24 2012, 12:50:22) 
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.57))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sphyinx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named sphyinx
>>> import sphinx
>>> sphinx.package_dir
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sphinx'

This is managed via Macports, so I'll search for the version via macports:
$port installed | grep sphinx
  py27-sphinx @1.1.3_1 (active)

Now, every time I run the tinker setup build/install via:
rm -rf build
python setup.py install --prefix=/Users/srinathv/software

Processing argparse-1.2.1-py2.7.egg
argparse 1.2.1 is already the active version in easy-install.pth

Using /Users/srinathv/software/lib/python2.7/site-packages/argparse-1.2.1-py2.7.egg
Searching for Sphinx==1.1.3
Best match: Sphinx 1.1.3
Adding Sphinx 1.1.3 to easy-install.pth file
Installing sphinx-apidoc script to /Users/srinathv/software/bin
Installing sphinx-build script to /Users/srinathv/software/bin
Installing sphinx-quickstart script to /Users/srinathv/software/bin
Installing sphinx-autogen script to /Users/srinathv/software/bin

So, maybe all it is doing is copying over the executables like sphinx-autogen to my /Users/srinathv/software/bin, but there is already one in 
/opt/local/bin, which is in my path.  It must be a copy and not a soft link.

Is it something about my easy-install.pth file:
$cat /Users/srinathv/software/lib/python2.7/site-packages/easy-install.pth
import sys; sys.__plen = len(sys.path)
./argparse-1.2.1-py2.7.egg
./Tinkerer-1.0.2-py2.7.egg
import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)


Thanks for your help,
<>Srinath

On Mon, Feb 18, 2013 at 3:15 PM, Christian Jann <christia...@gmail.com> wrote:
sphinx.package_dir



=================================
Srinath Vadlamani
=================================

Christian Jann

unread,
Feb 18, 2013, 6:05:41 PM2/18/13
to tinker...@googlegroups.com
Yes this looks interesting now I also know a little bit more about Macs but
unfortunately I'm no Python geek, this may be a Python distutils or Sphinx
bug, these scripts aren't needed by Tinkerer and it should be save to delete
them after the installation of Tinkerer. I'm seeing the same:

Using /usr/lib/python2.7/site-packages/argparse-1.2.1-py2.7.egg
Searching for Sphinx==1.2pre-7c437d4e4f10dev-20130218
Best match: Sphinx 1.2pre-7c437d4e4f10dev-20130218
Processing Sphinx-1.2pre_7c437d4e4f10dev_20130218-py2.7.egg
Sphinx 1.2pre-7c437d4e4f10dev-20130218 is already the active version in easy-
install.pth
Installing sphinx-apidoc script to /usr/bin
Installing sphinx-build script to /usr/bin
Installing sphinx-quickstart script to /usr/bin
Installing sphinx-autogen script to /usr/bin

I don't know if this is a bug or a feature, at least it is no Tinkerer bug.
Maybe Vlad knows more.

On Monday 18 February 2013 15:28:25 Srinath Vadlamani wrote:
> $python
> Python 2.7.3 (default, Oct 24 2012, 12:50:22)
> [GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.57))] on
> darwin
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import sphyinx
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ImportError: No module named sphyinx
>
> >>> import sphinx
> >>> sphinx.package_dir
>
> '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/s
> ite-packages/sphinx'
>
> This is managed via Macports, so I'll search for the version via macports:
> $port installed | grep sphinx
> py27-sphinx @1.1.3_1 (active)
>
> Now, every time I run the tinker setup build/install via:
> rm -rf build
> python setup.py install --prefix=/Users/srinathv/software
>
> Processing argparse-1.2.1-py2.7.egg
> argparse 1.2.1 is already the active version in easy-install.pth
>
> Using
> /Users/srinathv/software/lib/python2.7/site-packages/argparse-1.2.1-py2.7.eg
> g Searching for Sphinx==1.1.3

Vlad Riscutia

unread,
Feb 18, 2013, 6:37:03 PM2/18/13
to tinker...@googlegroups.com
Unfortunately I don't know much about this. I don't own/use Mac. It definitely doesn't look like a Tinkerer issue, as same setup.py works fine on Linux and Windows.

Thank you,
Vlad

Reply all
Reply to author
Forward
0 new messages