-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
add python 3.8, 3.9 support and migration to pytest #3048
Conversation
@honnix @dlstadther @Tarrasch https://travis-ci.org/github/spotify/luigi/jobs/762401923 (I'm sorry for very very dirty and many commits. I'll squash later.) |
@hirosassa 🤔 is py38 also timing out locally? |
@ravwojdyla No, This is just occurred only on travis. |
@hirosassa interesting. Travis has limited support for debugging builds: https://docs.travis-ci.com/user/running-build-in-debug-mode/. But I imagine we can't use that here, in the meantime we could also add |
@ravwojdyla Thank you! I'll try |
@ravwojdyla The cause of timeout is resolving dependencies on python 3.8 and I fixed it. Thanks! |
@hirosassa thanks for the update. Oh wow, there is quite a lot of failures on py38! FYI @lallea since you have mentioned you've been using luigi on py38 in #3046 (comment). There seem to be quite a number of test failures, hopefully that doesn't affect your workloads, just wanted to let you know. |
@hirosassa what do you think is the right way forward? |
@ravwojdyla Thanks for the heads up. Lots of failures, indeed, and on core things. Surprising, since we have not seen any trouble. Works on our machines. :-) |
@ravwojdyla @lallea I fixed almost all of the failures now (most of failures comes from https://travis-ci.org/github/spotify/luigi/builds/762532477 |
That's a huge relief! Really appreciate your work @hirosassa! |
@ravwojdyla @honnix @dlstadther
|
@hirosassa great job!!
So this smells like a regression from the package updates maybe? That test was introduced by b4e4433 as a fix for #2644: Lines 304 to 366 in 7508cdf
has a number of knobs to tweak like the |
Does this directory: |
@ravwojdyla Thank you for your suggestion. I checked existence and writability of the directory by this code, and found the following logs
However, there's no |
@hirosassa that actually might be a red herring. So it seems like |
@ravwojdyla I found the reason |
@hirosassa great news! I wonder if this is a known issue(?) and what's the proper way forward? |
0047737
to
b575b37
Compare
b575b37
to
93b4741
Compare
@Tarrasch @honnix @dlstadther cc @ravwojdyla @lallea |
Great work @hirosassa!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hirosassa looks great, and again great work figuring out all the weird errors!! I only have some questions inline, plus would suggest to open an issue to update test documentation to document pytest
usage going forward.
from hdfs import InsecureClient | ||
from hdfs.ext.kerberos import KerberosClient | ||
except ImportError: | ||
raise unittest.SkipTest('Unable to load hdfs module') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could probably also use pytest.importorskip?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your suggestion! fixed in d4de5fe
test/customized_run_test.py
Outdated
@@ -27,6 +27,7 @@ | |||
|
|||
|
|||
class DummyTask(luigi.Task): | |||
task_namespace = 'customized_run' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this now required? Is this related to path setup between nose and pytest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is for test isolation. There are several DummyTask
in the test
directory.
Since pytest
loads all of the test at the collection phase of the test, the tasks will be conflicted (debugger shows that result).
So I add this namespace to isolate each Task.
Same reason as followings;
https://github.com/spotify/luigi/pull/3048/files#diff-5c8d3f52b8e7946dd9520aeb1b25f24ff2f5c0513c6205922ca8a7a28aec4cd8R32
https://github.com/spotify/luigi/pull/3048/files#diff-487da8575cd13d85c3d44e6b43d7988a2aea0c81479d298248820eb27be5da9bR221
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment in a542dee
@@ -1,25 +1,41 @@ | |||
[tox] | |||
envlist = py{35,36,37}-{cdh,hdp,core,contrib,apache,aws,gcloud,postgres,unixsocket,azureblob,dropbox}, visualiser, docs, flake8 | |||
envlist = py{35,36,37,38,39}-{cdh,hdp,core,contrib,apache,aws,gcloud,postgres,unixsocket,azureblob,dropbox}, visualiser, docs, flake8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
tox.ini
Outdated
LUIGI_CONFIG_PATH={toxinidir}/test/testconfig/luigi.cfg | ||
TEST_VISUALISER=1 | ||
commands = | ||
python --version | ||
nosetests -v --tests=test/visualiser | ||
pytest -m "not minicluster and not gcloud and not postgres and not unixsocket" test/visualiser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why these specific filters here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This filter is counter part of NOSE_EVAL_ATTER
above, but it is not needed. removed it in
013b75f
👋 @lallea do you mind taking a look (review) as well (if you have time) please. I assume you would like to have this in as well :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me.
Could you also update the Readme.md
to denote update to Python versions being tested and "supported"?
@dlstadther Thank you for the review! added in f7053d9 |
All looks good to me, with the reservation that I know little about pytest. Thanks @hirosassa for putting down all this work! |
👍 LGTM, @hirosassa Thanks for the contribution |
Thanks for your comments and reviews! @ravwojdyla @lallea @dlstadther @narape |
@hirosassa thanks for all you great work! Btw, just noticed that it might be also worth updating the setup.py to include python 3.{8,9}. Let me know if that's something you would like to handle as well. |
@ravwojdyla Oh, I missed it. I'll submit small PR to fix this. |
Description
fix #3046, related to #2886, #2939
This PR migrates from nose to pytest and adds python 3.8 and 3.9 support.
Details are as follows
nose
topytest
test/conftest.py
to change test root@attr
decorator intopytest.mark
to group teststox
andtravis
Motivation and Context
pytest migration
nose
is not in active development and several deprecation warnings are occurred.add python 3.8, 3.9 tests
easy to follow latest python versions
Have you tested this? If so, how?
I ran tests locally and on travis, too