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

[KED-3043] Add support for Python 3.10 #1275

Merged
merged 19 commits into from
Feb 25, 2022
Merged

[KED-3043] Add support for Python 3.10 #1275

merged 19 commits into from
Feb 25, 2022

Conversation

merelcht
Copy link
Member

@merelcht merelcht commented Feb 22, 2022

Description

Add support for Python 3.10

Development notes

Significant things to note:

  1. moto had to be updated to a newer version, however when the tests are run in parallel either test_incremental_dataset or test_partioned_dataset would fail intermittently, so I changed the tests to not be run in parallel anymore. This might not be an ideal solution, because it adds run time of about 4 mins to each unit test build. The lower version of moto could still be used for Python versions < 3.10, but the 3.10 build would then still fail if run in parallel.
  2. For Python 3.10 matplotlib>=3.5 is needed, which breaks holoviews. I've disabled the holoviews tests for Python 3.10, but also had to ignore that dataset from the test coverage check in pyproject.toml.
  3. Pylint gives different results for python versions < 3.10 compared to python 3.10. I've opened an issue on the pylint repo: Issues accessing PurePath.parents by index in Python 3.10 pylint-dev/pylint#5832 My suggestion for now is just mark the lint-3.10 build as not required.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the RELEASE.md file
  • Added tests to cover my changes

Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
@merelcht merelcht marked this pull request as ready for review February 23, 2022 14:54
@merelcht merelcht self-assigned this Feb 23, 2022
Copy link
Contributor

@antonymilne antonymilne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

On the parallelisation of unit tests: I don't really mind the slowdown, but it would be possible to run all of them in parallel apart from 3.10. You'd need to add a when/unless clause into the unit_tests job a bit like we have here (only in main, not develop): https://github.com/kedro-org/kedro/blob/main/.circleci/continue_config.yml#L231-L244

features/environment.py Outdated Show resolved Hide resolved
tests/extras/datasets/holoviews/test_holoviews_writer.py Outdated Show resolved Hide resolved
tests/io/test_incremental_dataset.py Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
Co-authored-by: Antony Milne <49395058+AntonyMilneQB@users.noreply.github.com>
Copy link
Contributor

@SajidAlamQB SajidAlamQB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome LGTM! 🎉

tests/io/test_incremental_dataset.py Show resolved Hide resolved
tests/extras/datasets/holoviews/test_holoviews_writer.py Outdated Show resolved Hide resolved
Makefile Outdated
Comment on lines 19 to 22
pytest tests --cov-config pyproject.toml

test-no-spark:
pytest tests --no-cov --ignore tests/extras/datasets/spark --numprocesses 4 --dist loadfile
pytest tests --no-cov --ignore tests/extras/datasets/spark
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were quite handy in making our tests run slightly faster by parallelising. What's the reason for removing it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See point 1: #1275 (comment), I could implement Antony's suggestion: #1275 (review)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, I didn't read carefully enough! I think we should implement some conditions like @AntonyMilneQB suggested or have different moto requirements (whichever is easier). 4 mins is a long time and we were struggling with slow builds before, I'd love it if we could avoid regressing on this. 🙏

Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
merelcht and others added 2 commits February 25, 2022 11:05
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
@merelcht merelcht merged commit 74301c7 into develop Feb 25, 2022
@merelcht merelcht deleted the KED-3043-python-3.10 branch February 25, 2022 11:01
lvijnck pushed a commit to lvijnck/kedro that referenced this pull request Feb 27, 2022
lvijnck pushed a commit to lvijnck/kedro that referenced this pull request Apr 7, 2022
Signed-off-by: Laurens Vijnck <laurens_vijnck@mckinsey.com>
This was referenced Apr 8, 2022
@SajidAlamQB SajidAlamQB mentioned this pull request Aug 8, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants