Dear Kwant users, I am looking to port Kwant 1.0.4 to Python 3 ahead of the development work on Kwant 2.0, which will begin soon. Kwant 2.0 will be fully Python 3 from the start, and so it will be useful to have the existing Kwant 1.x as Python 3 to serve as a base for Kwant 2.0. In addition, any users who want to use Python 3 straight away (a requested feature in the survey) would be able to do so without having to wait for Kwant 2.0. I would like to start a discussion about which version of Python 3 Kwant should support. Below I will outline the the status of support for Python 3 on various platforms, as well as my proposal. The status of Python 3 ---------------------- Python 3 is the preferred [1] version of the Python programming language for applications in current development. The current stable version of Python 3 is version 3.4, and was released in March 2014. Windows and Mac OS X installers for this version have been available since release [2], in addition the Anaconda distribution has been shipping installers for Python 3.4 since version 2.0. For popular Linux distributions the Python 3 package is already version 3.4 by default, even in releases more than a year old[3-6]. The notable exception is Debian old-stable (Wheezy) which still has Python 3.2. Proposal -------- I propose that Kwant 1.x (and subsequently Kwant 2.x) depend on Python version 3.4, as opposed to 3.2 or some even older version. For Windows and OS X the current standard download proposed on python.org is version 3.4, so any users on those platforms will just have to choose the default. For users who are still on Debian old-stable (e.g. users who don't control their computing environment where the admins have not yet updated to stable) this would mean that they cannot use the Python 3 version of Kwant or Kwant 2. I think this is a reasonable trade off. The Python 3 release of Kwant 1.x will not add any new features or bug fixes, so users on old-stable will not be inconvenienced; they will just have to keep using the Python 2 version of Kwant 1.x. The development of Kwant 2.0 will in any case take some time, which will give any users on old-stable the chance to upgrade to current stable. In any case old-stable becomes unsupported in less than a year. Anyone with a strong preference either way is encouraged to reply to this thread. Happy kwanting, Joe References ---------- [1]: https://wiki.python.org/moin/Python2orPython3 [2]: https://www.python.org/downloads/ [3]: For ubuntu, since 14.04 http://packages.ubuntu.com/search?keywords=python3.4 [4]: For Debian, on current stable (Jessie) https://packages.debian.org/eo/jessie/python3 [5]: For OpenSuse since 13.2, for Fedora since 21 http://rpmfind.net/linux/rpm2html/search.php?query=python3
Hi Joe, I think it’s OK if we require Python 3.4 for the Python 3 version of Kwant. This decision would only hurt people who are keen to use Python 3 with Kwant now, but who for some reason are bound to older versions of it. And these (very few or none, I suppose) people can just continue to use Python-2-based Kwant a bit longer. Christoph
Dear all, Here's an update on the progress. The Python 3 port is complete, all tests pass (on my machine) and the docs build. You can find these changes on my Github: https://github.com/jbweston/kwant/tree/python3 Although the tests run on my machine, I haven't tested it anywhere else yet so we'll have to hold off making an official release until we can test on all supported platforms. If anyone wants to help out with testing it would be much appreciated. For anyone on OS X or Linux I have a script which sets up a Python 3 virtual environment and installs all the Kwant dependencies into it. You can get the script here: https://github.com/jbweston/kwant-dev-tools just run "create_python3_env.sh" in the root of the Kwant repository you cloned (on the python3 branch of course!). Note that the script might take a while as it has to download a number of python packages to build Kwant against. Once the script has completed, just activate the virtual environment, install kwant into it and run the tests: source python3-env/bin/activate python setup.py install cd .. python -c 'import kwant; kwant.test()' Note that we need to come out of the Kwant repository in order to actually run the tests, or Kwant will complain. If anyone does try to test, if they could reply to this thread with output/problems it would be much appreciated Happy kwanting, Joe On 7 August 2015 at 14:29, Christoph Groth <christoph.groth@cea.fr> wrote:
Hi Joe,
I think it’s OK if we require Python 3.4 for the Python 3 version of Kwant. This decision would only hurt people who are keen to use Python 3 with Kwant now, but who for some reason are bound to older versions of it. And these (very few or none, I suppose) people can just continue to use Python-2-based Kwant a bit longer.
Christoph
Hi Joe, Great work! It runs for me on ubuntu 15.04. I noticed that if you want to install everything not in a venv, you need to modify more things. You can cherry-pick the commits 9b14b15d and 0e5c4491 (those are py3-specific and aren't about me messing with the plotter) from my master branch on https://gitlab.com/anton-akhmerov/kwant. Best, Anton On Sat, Aug 8, 2015 at 11:26 PM, Joseph Weston <joseph.weston08@gmail.com> wrote:
Dear all,
Here's an update on the progress. The Python 3 port is complete, all tests pass (on my machine) and the docs build. You can find these changes on my Github:
https://github.com/jbweston/kwant/tree/python3
Although the tests run on my machine, I haven't tested it anywhere else yet so we'll have to hold off making an official release until we can test on all supported platforms.
If anyone wants to help out with testing it would be much appreciated. For anyone on OS X or Linux I have a script which sets up a Python 3 virtual environment and installs all the Kwant dependencies into it. You can get the script here:
https://github.com/jbweston/kwant-dev-tools
just run "create_python3_env.sh" in the root of the Kwant repository you cloned (on the python3 branch of course!). Note that the script might take a while as it has to download a number of python packages to build Kwant against. Once the script has completed, just activate the virtual environment, install kwant into it and run the tests:
source python3-env/bin/activate python setup.py install cd .. python -c 'import kwant; kwant.test()'
Note that we need to come out of the Kwant repository in order to actually run the tests, or Kwant will complain.
If anyone does try to test, if they could reply to this thread with output/problems it would be much appreciated
Happy kwanting,
Joe
On 7 August 2015 at 14:29, Christoph Groth <christoph.groth@cea.fr> wrote:
Hi Joe,
I think it’s OK if we require Python 3.4 for the Python 3 version of Kwant. This decision would only hurt people who are keen to use Python 3 with Kwant now, but who for some reason are bound to older versions of it. And these (very few or none, I suppose) people can just continue to use Python-2-based Kwant a bit longer.
Christoph
Thanks Anton, I've cherry picked the relevant commits and they're on my python3 branch: https://github.com/jbweston/kwant/tree/python3 Thanks, Joe On 10 August 2015 at 11:08, Anton Akhmerov <anton.akhmerov@gmail.com> wrote:
Hi Joe,
Great work! It runs for me on ubuntu 15.04. I noticed that if you want to install everything not in a venv, you need to modify more things. You can cherry-pick the commits 9b14b15d and 0e5c4491 (those are py3-specific and aren't about me messing with the plotter) from my master branch on https://gitlab.com/anton-akhmerov/kwant.
Best, Anton
On Sat, Aug 8, 2015 at 11:26 PM, Joseph Weston <joseph.weston08@gmail.com> wrote:
Dear all,
Here's an update on the progress. The Python 3 port is complete, all tests pass (on my machine) and the docs build. You can find these changes on my Github:
https://github.com/jbweston/kwant/tree/python3
Although the tests run on my machine, I haven't tested it anywhere else yet so we'll have to hold off making an official release until we can test on all supported platforms.
If anyone wants to help out with testing it would be much appreciated. For anyone on OS X or Linux I have a script which sets up a Python 3 virtual environment and installs all the Kwant dependencies into it. You can get the script here:
https://github.com/jbweston/kwant-dev-tools
just run "create_python3_env.sh" in the root of the Kwant repository you cloned (on the python3 branch of course!). Note that the script might take a while as it has to download a number of python packages to build Kwant against. Once the script has completed, just activate the virtual environment, install kwant into it and run the tests:
source python3-env/bin/activate python setup.py install cd .. python -c 'import kwant; kwant.test()'
Note that we need to come out of the Kwant repository in order to actually run the tests, or Kwant will complain.
If anyone does try to test, if they could reply to this thread with output/problems it would be much appreciated
Happy kwanting,
Joe
On 7 August 2015 at 14:29, Christoph Groth <christoph.groth@cea.fr> wrote:
Hi Joe,
I think it’s OK if we require Python 3.4 for the Python 3 version of Kwant. This decision would only hurt people who are keen to use Python
3
with Kwant now, but who for some reason are bound to older versions of it. And these (very few or none, I suppose) people can just continue to use Python-2-based Kwant a bit longer.
Christoph
participants (4)
-
Anton Akhmerov
-
Christoph Groth
-
Joseph Weston
-
Joseph Weston