Drop the QtSvg dependency as it is no longer used

This commit is contained in:
Veronica K. B. Olsen
2020-10-04 16:22:11 +02:00
parent 2682314c6a
commit eaf8e83d40
4 changed files with 12 additions and 15 deletions
+2 -3
View File
@@ -121,7 +121,7 @@ regularly tested on Windows 10.
The application can be started from the source folder with one of the commands, depending on your
Python configuration:
```
```bash
./novelWriter.py
python novelWriter.py
python3 novelWriter.py
@@ -141,10 +141,9 @@ It is recommended that novelWriter runs with Qt 5.10 or later, and Python 3.6 or
Qt as low as 5.2.1 and Python 3.4.3 has been tested, and worked in the past, but there are no
guarantees that this will keep working as these are not a part of the test builds.
For the apt package manager on Debian systems, the following Python3 packages are needed:
For the apt package manager on Debian/Ubuntu systems, the following Python3 packages are needed:
* `python3-pyqt5` for the GUI
* `python3-pyqt5.qtsvg` may need to be installed separately
* `python3-lxml` for writing project files
These are optional, but recommended:
-4
View File
@@ -66,10 +66,6 @@ The following Python packages are required to run novelWriter:
You can of course also install these packages from your operating system's package repository.
.. note::
Sometimes the SVG graphics package for PyQt5 must be installed separately. It is usually called
something like ``python3-pyqt5.qtsvg``.
PyQt/Qt should be at least 5.2.1, but ideally 5.10 or higher for nearly all features to work.
Exporting to standard Markdown, for instance, requires PyQt/Qt 5.14. Searching using regular
expressions requires 5.3, and for full Unicode support, 5.13.
+6 -6
View File
@@ -199,28 +199,28 @@ def main(sysArgs=None):
# Check Packages and Versions
errorData = []
errorCode = 0
if sys.hexversion < 0x030403f0:
errorData.append(
"At least Python 3.4.3 is required, but 3.6 is highly recommended."
)
errorCode |= 4
if CONFIG.verQtValue < 50200:
errorData.append(
"At least Qt5 version 5.2 is required, found %s." % CONFIG.verQtString
)
errorCode |= 8
if CONFIG.verPyQtValue < 50200:
errorData.append(
"At least PyQt5 version 5.2 is required, found %s." % CONFIG.verPyQtString
)
try:
import PyQt5.QtSvg # noqa: F401
except ImportError:
errorData.append("Python module 'PyQt5.QtSvg' is missing.")
errorCode |= 16
try:
import lxml # noqa: F401
except ImportError:
errorData.append("Python module 'lxml' is missing.")
errorCode |= 32
if errorData:
if not testMode:
@@ -236,7 +236,7 @@ def main(sysArgs=None):
"<br>&nbsp;-&nbsp;".join(errorData)
))
errApp.exec_()
sys.exit(10 + len(errorData))
sys.exit(errorCode)
# Finish initialising config
CONFIG.initConfig(confPath, dataPath)
+4 -2
View File
@@ -85,7 +85,6 @@ def testLaunch(qtbot, monkeypatch, nwFuncTemp, nwTemp):
assert ex.value.code == 2
# Simulate import error
monkeypatch.setitem(sys.modules, "PyQt5.QtSvg", None)
monkeypatch.setitem(sys.modules, "lxml", None)
monkeypatch.setattr("sys.hexversion", 0x0)
monkeypatch.setattr("nw.CONFIG.verQtValue", 50000)
@@ -96,7 +95,10 @@ def testLaunch(qtbot, monkeypatch, nwFuncTemp, nwTemp):
)
nwGUI.closeMain()
nwGUI.close()
assert ex.value.code == 15
assert ex.value.code & 4 == 4 # Python version not satisfied
assert ex.value.code & 8 == 8 # Qt version not satisfied
assert ex.value.code & 16 == 16 # PyQt version not satisfied
assert ex.value.code & 32 == 32 # lxml package missing
monkeypatch.undo()
@pytest.mark.gui