Add Python 3.6 and 3.10 support, fixes #53

This commit is contained in:
Yohann D'ANELLO 2020-12-20 17:54:33 +01:00
parent 0b9606cbfe
commit 8afa082708
2 changed files with 44 additions and 10 deletions

View File

@ -3,21 +3,16 @@ stages:
- quality-assurance - quality-assurance
- build - build
py37:
stage: test
image: python:3.7-alpine
before_script:
- apk add --no-cache gettext
- pip install tox
script: tox -e py3
py38: py310:
stage: test stage: test
image: python:3.8-alpine image: python:rc-alpine
before_script: before_script:
- apk add --no-cache gettext - apk add --no-cache gettext
- pip install tox - pip install tox
script: tox -e py3 script: tox -e py3
only:
- master
py39: py39:
@ -28,6 +23,38 @@ py39:
- pip install tox - pip install tox
script: tox -e py3 script: tox -e py3
py38:
stage: test
image: python:3.8-alpine
before_script:
- apk add --no-cache gettext
- pip install tox
script: tox -e py3
py37:
stage: test
image: python:3.7-alpine
before_script:
- apk add --no-cache gettext
- pip install tox
script: tox -e py3
only:
- master
py36:
stage: test
image: python:3.6-alpine
before_script:
- apk add --no-cache gettext
- pip install tox
script: tox -e py3
only:
- master
linters: linters:
stage: quality-assurance stage: quality-assurance
image: python:3-alpine image: python:3-alpine
@ -36,11 +63,15 @@ linters:
script: tox -e linters script: tox -e linters
allow_failure: true allow_failure: true
build-deb: build-deb:
image: debian:buster-slim image: debian:buster-slim
stage: build stage: build
before_script: before_script:
- apt-get update && apt-get -y --no-install-recommends install build-essential debmake dh-python debhelper gettext python3-all python3-setuptools - >
apt-get update && apt-get -y --no-install-recommends install
build-essential debmake dh-python debhelper gettext python3-all
python3-setuptools
script: script:
- dpkg-buildpackage - dpkg-buildpackage
- mkdir build && cp ../*.deb build/ - mkdir build && cp ../*.deb build/

View File

@ -2,6 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
import curses import curses
import sys
from typing import Any, Optional, Tuple, Union from typing import Any, Optional, Tuple, Union
from squirrelbattle.display.texturepack import TexturePack from squirrelbattle.display.texturepack import TexturePack
@ -97,6 +98,8 @@ class Display:
attr |= curses.A_BOLD if bold else 0 attr |= curses.A_BOLD if bold else 0
attr |= curses.A_DIM if dim else 0 attr |= curses.A_DIM if dim else 0
attr |= curses.A_INVIS if invis else 0 attr |= curses.A_INVIS if invis else 0
# Italic is supported since Python 3.7
italic &= sys.version_info >= (3, 7,)
attr |= curses.A_ITALIC if italic else 0 attr |= curses.A_ITALIC if italic else 0
attr |= curses.A_NORMAL if normal else 0 attr |= curses.A_NORMAL if normal else 0
attr |= curses.A_PROTECT if protect else 0 attr |= curses.A_PROTECT if protect else 0