feat(python): Add support for python 3.11rc and testing

This commit is contained in:
Georg Krause 2022-10-12 10:03:52 +02:00 committed by Georg Krause
parent 82767e7b3c
commit 2eefd8b3f7
3 changed files with 5 additions and 3 deletions

View File

@ -204,7 +204,7 @@ test_api:
path: api/coverage.xml
parallel:
matrix:
- PY_VER: ["3.7", "3.8", "3.9", "3.10"]
- PY_VER: ["3.7", "3.8", "3.9", "3.10", "3.11-rc"]
image: $CI_REGISTRY/funkwhale/backend-test-docker:$PY_VER
test_front:

View File

@ -26,10 +26,11 @@ class SimpleRadio(object):
return
def pick(self, choices, previous_choices=[]):
return random.sample(set(choices).difference(previous_choices), 1)[0]
possible_choices = [x for x in choices if x not in previous_choices]
return random.sample(possible_choices, 1)[0]
def pick_many(self, choices, quantity):
return random.sample(set(choices), quantity)
return random.sample(list(choices), quantity)
def weighted_pick(self, choices, previous_choices=[]):
total = sum(weight for c, weight in choices)

View File

@ -0,0 +1 @@
Add support for python 3.11