Drop the QtSvg dependency as it is no longer used
This commit is contained in:
@@ -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
|
The application can be started from the source folder with one of the commands, depending on your
|
||||||
Python configuration:
|
Python configuration:
|
||||||
```
|
```bash
|
||||||
./novelWriter.py
|
./novelWriter.py
|
||||||
python novelWriter.py
|
python novelWriter.py
|
||||||
python3 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
|
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.
|
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` for the GUI
|
||||||
* `python3-pyqt5.qtsvg` may need to be installed separately
|
|
||||||
* `python3-lxml` for writing project files
|
* `python3-lxml` for writing project files
|
||||||
|
|
||||||
These are optional, but recommended:
|
These are optional, but recommended:
|
||||||
|
|||||||
@@ -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.
|
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.
|
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
|
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.
|
expressions requires 5.3, and for full Unicode support, 5.13.
|
||||||
|
|||||||
+6
-6
@@ -199,28 +199,28 @@ def main(sysArgs=None):
|
|||||||
|
|
||||||
# Check Packages and Versions
|
# Check Packages and Versions
|
||||||
errorData = []
|
errorData = []
|
||||||
|
errorCode = 0
|
||||||
if sys.hexversion < 0x030403f0:
|
if sys.hexversion < 0x030403f0:
|
||||||
errorData.append(
|
errorData.append(
|
||||||
"At least Python 3.4.3 is required, but 3.6 is highly recommended."
|
"At least Python 3.4.3 is required, but 3.6 is highly recommended."
|
||||||
)
|
)
|
||||||
|
errorCode |= 4
|
||||||
if CONFIG.verQtValue < 50200:
|
if CONFIG.verQtValue < 50200:
|
||||||
errorData.append(
|
errorData.append(
|
||||||
"At least Qt5 version 5.2 is required, found %s." % CONFIG.verQtString
|
"At least Qt5 version 5.2 is required, found %s." % CONFIG.verQtString
|
||||||
)
|
)
|
||||||
|
errorCode |= 8
|
||||||
if CONFIG.verPyQtValue < 50200:
|
if CONFIG.verPyQtValue < 50200:
|
||||||
errorData.append(
|
errorData.append(
|
||||||
"At least PyQt5 version 5.2 is required, found %s." % CONFIG.verPyQtString
|
"At least PyQt5 version 5.2 is required, found %s." % CONFIG.verPyQtString
|
||||||
)
|
)
|
||||||
|
errorCode |= 16
|
||||||
try:
|
|
||||||
import PyQt5.QtSvg # noqa: F401
|
|
||||||
except ImportError:
|
|
||||||
errorData.append("Python module 'PyQt5.QtSvg' is missing.")
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import lxml # noqa: F401
|
import lxml # noqa: F401
|
||||||
except ImportError:
|
except ImportError:
|
||||||
errorData.append("Python module 'lxml' is missing.")
|
errorData.append("Python module 'lxml' is missing.")
|
||||||
|
errorCode |= 32
|
||||||
|
|
||||||
if errorData:
|
if errorData:
|
||||||
if not testMode:
|
if not testMode:
|
||||||
@@ -236,7 +236,7 @@ def main(sysArgs=None):
|
|||||||
"<br> - ".join(errorData)
|
"<br> - ".join(errorData)
|
||||||
))
|
))
|
||||||
errApp.exec_()
|
errApp.exec_()
|
||||||
sys.exit(10 + len(errorData))
|
sys.exit(errorCode)
|
||||||
|
|
||||||
# Finish initialising config
|
# Finish initialising config
|
||||||
CONFIG.initConfig(confPath, dataPath)
|
CONFIG.initConfig(confPath, dataPath)
|
||||||
|
|||||||
+4
-2
@@ -85,7 +85,6 @@ def testLaunch(qtbot, monkeypatch, nwFuncTemp, nwTemp):
|
|||||||
assert ex.value.code == 2
|
assert ex.value.code == 2
|
||||||
|
|
||||||
# Simulate import error
|
# Simulate import error
|
||||||
monkeypatch.setitem(sys.modules, "PyQt5.QtSvg", None)
|
|
||||||
monkeypatch.setitem(sys.modules, "lxml", None)
|
monkeypatch.setitem(sys.modules, "lxml", None)
|
||||||
monkeypatch.setattr("sys.hexversion", 0x0)
|
monkeypatch.setattr("sys.hexversion", 0x0)
|
||||||
monkeypatch.setattr("nw.CONFIG.verQtValue", 50000)
|
monkeypatch.setattr("nw.CONFIG.verQtValue", 50000)
|
||||||
@@ -96,7 +95,10 @@ def testLaunch(qtbot, monkeypatch, nwFuncTemp, nwTemp):
|
|||||||
)
|
)
|
||||||
nwGUI.closeMain()
|
nwGUI.closeMain()
|
||||||
nwGUI.close()
|
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()
|
monkeypatch.undo()
|
||||||
|
|
||||||
@pytest.mark.gui
|
@pytest.mark.gui
|
||||||
|
|||||||
Reference in New Issue
Block a user