-
Notifications
You must be signed in to change notification settings - Fork 652
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
support python3 #260
Comments
Hi Hai, I'm definitely on board to help port to python 3. I'm not an expert, but I think six is really useful for 2.5+, and I think we only support 2.6 onwards? @orbeckst ? So I think we have less potential headaches anyway. Truth be told, I'm not 100% sure on what the limiting factor is on the port... I know we still use some relative imports (ie. import core) in the package, but that's all I'm really aware of. |
On 29 Apr, 2015, at 00:46, Richard Gowers wrote:
Yes, we only support 2.6+.
See the other issues that I tagged with Python3 � but @seb-buch had been looking into it recently. Oliver Beckstein * [email protected] |
Apparently you can remove all |
this is what I did for pytraj when make it compat with 2 and 3.
def _import(modname):
"""has_numpy, np = _import('numpy')"""
has_module = False
try:
imported_mod = __import__(modname)
has_module = True
return (has_module, imported_mod)
except ImportError:
has_module = False
return (has_module, None) |
Hi,
|
Are there any other obvious blockers to support python 3? |
If I remember correctly, |
Otherwise, you can try running the unit tests in a py3 environment and see what breaks and make a list here. Our test coverage is pretty good, so I think we can use that. |
I've setup a Py3 virtual-env. There are two things needed to get the tests to run in py3 GridDataFormat To install it I needed remove ez_setup.py and depend on the user installed setuptools. C-Extensions Likely most of the C-Extensions have to be rewritten to support 2 and 3 and the same time. Cython does this automatically. They are using macros to determine with which python version the extension is compiled. I'm not sure about SWIG since I have never used it. |
So for GridData, we can accept PRs for that too to make it py3 compatible. For the C extensions, I think it's best to work through them one by one (or make a table of Extension against Language). The Cython and Swig should be ok, and any CPython should be rewritten into Cython |
Please open an issue for GridDataFormats to use six... or whatever is needed to make it work with Py3. Thanks! |
https://github.com/MDAnalysis/mdanalysis/wiki/List-of-extensions So I think the main blocking thing currently is our extensions, I've made a list of them and their current state. |
So some good news. After having a python3 version for GridDataFormats I can actually run the complete setup for MDAnalysis under python 3. I still can't import it successfully because of syntax errors and some other small things which I will slowly work through. btw did I see it right that NamedStream is only used for testing the library? If so I would like to remove it since the class cannot be constructed in python3 (Which is due to either/both of the base classes now being implemented in C instead of python). |
Yeah it looks like you're making progress which is awesome. Once we've got 0.11.0 out the door we can add py3 into the travis build matrix (but allow it to fail) and gradually patch it up. |
awesome. |
You can follow my progress to get the library load and tests to run here. https://github.com/kain88-de/mdanalysis/tree/python3 After this I should have a pretty good overview of MDAnalysis and a long wishlist for refactoring. |
Btw, why is it not possible to implement |
@orbeckst It was not possible to have the two base classes since they are now implemented in C and different layout in the underlying python dict. But it seems to be enough to just depend on |
replaced cmp with lt & eq Required for Issue #260
Looks like ubuntu is starting to move away from python 2.7 for good. http://summit.ubuntu.com/uos-1511/meeting/22568/python3-only-on-the-images/ |
Am Nov 5, 2015 um 3:11 schrieb kain88-de [email protected]:
|
Issue #260 Partial python 3 compatibility
Anyone, please feel free to try this. I likely have no time for it.
I might do that. However my initial motivation with simpletraj was to have a package with minimal dependencies so that it is easier to install. |
Issue #260 More python 3 compatibility fix
While testing a python3 installation (
The install seems to continue just fine, and I can import |
This is going to happen this summer, also thanks to NumFOCUS: http://www.mdanalysis.org/2017/06/03/numfocus-grant/ |
@MDAnalysis/coredevs so Py3 is probably finished today! Should we also make 3.6 our default python development version? Ie run coverage and minimal builds on 3.6 rather than 2.7 as we currently do. This would then relegate 2.7 to something we support, but not develop around |
As long as we keep builds for 2.7 around I'm for that. I would also suggest to support python 3.5 and maybe 3.4. (Something along the lines of the last 2-3 stable releases) |
Also @richardjgowers & @tylerjereddy you are making awesome progress! |
@kain88-de, since our userbase can't use MDAnalysis with python 3 right now, there's probably little code to break if we directly start supporting only python 3.6. It'd save us yet a couple more worries with compatibility code... Or do you think skipping python 3.4 and 3.5 will leave out many users? |
What does ubuntu LTS have right now? CentOS 7 (latest) has python 3.4. Someone who doesn't use conda but a system python and a long term support OS will likely not have 3.6 and we would exclude those from upgrading to use python 3. |
Ah, of course, it makes sense not to force the users to upgrade python version just for running MDAnalysis. |
Then I suggest we aim for
Should we add a Travis cron job for tests on 3.4 and 3.5, maybe they don't have to run every time? |
Those seems like good targets. In the future, dropping 3.4 and 3.5 support can be done along Python's EOL timeline, although I realize some adjustment might be needed to allow for for lagging LTS distros. |
Wow! I turn my head for 24 hours and it is a frenzy here! Good works guys! I am all in favour of making python 3 our primary target; especially to encourage us, developer, to use MDAnalysis on python 3. For the Python 3 Statement, I would wait for 0.17.0 to be released as it would let us some time to actually experience python 3. |
Btw did anyone check if our examples in the docs work on Python 3? |
https://travis-ci.org/MDAnalysis/mdanalysis/builds/254989078 Ok py3.6 build is passing! |
I feel this momentous moment deserves an announcement... maybe at the end of the week when we see what else @richardjgowers and @tylerjereddy will have accomplished. |
We're busy porting the library to perl right now
…On Wed, 19 Jul 2017, 3:41 p.m. Oliver Beckstein, ***@***.***> wrote:
I feel this momentous moment deserves an announcement... maybe at the end
of the week when we see what else @richardjgowers
<https://github.com/richardjgowers> and @tylerjereddy
<https://github.com/tylerjereddy> will have accomplished.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#260 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AI0jB6167jiD4QegVAD_e-dfq3W3lYlwks5sPoYEgaJpZM4ELMru>
.
|
Hi,
(from recent issue) I know that mdanalysis does not support Python3 yet. But I think mdanalysis dev should consider update the code to compat with Python3. I've been playing with mdanalaysis for a while but it's a bit inconvenient to switch back to Python2 to use mdanalysis. (of course thing's easier with
conda
).if mdanalysis does not heavily depend on external libraries that only work with python2, I think it's quick to use mdanalysis for both 2 and 3 version. I did this with my pytraj with the help from
six.py
module.If you guys want to make compat and need suggestion, I could help.
cheers.
Hai
The text was updated successfully, but these errors were encountered: