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

🏗️ Upgrades repository to python 3.8.10 #2079

Merged
merged 158 commits into from
Jun 18, 2021

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Jan 7, 2021

What do these changes do?

  • Upgrades all python code in repository, i.e. all packages, tests and services [except director whose development is frozen], to python 3.8.10. See what is new
  • Repository's version in requirements/PYTHON_VERSION ( repo checked using tests/environment-setup/test_used_python.py)
  • CI runs in 3.8.10 except for python-linting that is run in both 3.8 and 3.9

Main changes

  • Dockerfile base images
  • python_requires specs on setup.py and other metadata/checks
  • requirement listings were re-compile using latest pip-tools
    • compilation run within controlled environment requirements/tools/Dockerfile
    • NO package was upgraded
    • Notice how all backport libraries (e.g. dataclasses) were automatically removed (SEE requirements/packages-notes.md for more details)
  • config files in tooling (e.g. .pre-commit-config.yaml) etc
  • Upgrade python in CI setup
  • web-server's garbage_collector.py ignores cancellation and enters in an errors loop. I am still not sure what is the cause so I introduced a mechanism to enforce getting out of the infinite while True loop.

Some highlights in 3.8

  • assignment expressions @mguidon, I know you were waiting for this!
  • new features in asyncio @sanderegg @GitHK interesting:
    • asyncio.run(coro())
    • python -m asyncio creates an asyncio REPL 3.8.0
    • The exception asyncio.CancelledError now inherits from BaseException rather than Exception
    • tasks can now be named (see garbage-collector background task). Handy to avoid duplicates or to search ...
  • time benchmark from 3.5 to 3.8

Related issue/s

How to test

  • RECOMMENDED: install pyenv in your system
  • Check available versions: pyenv install --list | grep 3.8
  • install 3.8: pyenv install 3.8.6
  • see all installed versions: pyenv versions
  • use 3.8 in osparc-simcore project. Will create a .python-version file:
cd osparc-simcore
pyenv local 3.8.10
python --version
  • create devenv
 make devenv
 source .venv/bin/activate

Checklist

  • when this is upgraded review New service-integration library in osparc-simcore #1884
  • check speed difference between 3.8 and 3.6? and major changes
  • CI matrix
  • Upgrades python service's Dockerfile base
  • Adapt code for new features
    • CancelledError is not in asyncio.future anymore
    • New AsyncMock. No need to use the trick of returning a Future to emulate a coroutine.
    • pylint (has some issues with 3.9)

@pcrespov pcrespov self-assigned this Jan 7, 2021
@pcrespov pcrespov added python t:maintenance Some planned maintenance work labels Jan 7, 2021
@codecov
Copy link

codecov bot commented Jan 7, 2021

Codecov Report

Merging #2079 (ab6c99a) into master (e19f6c1) will decrease coverage by 0.6%.
The diff coverage is 63.6%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #2079     +/-   ##
========================================
- Coverage    74.8%   74.2%   -0.7%     
========================================
  Files         517     518      +1     
  Lines       20161   20320    +159     
  Branches     2000    2012     +12     
========================================
- Hits        15083   15080      -3     
- Misses       4544    4716    +172     
+ Partials      534     524     -10     
Flag Coverage Δ
integrationtests 67.3% <55.0%> (-0.1%) ⬇️
unittests 67.7% <62.1%> (-0.5%) ⬇️

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

Impacted Files Coverage Δ
...s/service-library/src/servicelib/rest_responses.py 80.3% <ø> (ø)
...vice-library/src/servicelib/utils_debug_asyncio.py 0.0% <0.0%> (ø)
...r/src/simcore_service_sidecar/celery_task_utils.py 52.9% <0.0%> (ø)
.../sidecar/src/simcore_service_sidecar/log_parser.py 86.3% <0.0%> (+0.7%) ⬆️
.../simcore_service_webserver/diagnostics_handlers.py 54.5% <0.0%> (ø)
.../simcore_service_webserver/projects/projects_db.py 90.3% <ø> (+0.1%) ⬆️
.../web/server/src/simcore_service_webserver/utils.py 45.5% <0.0%> (+0.5%) ⬆️
...simcore_service_webserver/projects/projects_api.py 83.5% <30.0%> (-2.5%) ⬇️
...ore_service_api_server/utils/solver_job_outputs.py 51.7% <50.0%> (ø)
...ervices/storage/src/simcore_service_storage/dsm.py 71.9% <50.0%> (+0.1%) ⬆️
... and 121 more

@pcrespov pcrespov added this to the Christmas'20 milestone Jan 7, 2021
@pcrespov pcrespov force-pushed the maintenance/upgrade-python-3-8 branch from e8fb3e1 to 625319e Compare January 8, 2021 13:35
@pcrespov pcrespov changed the title WIP: 🏗️ Upgrades repository to python 3.8.6 🏗️ Upgrades repository to python 3.8.6 Jan 9, 2021
@pcrespov pcrespov marked this pull request as ready for review January 9, 2021 22:36
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.

Very nice job. Thanks a lot for upgrading to 3.8! I have a few questions below.

packages/postgres-database/setup.py Show resolved Hide resolved
tests/environment-setup/requirements/requirements.in Outdated Show resolved Hide resolved
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.

The only thing maybe missing is:

  • installation of pyenv as part of some makefile recipe (or maybe just a link to pyenv?)

@pcrespov pcrespov force-pushed the maintenance/upgrade-python-3-8 branch from 76703a4 to 757ecbc Compare January 12, 2021 17:54
@pcrespov pcrespov force-pushed the maintenance/upgrade-python-3-8 branch 2 times, most recently from bbf6996 to 0fb97b3 Compare January 19, 2021 09:45
@pcrespov pcrespov force-pushed the maintenance/upgrade-python-3-8 branch from 0fb97b3 to 272cf81 Compare January 23, 2021 02:07
@pcrespov pcrespov changed the title 🏗️ Upgrades repository to python 3.8.6 WIP: 🏗️ Upgrades repository to python 3.8.6 Feb 3, 2021
@pcrespov pcrespov marked this pull request as draft February 3, 2021 11:55
@pcrespov pcrespov force-pushed the maintenance/upgrade-python-3-8 branch from 272cf81 to f4d3dd4 Compare February 10, 2021 15:35
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.

I've requested a few changes, they will avoid some pain when testing.

@pcrespov pcrespov force-pushed the maintenance/upgrade-python-3-8 branch from 5a8f495 to c58b0ff Compare February 12, 2021 20:03
@pcrespov pcrespov requested a review from sanderegg June 18, 2021 15:55
@pcrespov pcrespov force-pushed the maintenance/upgrade-python-3-8 branch from 2f8c4b2 to 5b00a5c Compare June 18, 2021 16:00
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.

sweet!

@pcrespov pcrespov merged commit 32f6501 into ITISFoundation:master Jun 18, 2021
@pcrespov pcrespov deleted the maintenance/upgrade-python-3-8 branch June 18, 2021 16:52
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.

5 participants