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

Update to python 3.9 #828

Merged
merged 32 commits into from
Dec 18, 2021
Merged

Conversation

Askaholic
Copy link
Collaborator

@Askaholic Askaholic commented Aug 30, 2021

Based on #827

Finally got the tests running on 3.9 without them spitting out hundreds of warnings. I had to remove a bit of deprecated functionality
by swapping the mock and asynctest packages with builtin unittest.mock equivalents. Unfortunately aiomysql still uses deprecated functionality (and there is no hope of it being fixed since that project seems to have no maintainer anymore), so we have to just ignore the deprecation warnings Fortunately aiomysql finally merged their open python3.9+ compatibility prs. Also it seems that either aiohttp hasn't properly declared its dependencies or pipenv is doing something weird, as I had to explicitly include typing_extensions in the dependencies since aiohttp tries to import it.

I also went ahead and did a few refactors that are possible in 3.9:

  • Use typing.Protocol in a few places
  • Use builtins for generic typing, e.g. list[str] instead of List[str] (this one touches basically every file)

@Askaholic Askaholic changed the title Update to py 3.9 Update to python 3.9 Aug 30, 2021
@Askaholic Askaholic force-pushed the update-py-3.9-sqlalchemy branch 4 times, most recently from 2d29a91 to 3692f9e Compare December 10, 2021 21:51
@codecov
Copy link

codecov bot commented Dec 10, 2021

Codecov Report

Merging #828 (bf3eaea) into develop (0b987e8) will decrease coverage by 0.11%.
The diff coverage is 95.29%.

Impacted Files Coverage Δ
server/broadcast_service.py 100.00% <ø> (ø)
server/games/coop.py 100.00% <ø> (ø)
server/message_queue_service.py 97.80% <ø> (-0.05%) ⬇️
server/stats/unit.py 100.00% <ø> (ø)
server/lobbyconnection.py 94.24% <50.00%> (+0.09%) ⬆️
server/servercontext.py 89.13% <77.14%> (-2.30%) ⬇️
server/timing/timer.py 78.26% <87.50%> (-1.11%) ⬇️
server/__init__.py 91.30% <91.66%> (+0.16%) ⬆️
server/api/oauth_session.py 94.00% <100.00%> (-0.12%) ⬇️
server/asyncio_extensions.py 100.00% <100.00%> (ø)
... and 61 more

@Askaholic
Copy link
Collaborator Author

Lots of files are touched because of the typing changes, but there isn't anything complicated going on there

@Askaholic Askaholic force-pushed the update-py-3.9-sqlalchemy branch 2 times, most recently from fad1f28 to 359c710 Compare December 11, 2021 21:12
tests/utils.py Outdated Show resolved Hide resolved
server/geoip_service.py Show resolved Hide resolved
server/stats/game_stats_service.py Show resolved Hide resolved
tests/utils.py Outdated Show resolved Hide resolved
server/lobbyconnection.py Show resolved Hide resolved
server/types.py Outdated Show resolved Hide resolved
server/timing/timer.py Show resolved Hide resolved
tests/utils.py Outdated Show resolved Hide resolved
tests/integration_tests/test_load.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@BlackYps BlackYps left a comment

Choose a reason for hiding this comment

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

looks good to me

@Askaholic
Copy link
Collaborator Author

I think I'm going to remove the -W error pytest args for now because I expect it will cause more headaches with the CI pipeline than it's worth

@Askaholic Askaholic merged commit 78a8ef2 into FAForever:develop Dec 18, 2021
@Askaholic Askaholic deleted the update-py-3.9-sqlalchemy branch December 18, 2021 23:41
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.

3 participants