Skip to content

Support python 3 #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fibichrj opened this issue Oct 31, 2011 · 16 comments
Closed

Support python 3 #132

fibichrj opened this issue Oct 31, 2011 · 16 comments
Labels
Improvement Minor improvement to code

Comments

@fibichrj
Copy link

Hi, I'm in struggle with this build error via RTFD we get on 'csjark' project, 'master' branch . It seems it concerns the Python v3 syntax we use in the project.
The builder doesn't like

values = {p.flag: p.name for name, p in self.platforms.items()}

as it seems to be Python syntax since v3.0.1 - PEP 0274.
The build completes fine via Sphinx 1.1.

Exception occurred:
  File "/home/docs/sites/readthedocs.org/lib/python2.6/site-packages/sphinx/ext/autosummary/__init__.py", line 456, in _import_by_name
    __import__(modname)
  File "/home/docs/sites/readthedocs.org/checkouts/readthedocs.org/user_builds/csjark/checkouts/latest/CSjark/csjark/dissector.py", line 759
    values = {p.flag: p.name for name, p in self.platforms.items()}
                               ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "/home/docs/sites/readthedocs.org/bin/sphinx-build", line 8, in <module>
    load_entry_point('Sphinx==1.1', 'console_scripts', 'sphinx-build')()
  File "/home/docs/sites/readthedocs.org/lib/python2.6/site-packages/sphinx/__init__.py", line 72, in main
    return cmdline.main(argv)
  File "/home/docs/sites/readthedocs.org/lib/python2.6/site-packages/sphinx/cmdline.py", line 216, in main
    tbpath = save_traceback()
  File "/home/docs/sites/readthedocs.org/lib/python2.6/site-packages/sphinx/util/__init__.py", line 179, in save_traceback
    platform.python_version(),
AttributeError: 'module' object has no attribute 'python_version'
@ericholscher
Copy link
Member

Yea, we don't support python3 yet. It's on the list, as Sphinx's latest release just started supporting it.

@bgw
Copy link

bgw commented Apr 4, 2012

Any updates on Python 3 support?

@hgrecco
Copy link

hgrecco commented Jul 13, 2012

Being able to build the docs in Python 3 will be great. If problematic, requiring a virtualenv instalation where the interpreter is specified might be a simpler way out.

@jluttine
Copy link

any news on this? this would be an important feature...

@swernerx
Copy link

Would be interested as well in Python3 support for Jasy (http://github.com/zynga/jasy)

@yeiniel
Copy link
Contributor

yeiniel commented Dec 11, 2012

I have a project that target Python v3 as platform and I'm interest on this issue, so i will try to solve the issue myself (i already fork the rtd project). rtdf Developers, if you have any idea or suggestion that make my possible solution more attractive to you, contact me please.

@ericholscher
Copy link
Member

Sure.

The main issue here is just calling out to Python3 on the backend with
Sphinx. RTD itself doesn't need to be ported to Python 3 (though that would
be cool too!).

