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

⬆️ Upgrade to Python 3.11 #6186

Merged

Conversation

giancarloromeo
Copy link
Contributor

@giancarloromeo giancarloromeo commented Aug 14, 2024

What do these changes do?

The idea is to upgrade services to Python 3.11, to obtain an improvement in performance and benefit from the new features introduced in the new version of the language.

Related issue/s

How to test

Dev-ops checklist

Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 93.42105% with 5 lines in your changes missing coverage. Please review.

Project coverage is 88.1%. Comparing base (cafbf96) to head (a743e1b).
Report is 464 commits behind head on master.

Files Patch % Lines
...er/src/simcore_service_webserver/catalog/client.py 0.0% 3 Missing ⚠️
...es/web/server/src/simcore_service_webserver/cli.py 83.3% 1 Missing ⚠️
.../server/src/simcore_service_webserver/login/cli.py 0.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #6186      +/-   ##
=========================================
+ Coverage    84.5%   88.1%    +3.5%     
=========================================
  Files          10    1466    +1456     
  Lines         214   60941   +60727     
  Branches       25    2063    +2038     
=========================================
+ Hits          181   53691   +53510     
- Misses         23    6935    +6912     
- Partials       10     315     +305     
Flag Coverage Δ
integrationtests 64.8% <80.0%> (?)
unittests 86.0% <92.1%> (+1.5%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...s/models-library/src/models_library/basic_types.py 85.1% <100.0%> (ø)
...s/models-library/src/models_library/utils/enums.py 89.4% <100.0%> (ø)
..._postgres_database/models/payments_transactions.py 93.7% <100.0%> (ø)
...s/settings-library/src/settings_library/r_clone.py 100.0% <100.0%> (ø)
...dk/src/simcore_sdk/node_ports_common/aws_s3_cli.py 90.0% <100.0%> (ø)
...e-sdk/src/simcore_sdk/node_ports_common/r_clone.py 98.1% <100.0%> (ø)
...rc/simcore_service_webserver/api_keys/_handlers.py 92.0% <100.0%> (ø)
...rc/simcore_service_webserver/clusters/_handlers.py 100.0% <100.0%> (ø)
...simcore_service_webserver/director_v2/_handlers.py 92.5% <100.0%> (ø)
...ore_service_webserver/folders/_folders_handlers.py 91.5% <100.0%> (ø)
... and 37 more

... and 1370 files with indirect coverage changes

@giancarloromeo giancarloromeo self-assigned this Aug 14, 2024
@giancarloromeo giancarloromeo added this to the Eisbock milestone Aug 14, 2024
@giancarloromeo giancarloromeo added the t:maintenance Some planned maintenance work label Aug 14, 2024
@pcrespov
Copy link
Member

@giancarloromeo

Regarding the failing test_issubclass_type_error_with_pydantic_models, my recommendation is just to remove assert inspect.isclass(dict[str, str]) from the test.

The reason for that test is in a patch that we do for a bug in
https://github.com/itisfoundation/osparc-simcore/blob/1cea431c7a53d9935c70420c6432518c654c12ee/packages/settings-library/src/settings_library/base.py#L101-L104

Therefore the relevant part for now is that

# here reproduces the problem with our settings that ANE and PC had
class SettingsClassThatFailed(BaseCustomSettings):
FOO: dict[str, str] | None = Field(default=None)
SettingsClassThatFailed(FOO={})
assert SettingsClassThatFailed(FOO=None) == SettingsClassThatFailed()

passes. I checked and it does

thx

@giancarloromeo giancarloromeo marked this pull request as ready for review August 22, 2024 10:32
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

Thanks for a lot.
Please see my concerns below.

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

Some general comments:

  • took the liberty to change in "related issues" the item to "closes" . Read this
  • Remove WIP from title

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

Two things:

  • I would like to check with you many of the mypy ignores. ignoring should be last resource
  • I was expecting some info on this PR about increase of performance. I suggest
    • time of tests
    • service start times

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

so a bit too many ignores in the web server for me. we can go through some of them? otherwise it looks super! thanks a bunch!

Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@giancarloromeo giancarloromeo changed the title ⬆️ WIP: Upgrade to Python 3.11 ⬆️ Upgrade to Python 3.11 Aug 22, 2024
Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

thx a lot! do not forget to add pylint 3.12 🎉

@giancarloromeo
Copy link
Contributor Author

Back to the # type: ignore[*anything*]: the same solutions are applied already in the code. All are related to pydantic models. There is an issue that requires an upgrade to Pydantic v2. This will change again everything - especially in the mypy-pydantic interaction - so I expect a lot of refactoring there.

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

All good thanks! looking forward!

Copy link

@giancarloromeo giancarloromeo requested a review from GitHK August 23, 2024 10:27
@giancarloromeo giancarloromeo enabled auto-merge (squash) August 23, 2024 10:29
@giancarloromeo giancarloromeo merged commit fa2faad into ITISFoundation:master Aug 23, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:maintenance Some planned maintenance work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to python 3.11
6 participants