Merge branch 'main' into fix_docs

This commit is contained in:
Veronica Berglyd Olsen
2025-10-22 22:43:06 +02:00
committed by GitHub
28 changed files with 290 additions and 263 deletions
-8
View File
@@ -1,8 +0,0 @@
docutils>=0.17.1
pygments>=2.7
sphinx-book-theme
sphinx-copybutton
sphinx-design
sphinx-favicon
sphinx-intl
sphinx>=5.0
+24 -5
View File
@@ -7,6 +7,7 @@ Running from Source
.. _GitHub: https://github.com/vkbo/novelWriter/releases
.. _PyPi: https://pypi.org/project/novelWriter/
.. _Sphinx Docs: https://www.sphinx-doc.org/
.. _uv: https://docs.astral.sh/uv/
This chapter describes various ways of running novelWriter directly from the source code, and how
to build the various components like the translation files and documentation.
@@ -28,6 +29,7 @@ by running:
.. _docs_technical_source_depend:
Dependencies
============
@@ -43,11 +45,20 @@ The following Python packages are needed to run all features of novelWriter:
If you want spell checking, you must install the ``PyEnchant`` package. The spell check library
must be at least 3.0 to work with Windows. On Linux, 2.0 also works fine.
If you install from PyPi, these dependencies should be installed automatically. If you install from
source, dependencies can still be installed from PyPi with:
If you install novelWriter from PyPi, these dependencies should be installed automatically.
You can run novelWriter directly from source with uv_:
.. code-block:: bash
uv run novelwriter
If you prefer to install dependencies using ``pip``, you must first generate the
``requirements.txt`` file:
.. code-block:: bash
python pkgutils.py gen-req
pip install -r requirements.txt
.. note::
@@ -136,12 +147,14 @@ running:
Building the Documentation
==========================
A local copy of this documentation can be generated as HTML. This requires installing some Python
packages from PyPi:
A local copy of this documentation can be generated as HTML.
If you're using ``pip``, you must first generate the ``requirements.txt`` file:
.. code-block:: bash
pip install -r docs/requirements.txt
python pkgutils.py gen-req docs
pip install -r requirements.txt
The documentation can then be built from the root folder in the source code by running:
@@ -149,6 +162,12 @@ The documentation can then be built from the root folder in the source code by r
make -C docs html
Or you can run directly with uv_:
.. code-block:: bash
uv run make -C docs html
If successful, the documentation should be available in the ``docs/build/html`` folder and you can
open the ``index.html`` file in your browser.
+20 -15
View File
@@ -4,23 +4,12 @@
Running Tests
*************
.. _uv: https://docs.astral.sh/uv/
The novelWriter source code is well covered by tests. The test framework used for the development
is ``pytest`` with the use of an extension for Qt.
Dependencies
============
The dependencies for running the tests can be installed with:
.. code-block:: bash
pip install -r tests/requirements.txt
This will install a couple of extra packages for coverage and test management. The minimum
requirement is ``pytest`` and ``pytest-qt``.
Simple Test Run
===============
@@ -28,19 +17,35 @@ To run the tests, you simply need to execute the following from the root of the
.. code-block:: bash
pytest
uv run pytest
This uses uv_. See below for manually installing dependencies using ``pip``.
Since several of the tests involve opening up the novelWriter GUI, you may want to disable the GUI
for the duration of the test run. Moving your mouse while the tests are running may otherwise
interfere with the execution of some tests.
You can disable the renderring of the GUI by setting the flag ``QT_QPA_PLATFORM=offscreen``:
You can disable the rendering of the GUI by setting the flag ``QT_QPA_PLATFORM=offscreen``:
.. code-block:: bash
export QT_QPA_PLATFORM=offscreen pytest
Dependencies
------------
To generate the requirements file and install dependencies using ``pip``, run:
.. code-block:: bash
python pkgutils.py gen-req app test
pip install -r tests/requirements.txt
This will install a couple of extra packages for coverage and test management. The minimum
requirement is ``pytest`` and ``pytest-qt``.
Advanced Options
================