So, adding a basic configuration on the Project for Python Version (2 or
3), and then having the doc_builder/backends/* resprect that when calling
out to Sphinx should do it.

The prod systems are running on Ubuntu, so I think just changing the
virtualenv and creating it with python 3 should Just Work.

On Tue, Dec 11, 2012 at 7:59 AM, Yeiniel Suárez Sosa <
[email protected]> wrote:

I have a project that target Python v3 as platform and I'm interest on
this issue, so i will try to solve the issue myself (i already fork the rtd
project). rtdf Developers, if you have any idea or suggestion that make my
possible solution more attractive to you, contact me please.


Reply to this email directly or view it on GitHubhttps://github.com//issues/132#issuecomment-11249184.

Eric Holscher
Engineer at Urban Airship in Portland, Or
http://ericholscher.com

@hgrecco
Copy link

hgrecco commented Dec 11, 2012

I recently tested one of my projects in Python 3.3. While all the code was
working, I was not able to build the documentation due to a problem with
sphinx. Something similar was reported here:

http://sourceforge.net/tracker/index.php?func=detail&aid=3541369&group_id=38414&atid=422030

I do not know if this is fixed but you might want to do all your tests with
Python 3.2 if you are not sure.

Hernan

On Tue, Dec 11, 2012 at 5:13 PM, Eric Holscher [email protected]:

Sure.

The main issue here is just calling out to Python3 on the backend with
Sphinx. RTD itself doesn't need to be ported to Python 3 (though that
would
be cool too!).

So, adding a basic configuration on the Project for Python Version (2 or
3), and then having the doc_builder/backends/* resprect that when calling
out to Sphinx should do it.

The prod systems are running on Ubuntu, so I think just changing the
virtualenv and creating it with python 3 should Just Work.

On Tue, Dec 11, 2012 at 7:59 AM, Yeiniel Suárez Sosa <
[email protected]> wrote:

I have a project that target Python v3 as platform and I'm interest on
this issue, so i will try to solve the issue myself (i already fork the
rtd
project). rtdf Developers, if you have any idea or suggestion that make
my
possible solution more attractive to you, contact me please.


Reply to this email directly or view it on GitHub<
https://github.com/rtfd/readthedocs.org/issues/132#issuecomment-11249184>.

Eric Holscher
Engineer at Urban Airship in Portland, Or
http://ericholscher.com


Reply to this email directly or view it on GitHubhttps://github.com//issues/132#issuecomment-11249789.

@jodal
Copy link
Member

jodal commented Dec 11, 2012

Would it make sense to make the "Python version" choice a bit more generic than just "2" or "3"?

Maybe make it a select list which could include for example "PyPy" if there are projects that requires PyPy and thus needs to build docs on it to include autodocs.

@yeiniel
Copy link
Contributor

yeiniel commented Dec 12, 2012

I have tested this recently and the problem is already solved. It was
a bug on docutils.

Yeiniel

On 12/11/12, Hernan Grecco [email protected] wrote:

I recently tested one of my projects in Python 3.3. While all the code was
working, I was not able to build the documentation due to a problem with
sphinx. Something similar was reported here:

http://sourceforge.net/tracker/index.php?func=detail&aid=3541369&group_id=38414&atid=422030

I do not know if this is fixed but you might want to do all your tests with
Python 3.2 if you are not sure.

Hernan

On Tue, Dec 11, 2012 at 5:13 PM, Eric Holscher
[email protected]:

Sure.

The main issue here is just calling out to Python3 on the backend with
Sphinx. RTD itself doesn't need to be ported to Python 3 (though that
would
be cool too!).

So, adding a basic configuration on the Project for Python Version (2 or
3), and then having the doc_builder/backends/* resprect that when calling
out to Sphinx should do it.

The prod systems are running on Ubuntu, so I think just changing the
virtualenv and creating it with python 3 should Just Work.

On Tue, Dec 11, 2012 at 7:59 AM, Yeiniel Suárez Sosa <
[email protected]> wrote:

I have a project that target Python v3 as platform and I'm interest on
this issue, so i will try to solve the issue myself (i already fork the
rtd
project). rtdf Developers, if you have any idea or suggestion that make
my
possible solution more attractive to you, contact me please.


Reply to this email directly or view it on GitHub<
https://github.com/rtfd/readthedocs.org/issues/132#issuecomment-11249184>.

Eric Holscher
Engineer at Urban Airship in Portland, Or
http://ericholscher.com


Reply to this email directly or view it on
GitHubhttps://github.com//issues/132#issuecomment-11249789.


Reply to this email directly or view it on GitHub:
#132 (comment)

Yeiniel Suarez Sosa
Automatic Control Engeneer
"Camilo Cienfuegos" Oil Refinery
Cuba

@yeiniel
Copy link
Contributor

yeiniel commented Dec 17, 2012

please review the pull request maded to solve this problem.

@hgrecco
Copy link

hgrecco commented Jan 3, 2013

@yeiniel: I was not able to see your pull request in the list. Is it still pending or has been accepted?

@yeiniel
Copy link
Contributor

yeiniel commented Jan 3, 2013

the pull request has been accepted but i tested on the rtfd site and
dont work, i assume from the status messages the problem is that the
virtualenv module need to be installed on every python interpreter on
the host (as explained here
#311 (comment))
because now the virtual environment creation is done using python -m virtualenv but with the python interpreter selected on the project
import form.

I don't know if Eric Holscher read the latest comment on the pull
request, maybe he stop following the pull request once he accepted it.
Please contact Eric Holscher and make him aware of this.

best regards
Yeiniel Suarez Sosa

On 1/3/13, Hernan Grecco [email protected] wrote:

@yeiniel: I was not able to see your pull request in the
list. Is it still pending
or has been accepted?


Reply to this email directly or view it on GitHub:
#132 (comment)

Yeiniel Suarez Sosa
Automatic Control Engeneer
"Camilo Cienfuegos" Oil Refinery
Cuba

@wraithan
Copy link
Contributor

We are presently looking into this.

@ericholscher
Copy link
Member

This should hopefully be working now -- can someone please test it?

ericholscher added a commit that referenced this issue Aug 22, 2013
@ericholscher
Copy link
Member

This should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

9 participants