-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Py3k #745
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
Py3k #745
Conversation
|
Wow, this looks like quite an endeavour! Will it still be compatible with python 2.6? Because that is what Spotify (the maintainers) is currently using ... |
|
Travis runs tests on 2.6 so assuming the tests work I say let's merge |
|
|
1 similar comment
|
|
|
@Tarrasch seems not :( . I will need to find a way to install 2.6 to be able to run the test locally (not in gentoo tree anymore). It passes under 2.7. |
|
Yep. It would also be worthwhile to add a 3.x-something target to the Travis build matrix. Ah, well, I would also happily merge this if you can fix the 2.6 bug Travis reports. But it seems to be easy, all stacktraces seem to be about the same error no? https://travis-ci.org/spotify/luigi/jobs/50669429 |
|
Yeah assuming we can get this working let's add 3.1 and 3.2 to Travis builds |
|
I set up a python 2.6 environment. I will try to fix the bug with the atomic_file. For Travis, isn't it a little early? As I said in my first comment, the majority of the test are still failing. For the python3 version, I would rather target 3.3 and 3.4. It's easier to support those version and I doubt there is still people using 3.1 and 3.2. People stick with 2.x or upgraded to 3.3 - 3.4 [citation needed]. |
|
Did you look at the Travis output? You probably just have to figure out a workaround for Yeah I didn't mean setting up Travis yet. But we might as well merge the tests as soon as they work with 2.6 & 2.7 Sure let's do 3.3 and 3.4. I'm not super familiar with Python 3 versions |
|
This all sounds sane. :) |
|
|
|
|
|
|
1 similar comment
|
|
|
|
|
|
|
|
|
I fixed the atomic_file, Travis is happy now. I also continue the effort to port to python3. There is still many tests that fail, but the Top10Artists example seems to work. ( |
|
Nice that this passes! Do you want us to merge this so you don't get conflicts or do you want to make it work for 3.x first? (and then please also add the version to the build matrix) |
still doesn't work thou also fix all iteritems on dict
The job still failed the the fail is detected and we try to send emails
58 errors 10 failures
Allow those tests to fail
|
I added python 3.3 and 3.4 to the build matrix, but allowed failure. Feel free to merge this branch. It will indeed make conflict resolution easier. I'll create another branch |
|
|
Py3k Note. Python 3 does *not* work yet. Tests are failing and we've just white listed that in Travis.
|
Thanks! Looking forward for you test-fixing patches! :) |
|
@Tarrasch @erikbern I realized that I might have overlooked the issues with the Target/IO (ie.: atomic_file). Python 3 force you to make the distinction between unicode and bytes (bytes=str for python2 and unicode=str for python3), however Luigi currently doesn't distinguish between this two concepts . There is many ways to solve this issue, however the choice of the solution will have an impact on Luigi API so I just wanted to be sure you are comfortable with the solution I suggest. Python offer two file modes, text and binary. In python2 the text mode only convert the character My suggestion to overcome this issue would be to support both mode having an interface similar to python3. The target that support IO interface could be open in 4 different modes ( advantage:
inconvenient:
There's probably some work around that is possible to apply to overcome the first inconvenient if ever it's an issue. The other solution would be to continue to support only the text mode for python2 and support only the binary mode for python3. I'm ready to make the extra effort to support the both modes in the current targets that support the IO interface and to add the relevant test. Any thought? |
|
Thanks for the summary! I'm for your solution. You should awaits @erikbern s opinion though. Hey, @themalkolm , you're our most active Windows user I suppose, would you be sad if we assumed |
|
TL;DR; Yep, it makes me sad. |
|
@themalkolm You can upgrade to python 3.x and you won't have any problems afaict. :) |
|
@Tarrasch sure, or we can face the fact that files are different in python2 and python3 and do not try to hide it in any way with extra logic or abstraction. |
|
Just to be clear. It would still be possible to deal with text on system that doesn't have Note that it might break some code using text file on platform that doesn't use |
|
@themalkolm In fact, it would require more logic and abstraction to recreate the python2 file interface for python2 and the python3 file interface for python3. On the other hand, the solution that I suggest would only require to explicitly specify if the file is a text file or a binary file to make sure that the code is compatible on all platform and on all python version. It would also be possible to detect if the system doesn't use |
|
@themalkolm Can you run the following snippet and say me if you get the expected newline for windows? If it works, it shouldn't be too difficult to deal with newline character on python2 with platform that doesn't have import io
f = io.BufferedWriter(io.FileIO('test123', 'w'))
f.write('this\nis\na\ntest\n')
f.close() |
|
Nope, only \n is there. On Sun, Feb 15, 2015 at 3:23 PM, Guillaume Poulin notifications@github.com
Regards, |
First step to at python3 support. Majority of tests still fail but Luigi can be imported in python3. The code still run just fine in python2, the only limitation is an extra dependency on six.