Skip to content

Upgrade to py12 #1354

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

Merged
merged 7 commits into from
Nov 18, 2023
Merged

Upgrade to py12 #1354

merged 7 commits into from
Nov 18, 2023

Conversation

Nachtalb
Copy link
Contributor

@Nachtalb Nachtalb commented Nov 3, 2023

Description

This PR introduces compatibility updates for Python 3.12, addressing changes and deprecations to ensure seamless functionality with the latest Python version. Changes include updates to the GitHub Actions workflow, project configurations, dependency adjustments, and test case modifications to align with Python 3.12's features and the newly adopted PEP 678 enhancements.

Fixes # (No issue linked, direct improvement)

⚠️ This is a draft PR as it relies on the beta version of aiohttp (3.9.0b0), which is currently the only version compatible with Python 3.12, as discussed here.

Type of change

  • Documentation (typos, code examples or any documentation update)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Testing was performed by installing the project and executing pytests across various Python versions with different extras enabled. The following environments were tested:

  • Arch Linux with Python 3.12 (all extras: cli, dev, docs, fast, i18n, proxy, redis, test)
  • Arch Linux with Python 3.11 (all extras: cli, dev, docs, fast, i18n, proxy, redis, test)
  • Arch Linux with Python 3.10 (all extras: cli, dev, docs, fast, i18n, proxy, redis, test)
  • Arch Linux with Python 3.9 (extras: dev, docs, fast, i18n, proxy, redis, test), excluding cli due to a dependency version conflict
  • Arch Linux with Python 3.8 (extras: dev, fast, i18n, proxy, redis, test), excluding cli and docs due to dependency version conflicts

Test Configuration:

  • Operating System: Arch Linux
  • Python versions: 3.8, 3.9, 3.10, 3.11, 3.12

All tests pass across the tested configurations.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

This is a draft PR as it relies on the beta version of aiohttp (3.9.0b0), which is currently the only version compatible with Python 3.12, as discussed here.

@Nachtalb Nachtalb changed the title Upgrade to py12 compatible aiohttp beta version Upgrade to py12 Nov 3, 2023
Copy link

github-actions bot commented Nov 3, 2023

✔️ Changelog found.

Thank you for adding a description of the changes

@github-actions github-actions bot added the 3.x Issue or PR for stable 3.x version label Nov 3, 2023
handler_event.clear()
resp = await self.make_reqest(client=client)
assert resp.status == 200
await asyncio.wait_for(handler_event.wait(), timeout=1)
await asyncio.wait_for(method_called_event.wait(), timeout=1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI, a simple asyncio.sleep(0.00000000...1) would be enough as well. It just needs to be non-zero so that another task is scheduled before our assert. However, using a side effect and waiting for an event is more robust to future changes or inconsistencies across different installations.

Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Merging #1354 (50b1995) into dev-3.x (c208bcf) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           dev-3.x     #1354   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          369       369           
  Lines         9448      9449    +1     
=========================================
+ Hits          9448      9449    +1     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

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

Files Coverage Δ
aiogram/__init__.py 100.00% <100.00%> (ø)

@JrooTJunior JrooTJunior marked this pull request as ready for review November 18, 2023 19:24
@JrooTJunior JrooTJunior merged commit c1bafea into aiogram:dev-3.x Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issue or PR for stable 3.x version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants