From 5ce86f27fa1ce1ed85b739c24537e2c3e964f78c Mon Sep 17 00:00:00 2001 From: Krzysztof Ebert Date: Thu, 9 Jul 2020 15:35:22 +0200 Subject: [PATCH] Feature/travis multiple os (#4) Version 1.0.2 - Add windows to os list --- .travis.yml | 66 +++++++++++++++++++++++++++++++++++----- py_avataaars/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 61 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6b9a5d7..1b05755 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,64 @@ language: python -os: linux -cache: pip -python: -- '3.6' -- '3.7' -- '3.8' -install: "pip install -r requirements.txt" + +matrix: + include: + - name: "Python 3.6.8 on Windows" + os: windows # Windows 10.0.17134 N/A Build 17134 + language: shell # 'language: python' is an error on Travis CI Windows + before_install: + - choco install python --version 3.6.8 + - python --version + - python -m pip install --upgrade pip + - pip3 install --upgrade pytest + - choco uninstall -y mingw + - choco upgrade --no-progress -y msys2 + - export msys2='cmd //C RefreshEnv.cmd ' + - export msys2+='& set MSYS=winsymlinks:nativestrict ' + - export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start' + - export mingw64="$msys2 -mingw64 -full-path -here -c "\"\$@"\" --" + - export msys2+=" -msys2 -c "\"\$@"\" --" + - $msys2 pacman --sync --noconfirm --needed mingw-w64-x86_64-toolchain + - export PATH=/C/tools/msys64/mingw64/bin:$PATH + - export MAKE=mingw32-make # so that Autotools can find it + - $msys2 pacman -S mingw-w64-x86_64-gtk3 --noconfirm + env: PATH=/c/Python36:/c/Python36/Scripts:$PATH + - name: "Python 3.7.4 on Windows" + os: windows # Windows 10.0.17134 N/A Build 17134 + language: shell # 'language: python' is an error on Travis CI Windows + before_install: + - choco install python --version 3.7.4 + - python --version + - python -m pip install --upgrade pip + - pip3 install --upgrade pytest + - choco uninstall -y mingw + - choco upgrade --no-progress -y msys2 + - export msys2='cmd //C RefreshEnv.cmd ' + - export msys2+='& set MSYS=winsymlinks:nativestrict ' + - export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start' + - export mingw64="$msys2 -mingw64 -full-path -here -c "\"\$@"\" --" + - export msys2+=" -msys2 -c "\"\$@"\" --" + - $msys2 pacman --sync --noconfirm --needed mingw-w64-x86_64-toolchain + - export PATH=/C/tools/msys64/mingw64/bin:$PATH + - export MAKE=mingw32-make # so that Autotools can find it + - $msys2 pacman -S mingw-w64-x86_64-gtk3 --noconfirm + env: PATH=/c/Python37:/c/Python37/Scripts:$PATH + - os: linux + python: 3.6 + - os: linux + python: 3.7 + - os: linux + python: 3.8 + - os: linux + python: pypy3 + +before_install: + - python --version + - pip install -U pip + - pip install -U pytest +install: + - pip install -r requirements.txt script: "pytest test.py" + deploy: provider: pypi user: "__token__" diff --git a/py_avataaars/__init__.py b/py_avataaars/__init__.py index fb9a4d9..48ccfc8 100644 --- a/py_avataaars/__init__.py +++ b/py_avataaars/__init__.py @@ -245,7 +245,7 @@ def __unique_id(prefix: str = None) -> str: @staticmethod def __template_path(path: str, enum_type: AvatarEnum) -> str: - return str(pathlib.Path(path).joinpath(f"{enum_type.name.lower()}.svg")) + return str(pathlib.PurePosixPath(path).joinpath(f"{enum_type.name.lower()}.svg")) @staticmethod def __template_name(context): diff --git a/setup.py b/setup.py index 9a8fb51..d317892 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name='py-avataaars', - version='1.0.1', + version='1.0.2', license='MIT', description='Python Avatar generator library', long_description=long_description,