OpenLP: update to 2.9.4.

This commit is contained in:
Joel Beckmeyer 2022-02-28 18:41:59 -05:00 committed by Piotr
parent cfac1e4e65
commit aed518f4d3
3 changed files with 99 additions and 12 deletions

View file

@ -0,0 +1,11 @@
diff --git a/setup.py b/setup.py
index 1476585..4fc3ab0 100644
--- a/setup.py
+++ b/setup.py
@@ -141,6 +141,5 @@ using a computer and a data projector.""",
'flake8',
]
},
- setup_requires=['pytest-runner'],
entry_points={'gui_scripts': ['openlp = openlp.__main__:start']}
)

View file

@ -0,0 +1,67 @@
From 54ad75426825cdd977f770b12a62ee92218b82d6 Mon Sep 17 00:00:00 2001
From: Raoul Snyman <raoul@snyman.info>
Date: Thu, 3 Feb 2022 11:26:24 -0700
Subject: [PATCH] Make two versions of a test to work around a difference in
Python 3.10
---
tests/openlp_core/common/test_applocation.py | 29 +++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/tests/openlp_core/common/test_applocation.py b/tests/openlp_core/common/test_applocation.py
index 2aebc5213..432773ec7 100644
--- a/tests/openlp_core/common/test_applocation.py
+++ b/tests/openlp_core/common/test_applocation.py
@@ -22,9 +22,12 @@
Functional tests to test the AppLocation class and related methods.
"""
import os
+import sys
from pathlib import Path
from unittest.mock import patch
+import pytest
+
from openlp.core.common import get_frozen_path
from openlp.core.common.applocation import AppLocation
@@ -141,11 +144,35 @@ def test_get_directory_for_app_dir(mocked_get_frozen_path):
assert directory == Path.cwd() / Path('app', 'dir'), 'Directory should be "app/dir"'
+@pytest.mark.skipif(sys.version_info < (3, 10), reason="Python 3.10 version of this test")
+@patch('openlp.core.common.applocation.get_frozen_path')
+@patch('openlp.core.common.applocation.os.path.abspath')
+@patch('openlp.core.common.applocation.os.path.split')
+@patch('openlp.core.common.applocation.sys')
+def test_get_directory_for_plugins_dir_py310(mocked_sys, mocked_split, mocked_abspath, mocked_get_frozen_path):
+ """
+ Test the AppLocation.get_directory() method for AppLocation.PluginsDir
+ """
+ # GIVEN: _get_frozen_path, abspath, split and sys are mocked out
+ mocked_abspath.return_value = os.path.join('dir', 'plugins')
+ mocked_split.return_value = ['openlp']
+ mocked_get_frozen_path.return_value = Path('dir')
+ mocked_sys.frozen = 1
+ mocked_sys.argv = ['openlp']
+
+ # WHEN: We call AppLocation.get_directory
+ directory = AppLocation.get_directory(AppLocation.PluginsDir)
+
+ # THEN: The correct directory should be returned
+ assert directory == Path('dir', 'plugins'), 'Directory should be "dir/plugins"'
+
+
+@pytest.mark.skipif(sys.version_info >= (3, 10), reason="Python 3.9 version of this test")
@patch('openlp.core.common.applocation.get_frozen_path')
@patch('openlp.core.common.applocation.os.path.abspath')
@patch('openlp.core.common.applocation.os.path.split')
@patch('openlp.core.common.applocation.sys')
-def test_get_directory_for_plugins_dir(mocked_sys, mocked_split, mocked_abspath, mocked_get_frozen_path):
+def test_get_directory_for_plugins_dir_py39(mocked_sys, mocked_split, mocked_abspath, mocked_get_frozen_path):
"""
Test the AppLocation.get_directory() method for AppLocation.PluginsDir
"""
--
GitLab

View file

@ -1,26 +1,35 @@
# Template file for 'OpenLP'
pkgname=OpenLP
version=2.4.6
revision=5
version=2.9.4
revision=1
wrksrc="OpenLP-${version}"
create_wrksrc=yes
build_style=python3-module
# test always fails with AssertionError
# see https://gitlab.com/openlp/openlp/-/issues/1024
make_check_args="--deselect tests/openlp_core/ui/test_mainwindow.py::test_load_settings_position_invalid"
hostmakedepends="python3-setuptools qt5-host-tools"
depends="python3-BeautifulSoup4 python3-PyQt5-multimedia python3-PyQt5-opengl
python3-PyQt5-webkit python3-SQLAlchemy python3-alembic python3-chardet
python3-lxml"
depends="python3-alembic python3-appdirs python3-BeautifulSoup4 python3-chardet
python3-dbus python3-distro python3-Flask python3-Flask-Cors python3-lxml
python3-Mako python3-Pillow python3-pymediainfo python3-PyQt5
python3-PyQt5-multimedia python3-PyQt5-webengine python3-vlc python3-qrcode
python3-QtAwesome python3-requests python3-SQLAlchemy python3-waitress
python3-WebOb python3-websockets python3-zeroconf"
checkdepends="python3-pytest-qt ${depends}"
short_desc="Free Worship Presentation Software for your Church"
maintainer="Piotr Wójcik <chocimier@tlen.pl>"
license="GPL-2.0-only"
license="GPL-3.0-or-later"
homepage="https://openlp.org/"
distfiles="https://get.openlp.org/${version}/OpenLP-${version}.tar.gz"
checksum=f63dcf5f1f8a8199bf55e806b44066ad920d26c9cf67ae432eb8cdd1e761fc30
checksum=24dcd14841b5a6a03e0ac12202628429f467264ac8605268c63b6634121dd73a
do_check() {
: # nosetests -v tests segfaults
}
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
# test fails with XMLSyntaxError
# see https://gitlab.com/openlp/openlp/-/issues/1023
make_check_args+=" --deselect tests/openlp_plugins/songs/test_presentationmanagerimport.py::test_presenter_manager"
fi
post_install() {
rm -r ${DESTDIR}/usr/lib/python*/site-packages/tests
mv ${DESTDIR}/usr/bin/openlp.py ${DESTDIR}/usr/bin/openlp
vinstall resources/openlp.desktop 644 usr/share/applications
vmkdir usr/share/openlp/i18n
cd resources/i18n