1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2024-11-30 11:33:02 +00:00

Fix CI, add django22-py39 CI step

This commit is contained in:
Yohann D'ANELLO 2020-12-28 22:55:48 +01:00
parent 4de83344a7
commit 574233acd0
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
3 changed files with 14 additions and 3 deletions

View File

@ -26,6 +26,17 @@ py38-django22:
python3-docutils python3-pil python3-tz python3-six python3-sqlparse python3-stdnum python3-yaml python3-coreapi tox python3-docutils python3-pil python3-tz python3-six python3-sqlparse python3-stdnum python3-yaml python3-coreapi tox
script: tox -e py38 script: tox -e py38
py39-django22:
stage: test
image: debian:bullseye
before_script:
- >
apt-get update &&
apt-get install --no-install-recommends -y
python3-django python3-django-casclient python3-django-reversion python3-djangorestframework
python3-docutils python3-pil python3-tz python3-six python3-sqlparse python3-stdnum python3-yaml python3-coreapi tox
script: tox -e py39
linters: linters:
stage: quality-assurance stage: quality-assurance
image: debian:buster-backports image: debian:buster-backports

View File

@ -93,9 +93,9 @@ class MediaAdminForm(ModelForm):
side_identifier_field.widget.template_name = "media/generate_side_identifier.html" side_identifier_field.widget.template_name = "media/generate_side_identifier.html"
def download_data_isbndb(self, isbn): def download_data_isbndb(self, isbn):
api_url = "https://api2.isbndb.com/book/" + str(isbn) + "?Authorization=" + os.getenv("ISBNDB_KEY") api_url = "https://api2.isbndb.com/book/" + str(isbn) + "?Authorization=" + os.getenv("ISBNDB_KEY", "")
req = urllib.request.Request(api_url) req = urllib.request.Request(api_url)
req.add_header("Authorization", os.getenv("ISBNDB_KEY")) req.add_header("Authorization", os.getenv("ISBNDB_KEY", ""))
try: try:
with urllib.request.urlopen(req) as url: with urllib.request.urlopen(req) as url:
data: dict = json.loads(url.read().decode())["book"] data: dict = json.loads(url.read().decode())["book"]

View File

@ -1,5 +1,5 @@
[tox] [tox]
envlist = py37,py38,linters envlist = py37,py38,py39,linters
skipsdist = True skipsdist = True
[testenv] [testenv]