Skip to content
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

Hyde cannot install on Python 3 #270

Open
salimfadhley opened this issue Mar 17, 2015 · 25 comments
Open

Hyde cannot install on Python 3 #270

salimfadhley opened this issue Mar 17, 2015 · 25 comments
Projects

Comments

@salimfadhley
Copy link

Build dependencies don't install under Python 3.

I get this error when trying to install hyde:

error: invalid command 'bdist_egg'

/home/mauve/.virtualenvs/pythonjobs3/build/hyde/distribute-0.6.14-py3.4.egg
 Traceback (most recent call last):

File "/home/mauve/.virtualenvs/pythonjobs3/build/hyde/distribute_setup.py", line 143, in use_setuptools

    raise ImportError

ImportError
@shakna-israel
Copy link

Considering #237 has been open for a year, I'd say Hyde is abandoned... MKDocs might fit the bill for pythonjobs.

@llonchj llonchj added this to the Version 0.9.0 milestone May 25, 2015
@jonafato
Copy link
Member

#285 is a duplicate of this, however, it is more detailed. @llonchj one of these two issues should probably be closed to keep discussion happening in one place.

@jonafato
Copy link
Member

I've made some progress porting Hyde's dependencies (see hyde/fswrap#3, hyde/commando#15, and hyde/commando#16). Supporting both language versions shouldn't be difficult. I expect the changeset to be relatively small based on the 2to3 generated changes in #251.

@llonchj
Copy link
Contributor

llonchj commented Aug 23, 2015

Thanks @jonafato will reference #285. Moving 270 into this thread

@jonafato
Copy link
Member

I've made considerable progress toward a Python 3 version. I'm working on a work-in-progress branch that still needs work, but all but a couple of tests are passing. Other than Hyde's source code, the following dependencies need Python 3 compatibility:

  • fswrap
  • commando
  • asciidocapi

AsciiDoc is a tricky one here. There has been considerable and ongoing discussion on the topic of Python 3 compatibility, and there's certainly more work to be done on that front. Given the size and age of the project, it's potentially out of the scope of this ticket. I don't know for sure that this is a blocker given that it's an optional template filter and isn't part of Hyde's core. i.e. if the only blocker ends up being AsciiDoc, which seems to be completely optional (please correct me if I'm wrong on this point) and requires other effort to use anyway, we may be able to move forward and note the caveat (that AsciiDoc support will not work under Python 3) in the documentation.

If others have interest in aiding this effort, any work on #277 would make the test-driven porting process more reliable. Additionally, if I've missed any requirements that need porting, or if there are any other questions / concerns / thoughts on this feature, please list them here.

Initially, once the port is ready, I'd like to release "experimental" support for running Hyde under Python 3. Once a few users in addition to myself have tested it, (hopefully not) uncovered any bugs, and are satisfied with the functionality under both versions, we can call the Python 3 support official, ideally in time for 1.0.0.

More soon...

@navilan
Copy link
Member

navilan commented Sep 1, 2015

@jonafato - Asciidoc is completely optional indeed. We can even change the plugin to use the CLI instead of the API if that works/helps. I will start work on #277 tomorrow.

@jonafato
Copy link
Member

jonafato commented Sep 1, 2015

@lakshmivyas Great, the direction I was leaning was to try to import it when needed and, when under Python 3, raise an exception with a message for the end user explaining that Hyde currently support Python 3, but AsciiDoc does not. Thanks for clearing that up.

@pradyunsg
Copy link

So, what is the status of this issue?

@navilan
Copy link
Member

navilan commented Oct 24, 2015

There is going to be an intermediate release soon to get the current fixes out. Python 3.x compatibiliity and other features are planned for hyde 1.0 release.

@pradyunsg
Copy link

I would suggest that 0.9.0 be the intermediate release and 0.10.0 be the first 3.x compatible release.
Once it's clear that the compatibility is good, then go to 1.0.0.

And 1.0.0 onwards, semantic versioning.

@navilan
Copy link
Member

navilan commented Oct 24, 2015

@pradyunsg - Yes, 0.9.0 is planned. I am not sure about 0.10.0 vs 1.0.0. We'll have to wait and see how the 3.x version turns out. I agree with your suggestion in general though.

@pradyunsg
Copy link

I could lend a hand with the porting, if time permits... I have done so for another (major) codebase.

What's the plan of action for the porting? And tests?

@navilan
Copy link
Member

navilan commented Oct 24, 2015

@pradyunsg - @jonafato has a better understanding of where everything stands.

@navilan
Copy link
Member

navilan commented Oct 24, 2015

As far as tests go, I think what we have is good enough to be confident about the port.

@jonafato
Copy link
Member

I have a Python 3 work-in-progress branch on my fork. I'll do a bit of cleanup on it this weekend and push it to a branch here. Here's the plan that's been in my head:

  1. Get all tests passing on Python 2.7 and Python 3 (likely 3.3 - 3.5)
  2. Release experimental support for Python 3
  3. Encourage testers to try out the new support and report any version-related bugs
  4. Fix any bugs that pop up, and make a new release calling Python 3 support stable

jonafato added a commit that referenced this issue Jan 12, 2016
All tests* currently pass under Python 2.7 and Python 3.3 - 3.5. This
does not mean that Python 3 support is stable, however. As a plan
forward, we should encourage interested users to run Hyde with Python 3,
report bugs, and submit patches. This change references the Python 3
Support issue on GitHub (#270). Once this becomes a bit more tested and
stable, that issue should be closed, and Hyde should announce official,
stable support for Python 3 (i.e. new changes must also support 3,
issues with running hyde under 3 should be considered bugs rather than
feature requests, etc.).

Changes:

- Add ``hyde/_compat.py`` for 2-to-3 compatibility helpers.
- Replace uses of 2-specific code with their ``hyde._compat`` versions.
- Tests remain largely unchanged (for good reason). The exceptions here
  are to ``print`` function calls, and ``str`` type usage, and
  compatibility imports.
- Replace explicit calls to ``foo.next()`` with ``next(foo)``. This
  keeps code portable between Python 2's ``next`` and Python 3's
  ``__next__`` methods without the need for any compatibility functions
  and is the recommended API for interacting with these methods.
- Replace deprecated (and, in Python 3, removed) ``except Exception, e:``
  statements with their updated ``except Exception as e:`` versions.
- Replace print statements with print function calls (because of how
  parentheses work in Python, this is transparently
  cross-version-compatible).
- Add Python 3.3, 3.4, and 3.5 to ``tox.ini``, ``.travis.yml``, and
  classifiers in ``setup.py``.
- Add ``{posargs}`` to ``tox.ini`` command invocations to improve usage
  during development.
- Add Python 3 note in changelog.

* asciidoc does not support Python 3, and fixing that far beyond the
scope of this task, so the test that deals with it is conditionally
skipped when run using versions of Python 3.
jonafato added a commit that referenced this issue Jan 12, 2016
All tests* currently pass under Python 2.7 and Python 3.3 - 3.5. This
does not mean that Python 3 support is stable, however. As a plan
forward, we should encourage interested users to run Hyde with Python 3,
report bugs, and submit patches. This change references the Python 3
Support issue on GitHub (#270). Once this becomes a bit more tested and
stable, that issue should be closed, and Hyde should announce official,
stable support for Python 3 (i.e. new changes must also support 3,
issues with running hyde under 3 should be considered bugs rather than
feature requests, etc.).

Changes:

- Add ``hyde/_compat.py`` for 2-to-3 compatibility helpers.
- Replace uses of 2-specific code with their ``hyde._compat`` versions.
- Tests remain largely unchanged (for good reason). The exceptions here
  are to ``print`` function calls, and ``str`` type usage, and
  compatibility imports.
- Replace explicit calls to ``foo.next()`` with ``next(foo)``. This
  keeps code portable between Python 2's ``next`` and Python 3's
  ``__next__`` methods without the need for any compatibility functions
  and is the recommended API for interacting with these methods.
- Replace deprecated (and, in Python 3, removed) ``except Exception, e:``
  statements with their updated ``except Exception as e:`` versions.
- Replace print statements with print function calls (because of how
  parentheses work in Python, this is transparently
  cross-version-compatible).
- Add Python 3.3, 3.4, and 3.5 to ``tox.ini``, ``.travis.yml``, and
  classifiers in ``setup.py``.
- Add ``{posargs}`` to ``tox.ini`` command invocations to improve usage
  during development.
- Add Python 3 note in changelog.

* asciidoc does not support Python 3, and fixing that far beyond the
scope of this task, so the test that deals with it is conditionally
skipped when run using versions of Python 3.
jonafato added a commit that referenced this issue Jan 12, 2016
All tests* currently pass under Python 2.7 and Python 3.3 - 3.5. This
does not mean that Python 3 support is stable, however. As a plan
forward, we should encourage interested users to run Hyde with Python 3,
report bugs, and submit patches. This change references the Python 3
Support issue on GitHub (#270). Once this becomes a bit more tested and
stable, that issue should be closed, and Hyde should announce official,
stable support for Python 3 (i.e. new changes must also support 3,
issues with running hyde under 3 should be considered bugs rather than
feature requests, etc.).

Changes:

- Add ``hyde/_compat.py`` for 2-to-3 compatibility helpers.
- Replace uses of 2-specific code with their ``hyde._compat`` versions.
- Tests remain largely unchanged (for good reason). The exceptions here
  are to ``print`` function calls, and ``str`` type usage, and
  compatibility imports.
- Replace explicit calls to ``foo.next()`` with ``next(foo)``. This
  keeps code portable between Python 2's ``next`` and Python 3's
  ``__next__`` methods without the need for any compatibility functions
  and is the recommended API for interacting with these methods.
- Replace deprecated (and, in Python 3, removed) ``except Exception, e:``
  statements with their updated ``except Exception as e:`` versions.
- Replace print statements with print function calls (because of how
  parentheses work in Python, this is transparently
  cross-version-compatible).
- Add Python 3.3, 3.4, and 3.5 to ``tox.ini``, ``.travis.yml``, and
  classifiers in ``setup.py``.
- Add ``{posargs}`` to ``tox.ini`` command invocations to improve usage
  during development.
- Add Python 3 note in changelog.

* asciidoc does not support Python 3, and fixing that far beyond the
scope of this task, so the test that deals with it is conditionally
skipped when run using versions of Python 3.
jonafato added a commit that referenced this issue Jan 12, 2016
All tests* currently pass under Python 2.7 and Python 3.3 - 3.5. This
does not mean that Python 3 support is stable, however. As a plan
forward, we should encourage interested users to run Hyde with Python 3,
report bugs, and submit patches. This change references the Python 3
Support issue on GitHub (#270). Once this becomes a bit more tested and
stable, that issue should be closed, and Hyde should announce official,
stable support for Python 3 (i.e. new changes must also support 3,
issues with running hyde under 3 should be considered bugs rather than
feature requests, etc.).

Changes:

- Add ``hyde/_compat.py`` for 2-to-3 compatibility helpers.
- Replace uses of 2-specific code with their ``hyde._compat`` versions.
- Tests remain largely unchanged (for good reason). The exceptions here
  are to ``print`` function calls, and ``str`` type usage, and
  compatibility imports.
- Replace explicit calls to ``foo.next()`` with ``next(foo)``. This
  keeps code portable between Python 2's ``next`` and Python 3's
  ``__next__`` methods without the need for any compatibility functions
  and is the recommended API for interacting with these methods.
- Replace deprecated (and, in Python 3, removed) ``except Exception, e:``
  statements with their updated ``except Exception as e:`` versions.
- Replace print statements with print function calls (because of how
  parentheses work in Python, this is transparently
  cross-version-compatible).
- Add Python 3.3, 3.4, and 3.5 to ``tox.ini``, ``.travis.yml``, and
  classifiers in ``setup.py``.
- Add ``{posargs}`` to ``tox.ini`` command invocations to improve usage
  during development.
- Add Python 3 note in changelog.

* asciidoc does not support Python 3, and fixing that far beyond the
scope of this task, so the test that deals with it is conditionally
skipped when run using versions of Python 3.
jonafato added a commit that referenced this issue Jan 23, 2016
All tests* currently pass under Python 2.7 and Python 3.3 - 3.5. This
does not mean that Python 3 support is stable, however. As a plan
forward, we should encourage interested users to run Hyde with Python 3,
report bugs, and submit patches. This change references the Python 3
Support issue on GitHub (#270). Once this becomes a bit more tested and
stable, that issue should be closed, and Hyde should announce official,
stable support for Python 3 (i.e. new changes must also support 3,
issues with running hyde under 3 should be considered bugs rather than
feature requests, etc.).

Changes:

- Add ``hyde/_compat.py`` for 2-to-3 compatibility helpers.
- Replace uses of 2-specific code with their ``hyde._compat`` versions.
- Tests remain largely unchanged (for good reason). The exceptions here
  are to ``print`` function calls, and ``str`` type usage, and
  compatibility imports.
- Replace explicit calls to ``foo.next()`` with ``next(foo)``. This
  keeps code portable between Python 2's ``next`` and Python 3's
  ``__next__`` methods without the need for any compatibility functions
  and is the recommended API for interacting with these methods.
- Replace deprecated (and, in Python 3, removed) ``except Exception, e:``
  statements with their updated ``except Exception as e:`` versions.
- Replace print statements with print function calls (because of how
  parentheses work in Python, this is transparently
  cross-version-compatible).
- Add Python 3.3, 3.4, and 3.5 to ``tox.ini``, ``.travis.yml``, and
  classifiers in ``setup.py``.
- Add ``{posargs}`` to ``tox.ini`` command invocations to improve usage
  during development.
- Add Python 3 note in changelog.

* asciidoc does not support Python 3, and fixing that far beyond the
scope of this task, so the test that deals with it is conditionally
skipped when run using versions of Python 3.
jonafato added a commit that referenced this issue Jan 26, 2016
All tests* currently pass under Python 2.7 and Python 3.3 - 3.5. This
does not mean that Python 3 support is stable, however. As a plan
forward, we should encourage interested users to run Hyde with Python 3,
report bugs, and submit patches. This change references the Python 3
Support issue on GitHub (#270). Once this becomes a bit more tested and
stable, that issue should be closed, and Hyde should announce official,
stable support for Python 3 (i.e. new changes must also support 3,
issues with running hyde under 3 should be considered bugs rather than
feature requests, etc.).

Changes:

- Add ``hyde/_compat.py`` for 2-to-3 compatibility helpers.
- Replace uses of 2-specific code with their ``hyde._compat`` versions.
- Tests remain largely unchanged (for good reason). The exceptions here
  are to ``print`` function calls, and ``str`` type usage, and
  compatibility imports.
- Replace explicit calls to ``foo.next()`` with ``next(foo)``. This
  keeps code portable between Python 2's ``next`` and Python 3's
  ``__next__`` methods without the need for any compatibility functions
  and is the recommended API for interacting with these methods.
- Replace deprecated (and, in Python 3, removed) ``except Exception, e:``
  statements with their updated ``except Exception as e:`` versions.
- Replace print statements with print function calls (because of how
  parentheses work in Python, this is transparently
  cross-version-compatible).
- Add Python 3.3, 3.4, and 3.5 to ``tox.ini``, ``.travis.yml``, and
  classifiers in ``setup.py``.
- Add ``{posargs}`` to ``tox.ini`` command invocations to improve usage
  during development.
- Add Python 3 note in changelog.

* asciidoc does not support Python 3, and fixing that far beyond the
scope of this task, so the test that deals with it is conditionally
skipped when run using versions of Python 3.
@CrustyBarnacle
Copy link

CrustyBarnacle commented Apr 29, 2016

ImportError: No module named 'UserDict' <-- Doesn't exist in Python3.x
http://python3porting.com/problems.html#replacing-userdict

model.py
from collections import UserDict # UserDict.IterableUserDict replaced by collections.UserDict

site.py

from urllib import parse # replaced urlparse
from functools import wraps
#from urllib import quote

exceptions.py

    @staticmethod
    def reraise(message, exc_info):
        _, _, tb = exc_info
        reraise(HydeException, HydeException(message), tb)

layout.py

    #layouts_folder = Folder(unicode(root)).child_folder(LAYOUTS)
    layouts_folder = Folder(root).child_folder(LAYOUTS)

@CrustyBarnacle
Copy link

CrustyBarnacle commented Apr 29, 2016

And, with those changes above:

$ hyde -v -s ../awesome-adventure-blog create
 13:19:37 hyde Creating site at [/Users/<user>/Projects/awesome-adventure-blog] with layout [/Users/<user>/Projects/hyde/lib/python3.4/site-packages/hyde/layouts/basic]
 13:19:37 hyde Site creation complete

@jonafato
Copy link
Member

@CrustyBarnacle are you using the master branch? Hyde currently supports Python 2 and Python 3 (see #307), so if something is not working in master, it's a bug.

(Note: there has not been a release including these changes yet. I'll try to make this happen in the next couple of days.)

@CrustyBarnacle
Copy link

CrustyBarnacle commented Apr 29, 2016

@jonafato Currently using what pip installed.

(hyde) <host>:hyde <user>$ pip show hyde
---
Name: hyde
Version: 0.8.9
Location: /Users/<user>/Projects/hyde/lib/python3.4/site-packages
Requires: fswrap, commando, PyYAML, Markdown, MarkupSafe, Pygments, typogrify, smartypants, Jinja2

Can I just uninstall with pip and then... ?
Reading... Pip docs - User Guide

Hope one of these options is what I'm looking for:
Pip docs - Git

[-e] git+git://git.myproject.org/MyProject#egg=MyProject
[-e] git+https://git.myproject.org/MyProject#egg=MyProject
[-e] git+ssh://git.myproject.org/MyProject#egg=MyProject
-e git+git@git.myproject.org:MyProject#egg=MyProject

<username>$ pip install -e git+https://github.com/hyde/hyde.git#egg=hyde did the trick!

@alensiljak
Copy link

The installation is now painless but there are issues running the server. And, by the looks of it, not all code in the stack is Python 3 compatible.

@rsmath
Copy link

rsmath commented May 20, 2019

Is there a Hyde Python3 version on GitHub available for download and ready for use? It would be a dream come true

@Descent098
Copy link
Member

@ramanshsharma2806 I know it's been almost a year since your comment, but for anyone else who finds this issue I have taken up a role as a maintainer on Hyde and will be actively working on a 1.0.0 branch to fix Python 3 support. To just get to the point of being able to use Hyde's basic features the fix proposed in #326 (comment) should resolve outstanding issues for installation along with most of the basic commands, but more rigorous fixes will be coming in 1.0.0

@Descent098
Copy link
Member

Since this commit is the one i'm using on the project board I will use this commit as the primary hub for collecting information for 1.0.0.

It looks like there are two branches that fix various incompatabilities and are worth a look during 1.0.0 development:

#251 & #324

Additionally The issue mentioned in #326 should be resolved when a PR to resolve all the issues mentioned is created.

@ARONDALTON
Copy link

I'm new to this all, but just in case it helps anyone else. I got hyde working on python 3.5 by:
cloning the repo,
switching to branch v0.9.0,
and open an anaconda3 cmd promt,
creating a conda env python=3.5 and activate ,
cd to my cloned directory above,
and typing pip install -e . (now installed in "development mode").

Works great! Thanks to all the great people putting there life-hours in to this, so we can all win. Best to you all!

@navilan
Copy link
Member

navilan commented Jun 3, 2020

I'm new to this all, but just in case it helps anyone else. I got hyde working on python 3.5 by:
cloning the repo,
switching to branch v0.9.0,
and open an anaconda3 cmd promt,
creating a conda env python=3.5 and activate ,
cd to my cloned directory above,
and typing pip install -e . (now installed in "development mode").

Works great! Thanks to all the great people putting there life-hours in to this, so we can all win. Best to you all!

Great work @Descent098 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
V 1.0.0
  
To do
Development

No branches or pull requests