Skip to content

Add Python 3.11 - #618

Merged
Dreamsorcerer merged 25 commits into
masterfrom
Dreamsorcerer-patch-2
Jan 2, 2023
Merged

Add Python 3.11#618
Dreamsorcerer merged 25 commits into
masterfrom
Dreamsorcerer-patch-2

Conversation

@Dreamsorcerer

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented Jan 1, 2023

Copy link
Copy Markdown

Codecov Report

Merging #618 (ca1e8dc) into master (a8b169e) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #618      +/-   ##
==========================================
+ Coverage   99.63%   99.66%   +0.02%     
==========================================
  Files          36       36              
  Lines        3560     3560              
==========================================
+ Hits         3547     3548       +1     
+ Misses         13       12       -1     
Flag Coverage Δ
unit 99.66% <100.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
tests/ut/backends/test_memcached.py 100.00% <ø> (ø)
tests/ut/backends/test_redis.py 100.00% <ø> (ø)
tests/ut/test_base.py 100.00% <ø> (ø)
aiocache/backends/redis.py 99.16% <100.00%> (ø)
aiocache/base.py 99.23% <100.00%> (ø)
tests/acceptance/conftest.py 100.00% <100.00%> (ø)
tests/acceptance/test_decorators.py 100.00% <100.00%> (ø)
tests/acceptance/test_lock.py 100.00% <100.00%> (ø)
tests/performance/test_footprint.py 100.00% <100.00%> (ø)
tests/ut/test_lock.py 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84d9263...ca1e8dc. Read the comment docs.

@Dreamsorcerer Dreamsorcerer mentioned this pull request Jan 1, 2023
@a68366

a68366 commented Jan 2, 2023

Copy link
Copy Markdown

Hello!
The tests are failing because of this change in 3.11:

Changed Enum.format() (the default for format(), str.format() and f-strings) of enums with mixed-in types (e.g. int, str) to also include the class name in the output, not just the member’s key. This matches the existing behavior of enum.Enum.str(), returning e.g. 'AnEnum.MEMBER' for an enum AnEnum(str, Enum) instead of just 'MEMBER'.

The _build_key in 3.11 returns Keys.KEY instead of using this enum values.

If you just need to fix the tests, then something like this works: a68366#2 .

I'm not sure if just fixing the tests is enough though, since this change in python's behavior makes aiocache unreliable in an environment where 3.11 and lower versions coexist and enums are used for cache keys.

@Dreamsorcerer

Copy link
Copy Markdown
Member Author

@a68366 Thanks a lot for digging that out. The actual key values are not important, right? Only that they are consistent. So, what if we just do str(key) in _build_key()? That should produce the same result on all Python versions.

It'll invalidate existing caches when people upgrade to 0.12, but shouldn't cause any further issues after that.

@Dreamsorcerer

Copy link
Copy Markdown
Member Author

@a68366 If you could double check the changes look sensible, that would be great.

@a68366

a68366 commented Jan 2, 2023 via email

Copy link
Copy Markdown

@Dreamsorcerer
Dreamsorcerer merged commit 1b839ab into master Jan 2, 2023
@Dreamsorcerer
Dreamsorcerer deleted the Dreamsorcerer-patch-2 branch January 2, 2023 16:17
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.

2 participants