From 84944ad8c2fbd7d9ea6ea0cd283511457ea9bcc1 Mon Sep 17 00:00:00 2001 From: inso <insomniak.fr@gmaiL.com> Date: Mon, 26 Feb 2018 13:31:55 +0100 Subject: [PATCH] Working on gitlab integration Squashed commit of the following: commit cb9f20e1dd7ebbb069f62a8bf8bf19387d3c5940 Author: inso <insomniak.fr@gmaiL.com> Date: Mon Feb 26 13:19:34 2018 +0100 Add badge coverage commit 09b1dd2607d8186e0d30a258c461cdc181c583c5 Author: inso <insomniak.fr@gmaiL.com> Date: Mon Feb 26 13:13:22 2018 +0100 Build and test commit ce734175af391966f33007bed7ed93d4cec8118f Author: inso <insomniak.fr@gmaiL.com> Date: Mon Feb 26 13:10:17 2018 +0100 Test coverage in gitlab commit 29c607817bc7c2173354b6feb98f327854a32641 Author: inso <insomniak.fr@gmaiL.com> Date: Mon Feb 26 08:38:15 2018 +0100 Use image starting xvfb commit 2de8d86140a03110e9f88a6ce2177fd7ec07ae53 Author: inso <insomniak.fr@gmaiL.com> Date: Mon Feb 26 08:29:07 2018 +0100 xbfv commit 28d965856c94a828fa09e4b8d1a622db83b1e307 Author: inso <insomniak.fr@gmaiL.com> Date: Mon Feb 26 08:15:07 2018 +0100 Fix encoding commit 8b0ce409ccd3f4346a89cd0c6fc6dab135fb5ecf Author: inso <insomniak.fr@gmaiL.com> Date: Mon Feb 26 08:09:29 2018 +0100 set locale commit 996e1c810fed70571e8036aae315aaf2069b7bcd Author: inso <insomniak.fr@gmaiL.com> Date: Mon Feb 26 07:59:19 2018 +0100 Test commit 9a462f3f4200d4b52dddf742943728d24db9e477 Author: inso <insomniak.fr@gmaiL.com> Date: Mon Feb 26 07:42:56 2018 +0100 Build on image 0.0.6 commit 3dd3d1134df2bd69a508ff359e674f69f8e56855 Author: inso <insomniak.fr@gmaiL.com> Date: Sun Feb 25 14:14:57 2018 +0100 ls in dist commit 56cb714f88646737c410d14a3af169c8f9b0eb30 Author: inso <insomniak.fr@gmaiL.com> Date: Sun Feb 25 14:12:23 2018 +0100 ls -l 5.. commit a0e29a2709d8422350b02c748c50b63284d8ae80 Author: inso <insomniak.fr@gmaiL.com> Date: Sun Feb 25 14:08:04 2018 +0100 ls -l commit 11cdebbdb31e3db4380ad3d3e051587395ce977d Author: inso <insomniak.fr@gmaiL.com> Date: Sun Feb 25 13:38:31 2018 +0100 Env commit cd3e2688b2a2ca8a461ca1bb5b2e98f0e70fcacd Author: inso <insomniak.fr@gmaiL.com> Date: Sun Feb 25 13:31:15 2018 +0100 qt5 env --- .gitlab-ci.yml | 38 ++++++++---------------- README.md | 5 ++-- ci/travis/before_install.sh | 2 +- ci/travis/qt-installer-noninteractive.qs | 4 +-- src/sakia/constants.py | 4 +-- src/sakia/main.py | 1 + tests/conftest.py | 2 +- 7 files changed, 22 insertions(+), 34 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 791b7eac..1482ffb1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,14 +1,12 @@ stages: - github-sync - - prepare - - build - - test + - build_and_test - release variables: PYENV_PYTHON_VERSION: 3.5.5 -image: registry.duniter.org/docker/python3/duniterpy-builder:0.0.5 +image: registry.duniter.org/docker/python3/duniterpy-builder:0.0.7 push_to_github: stage: github-sync @@ -28,7 +26,7 @@ push_to_github: - mv packed-refs-new packed-refs - bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?" -.pyenv: &pyenv +.env: &env tags: - redshift-docker-python before_script: @@ -36,39 +34,29 @@ push_to_github: - export PATH="$PYENV_ROOT/bin:$PATH" - eval "$(pyenv init -)" - pyenv shell $PYENV_PYTHON_VERSION + - export PATH=/opt/qt/5.9/5.9.4/gcc_64/bin:$PATH + - export DISPLAY=:99 -.qt5: &qt5 - tags: - - redshift-docker-python - before_script: - - export PATH=/opt/qt/5.9/5.9/gcc_64/bin:$PATH -build: &build - <<: *pyenv - stage: build - script: - - pip install -r requirements.txt - - python gen_resources.py - - python gen_translations.py --lrelease - - python setup.py sdist bdist_wheel - - py.test -test: - <<: *pyenv - stage: test +build_and_test: &build_and_test + <<: *env + stage: build_and_test script: - - pip install coveralls + - pip install wheel + - pip install pytest-cov - pip install -r requirements.txt - python gen_resources.py - python gen_translations.py --lrelease + - python setup.py bdist_wheel - py.test --cov=sakia tests/ releases: - <<: *pyenv + <<: *env stage: release when: manual script: - pip install -r requirements.txt - pip install wheel - pip install twine - - python setup.py sdist bdist_wheel + - python setup.py bdist_wheel - twine upload dist/* --username duniter --password $PYPI_PASSWORD diff --git a/README.md b/README.md index 37ef6011..1c363a26 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,10 @@  # Sakia -[](https://coveralls.io/r/duniter/sakia) + [](https://git.duniter.org/clients/python/sakia/commits/gitlab) + [](https://git.duniter.org/clients/python/sakia/commits/gitlab) [](https://travis-ci.org/duniter/sakia) [](https://ci.appveyor.com/project/Insoleet/sakia-bee4m/branch/dev) - [](http://weblate.duniter.org/engage/sakia/?utm_source=widget) - [](https://www.quantifiedcode.com/app/project/3fff212226eb4027a586bc32e32d909b) ======== diff --git a/ci/travis/before_install.sh b/ci/travis/before_install.sh index 5b4abc35..c0d85bff 100755 --- a/ci/travis/before_install.sh +++ b/ci/travis/before_install.sh @@ -29,7 +29,7 @@ then dbus-x11 wget https://download.qt.io/official_releases/qt/5.9/5.9.4/qt-opensource-linux-x64-5.9.4.run chmod +x qt-opensource-linux-x64-5.9.4.run - ./qt-opensource-linux-x64-5.9.4.run --script $HOME/build/duniter/sakia/ci/travis/qt-installer-noninteractive.qs + ./qt-opensource-linux-x64-5.9.4.run -v --script $HOME/build/duniter/sakia/ci/travis/qt-installer-noninteractive.qs wget http://archive.ubuntu.com/ubuntu/pool/universe/libs/libsodium/libsodium18_1.0.13-1_amd64.deb sudo dpkg -i libsodium18_1.0.13-1_amd64.deb diff --git a/ci/travis/qt-installer-noninteractive.qs b/ci/travis/qt-installer-noninteractive.qs index 148160f7..6d526621 100644 --- a/ci/travis/qt-installer-noninteractive.qs +++ b/ci/travis/qt-installer-noninteractive.qs @@ -26,9 +26,9 @@ Controller.prototype.TargetDirectoryPageCallback = function() } Controller.prototype.ComponentSelectionPageCallback = function() { - //var widget = gui.currentPageWidget(); + var widget = gui.currentPageWidget(); - //widget.selectAll(); + widget.selectAll(); gui.clickButton(buttons.NextButton); } diff --git a/src/sakia/constants.py b/src/sakia/constants.py index c1ad2bef..d5c59565 100644 --- a/src/sakia/constants.py +++ b/src/sakia/constants.py @@ -3,8 +3,8 @@ import yaml MAX_CONFIRMATIONS = 6 -with open(os.path.join(os.path.dirname(__file__), "root_servers.yml"), 'r') as stream: +with open(os.path.join(os.path.dirname(__file__), "root_servers.yml"), 'r', encoding="utf-8") as stream: ROOT_SERVERS = yaml.load(stream) -with open(os.path.join(os.path.dirname(__file__), "g1_licence.html"), 'r') as stream: +with open(os.path.join(os.path.dirname(__file__), "g1_licence.html"), 'r', encoding="utf-8") as stream: G1_LICENCE = stream.read() diff --git a/src/sakia/main.py b/src/sakia/main.py index 82b42936..187e850f 100755 --- a/src/sakia/main.py +++ b/src/sakia/main.py @@ -1,3 +1,4 @@ +import locale import asyncio import logging import signal diff --git a/tests/conftest.py b/tests/conftest.py index c5153423..c3df0702 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,6 +5,7 @@ import sqlite3 import mirage import sys import os +import locale sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src'))) @@ -20,7 +21,6 @@ from sakia.services import DocumentsService _application_ = [] - @pytest.yield_fixture def event_loop(): qapplication = get_application() -- GitLab