feat(python): Add support for python 3.11rc and testing
This commit is contained in:
parent
82767e7b3c
commit
2eefd8b3f7
|
@ -204,7 +204,7 @@ test_api:
|
||||||
path: api/coverage.xml
|
path: api/coverage.xml
|
||||||
parallel:
|
parallel:
|
||||||
matrix:
|
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
|
image: $CI_REGISTRY/funkwhale/backend-test-docker:$PY_VER
|
||||||
|
|
||||||
test_front:
|
test_front:
|
||||||
|
|
|
@ -26,10 +26,11 @@ class SimpleRadio(object):
|
||||||
return
|
return
|
||||||
|
|
||||||
def pick(self, choices, previous_choices=[]):
|
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):
|
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=[]):
|
def weighted_pick(self, choices, previous_choices=[]):
|
||||||
total = sum(weight for c, weight in choices)
|
total = sum(weight for c, weight in choices)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Add support for python 3.11
|
Loading…
Reference in New Issue