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

Find frozen stdlib modules #1513

Merged
merged 2 commits into from
Apr 22, 2022
Merged

Conversation

DanielNoord
Copy link
Collaborator

@DanielNoord DanielNoord commented Apr 17, 2022

Steps

  • For new features or bug fixes, add a ChangeLog entry describing what your PR does.
  • Write a good description on what the PR does.

Description

Closes #1512.

Related is python/cpython#65935. I'm not sure how to test this on 3.10 though as this is a new feature on 3.11. That would be the next step.

Type of Changes

Type
✨ New feature

Related Issue

@coveralls
Copy link

coveralls commented Apr 17, 2022

Pull Request Test Coverage Report for Build 2207138448

  • 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 91.588%

Totals Coverage Status
Change from base Build 2207055108: 0.09%
Covered Lines: 9102
Relevant Lines: 9938

💛 - Coveralls

@DanielNoord DanielNoord mentioned this pull request Apr 17, 2022
1 task
@DanielNoord
Copy link
Collaborator Author

Turns out this fixes all other outstanding issues with 3.11. 😄

I do wonder why the test suite is so incredibly slow though. Is that an issue with us? Or is pytest running slow on 3.11?

@DanielNoord DanielNoord marked this pull request as ready for review April 22, 2022 10:28
@cdce8p cdce8p self-requested a review April 22, 2022 10:28
@DanielNoord
Copy link
Collaborator Author

Locally, with 3.10:

2.10s call     tests/unittest_nodes.py::ImportNodeTest::test_from_self_resolve
1.34s call     tests/unittest_brain.py::SixBrainTest::test_attribute_access
1.25s call     tests/unittest_brain.py::ModuleExtenderTest::test_extension_modules
0.70s call     tests/unittest_manager.py::AstroidManagerTest::test_ast_from_class
0.61s call     tests/unittest_scoped_nodes.py::ClassNodeTest::test_mro_typing_extensions
0.55s call     tests/unittest_builder.py::BuilderTest::test_inspect_build0
0.46s call     tests/unittest_manager.py::AstroidManagerTest::test_ast_from_class_with_module
0.42s call     tests/unittest_builder.py::BuilderTest::test_inspect_build_type_object
0.38s call     tests/unittest_brain.py::CollectionsDequeTests::test_deque
0.31s call     tests/unittest_brain.py::ReBrainTest::test_re_pattern_subscriptable
0.29s call     tests/unittest_inference.py::InferenceTest::test_unary_operands
0.29s call     tests/unittest_scoped_nodes.py::ModuleNodeTest::test_stream_api
0.28s call     tests/unittest_scoped_nodes.py::ClassNodeTest::test_has_dynamic_getattr
0.26s call     tests/unittest_brain.py::DateutilBrainTest::test_parser
0.24s call     tests/unittest_brain.py::TypingBrain::test_callable_type
0.24s call     tests/unittest_nodes.py::ImportNodeTest::test_bad_import_inference
0.24s call     tests/unittest_brain.py::MultiprocessingBrainTest::test_multiprocessing_manager
0.23s call     tests/unittest_brain.py::AttrsTest::test_attr_transform
0.21s call     tests/unittest_builder.py::test_module_build_dunder_file
0.19s call     tests/unittest_brain.py::SubprocessTest::test_popen_does_not_have_class_getitem

With 3.11.0a7:

1.83s call     tests/unittest_nodes.py::ImportNodeTest::test_from_self_resolve
1.33s call     tests/unittest_brain.py::ModuleExtenderTest::test_extension_modules
0.67s call     tests/unittest_brain.py::test_http_client_brain
0.59s call     tests/unittest_scoped_nodes.py::ClassNodeTest::test_mro_typing_extensions
0.58s call     tests/unittest_builder.py::BuilderTest::test_inspect_build_type_object
0.55s call     tests/unittest_manager.py::AstroidManagerTest::test_ast_from_class_with_module
0.47s call     tests/unittest_builder.py::BuilderTest::test_inspect_build0
0.34s call     tests/unittest_manager.py::AstroidManagerTest::test_ast_from_class
0.33s call     tests/unittest_brain.py::CollectionsDequeTests::test_deque
0.32s call     tests/unittest_scoped_nodes.py::ModuleNodeTest::test_without_docstring
0.32s call     tests/unittest_brain.py::TypingBrain::test_callable_type
0.29s call     tests/unittest_brain.py::AttrsTest::test_attr_transform
0.25s call     tests/unittest_brain.py::ReBrainTest::test_regex_flags
0.23s call     tests/unittest_scoped_nodes.py::ClassNodeTest::test_has_dynamic_getattr
0.21s call     tests/unittest_brain.py::MultiprocessingBrainTest::test_multiprocessing_manager
0.21s call     tests/unittest_inference.py::InferenceTest::test_no_infinite_ancestor_loop
0.19s call     tests/unittest_nodes.py::ImportNodeTest::test_bad_import_inference
0.17s call     tests/unittest_brain.py::ReBrainTest::test_re_pattern_subscriptable
0.17s call     tests/unittest_builder.py::test_module_build_dunder_file
0.16s call     tests/unittest_inference.py::InferenceTest::test_two_parents_from_same_module

So, possible something to do with the runner/GA?

@DanielNoord
Copy link
Collaborator Author

I got some data in DanielNoord#20.

Not immediately sure what is causing this. But since main is also affected I don't think it is due to this PR.

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.12.0 milestone Apr 22, 2022
Copy link
Member

@cdce8p cdce8p left a comment

Choose a reason for hiding this comment

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

LGTM! A very elegant solution. Thank you @DanielNoord 🐬

@cdce8p cdce8p merged commit c6293b4 into pylint-dev:main Apr 22, 2022
@cdce8p
Copy link
Member

cdce8p commented Apr 22, 2022

I do wonder why the test suite is so incredibly slow though. Is that an issue with us? Or is pytest running slow on 3.11?

One part was the cache which didn't got stored until you fixed all the issues. That's already (1:30min).
The other one, I would guess, is that Python 3.11 isn't installed natively and thus probably not optimized. Just compare the Setup Python steps:

@DanielNoord
Copy link
Collaborator Author

DanielNoord commented Apr 22, 2022

@cdce8p DanielNoord#20 shows significant differences in test times though. numpy brain tests seem to struggle but other test also run twice as long. That shouldn't be due to caching nor installing python right?

@cdce8p
Copy link
Member

cdce8p commented Apr 22, 2022

@cdce8p DanielNoord#20 shows significant differences in test times though. numpy brain tests seem to struggle but other test also run twice as long. That shouldn't be due to caching nor installing python right?

It could be 🤷🏻‍♂️ Caching not so much, but optimizations during install are a possibility. Especially if that time difference doesn't happen locally. I only noticed the different log output.

@DanielNoord DanielNoord deleted the frozen-modules branch April 23, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

collections_abc will be frozen in 3.11
4 participants