Compare commits

..

5 Commits

Author SHA1 Message Date
deadbe9383 p2 fix coverals 2021-02-07 15:09:59 +01:00
5cbec2e06f p2 fix 2021-02-07 15:04:36 +01:00
66d284f183 p2 fix 2021-02-07 14:54:50 +01:00
ae64fd6e99 p2 fix 2021-02-07 14:52:04 +01:00
305bd3008d fix python2 support 2021-02-07 14:48:19 +01:00
5 changed files with 53 additions and 7 deletions

View File

@ -14,19 +14,33 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
- name: Set up Python 2.x
uses: actions/setup-python@v2
with:
python-version: '2.x'
- name: Install dependencies 3.x
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Install dependencies 2.x
run: |
python2 -m pip install --upgrade pip
pip2 install setuptools
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python3 -m twine check dist/*
python3 setup.py sdist bdist_wheel
python2 setup.py sdist bdist_wheel
twine check dist/*
twine upload dist/*

View File

@ -17,7 +17,7 @@ jobs:
- name: Prepare
run: lsmod && sudo apt update && sudo apt install zfsutils-linux && sudo -H pip3 install coverage unittest2 mock==3.0.5 coveralls
run: sudo apt update && sudo apt install zfsutils-linux && sudo -H pip3 install coverage unittest2 mock==3.0.5 coveralls
- name: Regression test
@ -39,7 +39,7 @@ jobs:
- name: Prepare
run: lsmod && sudo apt update && sudo apt install zfsutils-linux python3-setuptools && sudo -H pip3 install coverage unittest2 mock==3.0.5 coveralls
run: sudo apt update && sudo apt install zfsutils-linux python3-setuptools && sudo -H pip3 install coverage unittest2 mock==3.0.5 coveralls
- name: Regression test
@ -50,3 +50,27 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
ubuntu18_python2:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Set up Python 2.x
uses: actions/setup-python@v2
with:
python-version: '2.x'
- name: Prepare
run: sudo apt update && sudo apt install zfsutils-linux python-setuptools && sudo -H pip install coverage unittest2 mock==3.0.5 coveralls
- name: Regression test
run: sudo -E ./tests/run_tests
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github

View File

@ -1,5 +1,9 @@
# python 2 compatibility
from __future__ import print_function
import sys
colorama = False
if sys.stdout.isatty():
try:
@ -39,4 +43,4 @@ class LogConsole:
print(colorama.Fore.GREEN + "# " + txt + colorama.Style.RESET_ALL)
else:
print("# " + txt)
sys.stdout.flush()
sys.stdout.flush()

View File

@ -1,3 +1,5 @@
# python 2 compatibility
from __future__ import print_function
import re
import subprocess
import sys

View File

@ -1,4 +1,6 @@
def cli():
import sys
from zfs_autobackup.ZfsAutobackup import ZfsAutobackup