mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
Add Python3.9 Testing
This commit is contained in:
parent
0036e8b280
commit
8c6bdd8ae2
@ -64,6 +64,21 @@ test-3.8-core:
|
||||
reports:
|
||||
cobertura: coverage.xml
|
||||
|
||||
test-3.9-core:
|
||||
image: python:3.9-buster
|
||||
script:
|
||||
- tox -e py39-core
|
||||
before_script:
|
||||
- apt-get update && apt-get install redis-server -y
|
||||
- redis-server --daemonize yes
|
||||
- redis-cli ping
|
||||
- python -V
|
||||
- pip install wheel tox
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
cobertura: coverage.xml
|
||||
|
||||
test-3.6-all:
|
||||
image: python:3.6-buster
|
||||
script:
|
||||
@ -109,9 +124,24 @@ test-3.8-all:
|
||||
reports:
|
||||
cobertura: coverage.xml
|
||||
|
||||
test-3.9-all:
|
||||
image: python:3.9-buster
|
||||
script:
|
||||
- tox -e py39-all
|
||||
before_script:
|
||||
- apt-get update && apt-get install redis-server -y
|
||||
- redis-server --daemonize yes
|
||||
- redis-cli ping
|
||||
- python -V
|
||||
- pip install wheel tox
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
cobertura: coverage.xml
|
||||
|
||||
deploy_production:
|
||||
stage: deploy
|
||||
image: python:3.8-buster
|
||||
image: python:3.9-buster
|
||||
|
||||
before_script:
|
||||
- pip install twine wheel
|
||||
|
@ -12,20 +12,12 @@ import base64
|
||||
import hmac
|
||||
import hashlib
|
||||
|
||||
try:
|
||||
from urllib import unquote, urlencode
|
||||
except ImportError: #py3
|
||||
from urllib.parse import unquote, urlencode
|
||||
try:
|
||||
from urlparse import parse_qs
|
||||
except ImportError: #py3
|
||||
from urllib.parse import parse_qs
|
||||
from urllib.parse import unquote, urlencode, parse_qs
|
||||
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
ACCESS_PERM = 'discourse.access_discourse'
|
||||
|
||||
|
||||
@ -55,7 +47,7 @@ def discourse_sso(request):
|
||||
# Validate the payload
|
||||
try:
|
||||
payload = unquote(payload).encode('utf-8')
|
||||
decoded = base64.decodestring(payload).decode('utf-8')
|
||||
decoded = base64.decodebytes(payload).decode('utf-8')
|
||||
assert 'nonce' in decoded
|
||||
assert len(payload) > 0
|
||||
except AssertionError:
|
||||
@ -86,7 +78,7 @@ def discourse_sso(request):
|
||||
if main_char:
|
||||
params['avatar_url'] = main_char.portrait_url(256)
|
||||
|
||||
return_payload = base64.encodestring(urlencode(params).encode('utf-8'))
|
||||
return_payload = base64.encodebytes(urlencode(params).encode('utf-8'))
|
||||
h = hmac.new(key, return_payload, digestmod=hashlib.sha256)
|
||||
query_string = urlencode({'sso': return_payload, 'sig': h.hexdigest()})
|
||||
|
||||
|
3
setup.py
3
setup.py
@ -76,10 +76,11 @@ setup(
|
||||
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
|
||||
'Operating System :: POSIX :: Linux',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Topic :: Internet :: WWW/HTTP',
|
||||
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
|
||||
],
|
||||
|
3
tox.ini
3
tox.ini
@ -1,7 +1,7 @@
|
||||
[tox]
|
||||
skipsdist = true
|
||||
usedevelop = true
|
||||
envlist = py{36,37,38}-{all}
|
||||
envlist = py{36,37,38,39}-{all}
|
||||
|
||||
[testenv]
|
||||
setenv =
|
||||
@ -11,6 +11,7 @@ basepython =
|
||||
py36: python3.6
|
||||
py37: python3.7
|
||||
py38: python3.8
|
||||
py39: python3.9
|
||||
deps=
|
||||
coverage
|
||||
install_command = pip install -e ".[testing]" -U {opts} {packages}
|
||||
|
Loading…
x
Reference in New Issue
Block a user