Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 434602 - dev-python/jinja-2.6 USE=doc with dev-python/sphinx-1.1.2 - File ".../work/Jinja2-2.6/build-3.2/lib.linux-x86_64-3.2/jinja2/nodes.py", line 106 class Node(object, metaclass=NodeType): SyntaxError: invalid syntax
Summary: dev-python/jinja-2.6 USE=doc with dev-python/sphinx-1.1.2 - File ".../work/J...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-09-10 15:46 UTC by Edward "Hades"
Modified: 2013-05-07 11:28 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log,19.37 KB, text/plain)
2012-09-10 15:46 UTC, Edward "Hades"
Details
emerge --info (emerge.info,5.04 KB, text/plain)
2012-09-10 15:46 UTC, Edward "Hades"
Details
suggested fix (jinja-2.6.ebuild.patch,319 bytes, patch)
2012-09-10 15:49 UTC, Edward "Hades"
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Edward "Hades" 2012-09-10 15:46:10 UTC
Created attachment 323422 [details]
build log

If you try to build jinja with USE=doc, the following error occurs:

sphinx-build -b html -d _build/doctrees   . _build/html
Traceback (most recent call last):
  File "/usr/bin/sphinx-build-2.7", line 9, in <module>
    load_entry_point('Sphinx==1.1.2', 'console_scripts', 'sphinx-build')()
  File "/usr/lib64/python2.7/site-packages/sphinx/__init__.py", line 47, in main
    from sphinx import cmdline
  File "/usr/lib64/python2.7/site-packages/sphinx/cmdline.py", line 22, in <module>
    from sphinx.application import Sphinx
  File "/usr/lib64/python2.7/site-packages/sphinx/application.py", line 26, in <module>
    from sphinx.roles import XRefRole
  File "/usr/lib64/python2.7/site-packages/sphinx/roles.py", line 20, in <module>
    from sphinx.util import ws_re
  File "/usr/lib64/python2.7/site-packages/sphinx/util/__init__.py", line 27, in <module>
    import jinja2
  File "/var/tmp/portage/dev-python/jinja-2.6/work/Jinja2-2.6/build-3.2/lib.linux-x86_64-3.2/jinja2/__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "/var/tmp/portage/dev-python/jinja-2.6/work/Jinja2-2.6/build-3.2/lib.linux-x86_64-3.2/jinja2/environment.py", line 13, in <module>
    from jinja2 import nodes
  File "/var/tmp/portage/dev-python/jinja-2.6/work/Jinja2-2.6/build-3.2/lib.linux-x86_64-3.2/jinja2/nodes.py", line 106
    class Node(object, metaclass=NodeType):
                                ^
SyntaxError: invalid syntax


Apparently, sphinx (using python-2) tries to load python3 code.
Comment 1 Edward "Hades" 2012-09-10 15:46:38 UTC
Created attachment 323424 [details]
emerge --info
Comment 2 Edward "Hades" 2012-09-10 15:47:58 UTC
Suggested solution: bump sphinx dependency to 1.1.3-r3 and keyword it.

With sphinx-1.1.3-r3 build completes fine.
Comment 3 Edward "Hades" 2012-09-10 15:49:09 UTC
Created attachment 323426 [details, diff]
suggested fix
Comment 4 Dirkjan Ochtman (RETIRED) gentoo-dev 2012-10-02 09:29:58 UTC
Can you try to re-install sphinx-1.1.2 and try it again?
Comment 5 Edward "Hades" 2012-10-02 09:39:01 UTC
(In reply to comment #4)
> Can you try to re-install sphinx-1.1.2 and try it again?

Same error. Tree timestamp: Tue Oct  2 08:39:40 UTC 2012
Comment 6 Brian Harring (RETIRED) gentoo-dev 2012-10-18 05:51:50 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Can you try to re-install sphinx-1.1.2 and try it again?
> 
> Same error. Tree timestamp: Tue Oct  2 08:39:40 UTC 2012

Hitting the same thing, and it's making for annoyance for pkgcore/snakeoil fixes.

Here's one thing that's fairly whacked- if you invoked python3.2 `which sphinx-build`, it forces python2.7.

Additionally, if you check the deps of sphinx... it's =dev-lang/python-2*, despite py3k usage there.  Those deps need to be fixed.

Triggered it with 1.1.3-r2; issue still exists...
Comment 7 Mike Gilbert gentoo-dev 2012-10-18 06:36:58 UTC
(In reply to comment #6)
> Here's one thing that's fairly whacked- if you invoked python3.2 `which
> sphinx-build`, it forces python2.7.

/usr/bin/sphinx-build is a wrapper script that is looking at your currently eselected python. It will also obey EPYTHON if you have that set in the environment (per python.eclass).

There's not really a nice way to make multi-abi support work without a wrapper.

> Additionally, if you check the deps of sphinx... it's =dev-lang/python-2*,
> despite py3k usage there.  Those deps need to be fixed.

I have updated the dependency in 1.1.3-r3, thanks.
Comment 8 Ian Delaney (RETIRED) gentoo-dev 2012-11-10 04:17:27 UTC
hmm. Is this a chink in the armory?

Available Python interpreters:
  [1]   python2.5                   [1]   python2.5
  [2]   python2.6 *      OR         [2]   python2.6
  [3]   python2.7                   [3]   python2.7 *

jinja # USE=doc ebuild jinja-2.6.ebuild clean install

yields

Traceback (most recent call last):
  File "/usr/bin/sphinx-build-3.1", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib64/python3.1/site-packages/pkg_resources.py", line 2809, in <module>
    working_set.require(__requires__)
  File "/usr/lib64/python3.1/site-packages/pkg_resources.py", line 691, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib64/python3.1/site-packages/pkg_resources.py", line 589, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: docutils>=0.7
make: *** [html] Error 1

Still can fail.  Seems the python 3.1 sphinx-build isn't up to the job.

Available Python interpreters:
  [1]   python2.5
  [2]   python2.6
  [3]   python2.7
  [4]   python3.1
  [5]   python3.2 *

yields

running install_scripts
>>> Completed installing jinja-2.6 into /mnt/gen2/TmpDir/portage/dev-python/jinja-2.6/image/

builds fine.  Is my understanding correct that $(PYTHON -f --ABI)
is pulling the final of the listed ABIs?  Any eselect python other 3.2 and it pulls 3.1 which it seems has incompatibilities.  Simply substitute 
$(PYTHON -f --ABI) with a hard coded python3.2?
Comment 9 Jan Matějka (RETIRED) gentoo-dev 2013-05-06 15:11:55 UTC
sphinx-1.1.2 is no longer in portage

suggesting resolution OBSOLETE/WONTFIX
Comment 10 Jan Matějka (RETIRED) gentoo-dev 2013-05-07 11:28:13 UTC
fixed by version bump.